@ProviderType
public interface CloudConnectionManager
CloudEndpoint
can implement CloudConnectionManager to support the management of
long-lived/always on connections.
This interface provides methods to connect, disconnect and get the connection state of the associated CloudEndpoint.
It also provides methods to register CloudConnectionListener
s that will be notified of connection-related
events.
The implementor must register itself as a CloudConnectionManager OSGi service provider.Modifier and Type | Method and Description |
---|---|
void |
connect()
Establishes a connection to the configured cloud platform.
|
void |
disconnect()
Performs a clean disconnection from the cloud platform.
|
boolean |
isConnected()
Tests if the connection is alive.
|
void |
registerCloudConnectionListener(CloudConnectionListener cloudConnectionListener)
The implementation will register the
CloudConnectionListener instance passed as argument. |
void |
unregisterCloudConnectionListener(CloudConnectionListener cloudConnectionListener)
Unregisters the provided
CloudConnectionListener instance from cloud connection related events
notifications. |
void connect() throws KuraConnectException
KuraException
- if the operation failsKuraConnectException
void disconnect() throws KuraDisconnectException
KuraException
- if the operation failsKuraDisconnectException
boolean isConnected()
true
if the framework is connected to the remote server. false
otherwise.void registerCloudConnectionListener(CloudConnectionListener cloudConnectionListener)
CloudConnectionListener
instance passed as argument. Once a cloud
connection related event happens, all the registered CloudConnectionListener
s will be notified.cloudConnectionListener
- a CloudConnectionListener
instancevoid unregisterCloudConnectionListener(CloudConnectionListener cloudConnectionListener)
CloudConnectionListener
instance from cloud connection related events
notifications.cloudConnectionListener
-