com.eurotech.framework.cloud
Interface CloudService


public interface CloudService

The CloudService provides an easy to use API layer for M2M application to communicate with a remote server. It operates as a decorator for the DataService providing add-on features over the management of the transport layer. In addition to simple publish/subscribe, the Cloud Service API simplifies the implementation of more complex interaction flows like request/response or remote resource management. Cloud Service abstracts the developers from the complexity of the transport protocol and payload format used in the communication.
CloudService allows for a single connection to a remote server to be shared across more than one application in the gateway providing the necessary topic partitioning.
Its responsibilities can be summarized as:

The CloudService can be used through the CloudClient API or by extending the Cloudlet class. Cloudlet simplifies the interactions with remote servers providing a servlet-like API to implement request and response flows and remote resource management.


Method Summary
 String[] getCloudApplicationIdentifiers()
          Returns the application identifiers for which a CloudClient instance was created.
 boolean isConnected()
          Returns true if the underlying DataService is currently connected to the remote server.
 CloudClient newCloudClient(String appId)
          Returns a new instance of the CloudClient for the given application Id.
 

Method Detail

newCloudClient

CloudClient newCloudClient(String appId)
                           throws EsfException
Returns a new instance of the CloudClient for the given application Id. The CloudClient is designed to be used by single application bundles. CloudClient instances are acquired from the CloudService and they are released when the work is completed. Generally, a CloudClient is acquired during the activation phase of a bundle and it is released through the CloudClient.release() method during the bundle deactivation phase.
CloudClient will clean-up the subscriptions and the callback registrations when the CloudClient.release() method is called.
If the bundle using the CloudClient relies on subscriptions, it is responsibility of the application to implement the CloudClientListener#connectionRestored callback method in the CloudCallbackHandler to restore the subscriptions it needs.

Parameters:
appId - A String object specifying a unique application ID.
Returns:
CloudClient instance
Throws:
EsfException

getCloudApplicationIdentifiers

String[] getCloudApplicationIdentifiers()
Returns the application identifiers for which a CloudClient instance was created.

Returns:
An array of application identifiers

isConnected

boolean isConnected()
Returns true if the underlying DataService is currently connected to the remote server.

Returns:


Copyright © 2013. All Rights Reserved.