AppKinetics service provider implementation. More...
Service requests received within the AppKinetics system are handled by creating a class that implements this interface. Implementation is mandatory for applications that provide services. An instance of the class must be set as the observer for inbound service requests, by calling the setServiceListener
method of the application's GDService instance.
This class also includes a callback that is invoked when transmission of a service response completes.
This class is part of the service provider side of the AppKinetics programming interface.
The callbacks in this class will be invoked in the following sequence when a service request is received.
The first two of these callbacks enable the application to display a receiving status in its user interface. No action should be taken on any attachment files until the last callback, GDServiceListener.onReceiveMessage .
Public Member Functions | |
void | onReceivingAttachments (String application, int numberOfAttachments, String requestID) |
Service request file attachments transmission start callback. More... | |
void | onReceivingAttachmentFile (String application, String path, long size, String requestID) |
Service request individual file attachment transmission start callback. More... | |
void | onReceiveMessage (String application, String service, String version, String method, Object params, String[] attachments, String requestID) |
Service request callback. More... | |
void | onMessageSent (String application, String requestID, String[] attachments) |
Service response transmission complete callback. More... | |
void onReceivingAttachments | ( | String | application, |
int | numberOfAttachments, | ||
String | requestID | ||
) |
This callback is invoked when file attachments are about to be received through the AppKinetics system. The number of files that are about to be received is passed as a parameter.
This callback will be invoked once per service request that has attachments. See under Callback Invocation Sequence, above, for its position in the order of service request callbacks.
The method that is invoked could display a receiving status in its user interface. The status could be cleared on receipt of the GDServiceListener.onReceiveMessage callback.
application | String containing the native application identifier of the consumer application that sent the service request to which the files are attached. |
numberOfAttachments | int number of files that are about to be received, always one or more. This callback isn't invoked for service requests that have no attachments. |
requestID | String containing the unique identifier of the service request to which the files are attached. |
void onReceivingAttachmentFile | ( | String | application, |
String | path, | ||
long | size, | ||
String | requestID | ||
) |
This callback is invoked when an individual file attachment is about to be received through the AppKinetics system. The path and size of the file that is about to be received are passed as parameters.
This callback will be invoked once per attachment. See under Callback Invocation Sequence, above, for its position in the order of service request callbacks.
The method that is invoked could display a receiving status in its user interface. The status could be cleared on receipt of the GDServiceListener.onReceiveMessage callback.
application | String containing the native application identifier of the consumer application that sent the service request to which the file is attached. |
path | String containing the path of the attachment. The value will be the same as one of the elements in the attachments parameter passed to the subsequent GDServiceListener.onReceiveMessage invocation. |
size | long representing the size of the file in bytes. |
requestID | String containing the unique identifier of the service request to which the file is attached. |
void onReceiveMessage | ( | String | application, |
String | service, | ||
String | version, | ||
String | method, | ||
Object | params, | ||
String[] | attachments, | ||
String | requestID | ||
) |
This callback is invoked when a service request is sent to the application within the AppKinetics system. The parameters with which this method is called give the details of the service request.
For an overall description of AppKinetics see the icc package reference.
See under Callback Invocation Sequence, above, for the position of this callback in the order of service request callbacks.
When this callback is invoked, the application must:
If the application determines that a service request is invalid then the application should return an error in the replyTo
call. For some check failures, the application must set a particular code in the returned error. These are documented in the Parameters section, below.
application | String containing the native application identifier of the consumer application that sent the service request. The application is not required to check the value, but may do so. For example, the application could be coded only to process service requests from a known set of consumer applications, and to fail requests from unknown applications. |
service | String containing the identifier of the service being requested. The application must check the value. If the application does not offer the requested service then the GDServicesErrorServiceNotFound code must be set. |
version | String containing the version identifier of the service being requested. The application must check the value. If the application does not offer the requested service version then the GDServicesErrorServiceVersionNotFound code must be set. |
method | String containing the name of the method within the service request. The application must check the value. If the application does not offer the requested method then the GDServicesErrorMethodNotFound code must be set. |
params | The service parameters in the request, sent by the consumer application. See under Service Parameters in the icc package reference. If the service parameters are in some way invalid then a service-specific error code could be set, or this could be handled in some other way according to the service definition. |
attachments | Array of String objects containing the paths of files that were attached to the service request. See under File Attachments in the icc package reference. If the file attachments are in some way invalid then a service-specific error code could be set in the results object, or this could be handled in some other way according to the service definition. |
requestID | String containing the unique identifier assigned to this service request by the AppKinetics system. The application must pass this value as the requestID parameter in the replyTo (GDService) call if it responds to the request. |
void onMessageSent | ( | String | application, |
String | requestID, | ||
String[] | attachments | ||
) |
This callback is invoked when delivery of an AppKinetics service response completes.
Invocation of this callback notifies the application that:
The method that is invoked can delete or modify any of the original file attachments, and free any resources used to hold the response parameters.
requestID | String containing the unique identifier of the service request to which the sending of the response has completed. |
attachments | Array of String objects containing the paths of any files that were attached to the service response. |
application | String containing the native application identifier of the application to which the service response was sent. |