public abstract class Cloudlet extends Object implements CloudClientListener
doGet(org.eclipse.kura.cloud.CloudletTopic, org.eclipse.kura.message.KuraRequestPayload, org.eclipse.kura.message.KuraResponsePayload) is used to implement a READ request for a resource identified by the supplied CloudletTopic.getResources()
doPut(org.eclipse.kura.cloud.CloudletTopic, org.eclipse.kura.message.KuraRequestPayload, org.eclipse.kura.message.KuraResponsePayload) is used to implement a CREATE or UPDATE request for a resource identified by the supplied CloudletTopic.getResources()
doDel(org.eclipse.kura.cloud.CloudletTopic, org.eclipse.kura.message.KuraRequestPayload, org.eclipse.kura.message.KuraResponsePayload) is used to implement a DELETE request for a resource identified by the supplied CloudletTopic.getResources()
doPost(org.eclipse.kura.cloud.CloudletTopic, org.eclipse.kura.message.KuraRequestPayload, org.eclipse.kura.message.KuraResponsePayload) is used to implement other operations on a resource identified by the supplied CloudletTopic.getResources()
doExec(org.eclipse.kura.cloud.CloudletTopic, org.eclipse.kura.message.KuraRequestPayload, org.eclipse.kura.message.KuraResponsePayload) is used to perform applicatioon operation not necessary tied to a given resource.
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DFLT_PRIORITY |
protected static int |
DFLT_PUB_QOS |
protected static boolean |
DFLT_RETAIN |
| Modifier | Constructor and Description |
|---|---|
protected |
Cloudlet(String appId) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate(org.osgi.service.component.ComponentContext componentContext) |
protected void |
deactivate(org.osgi.service.component.ComponentContext componentContext) |
protected void |
doDel(CloudletTopic reqTopic,
KuraRequestPayload reqPayload,
KuraResponsePayload respPayload) |
protected void |
doExec(CloudletTopic reqTopic,
KuraRequestPayload reqPayload,
KuraResponsePayload respPayload) |
protected void |
doGet(CloudletTopic reqTopic,
KuraRequestPayload reqPayload,
KuraResponsePayload respPayload) |
protected void |
doPost(CloudletTopic reqTopic,
KuraRequestPayload reqPayload,
KuraResponsePayload respPayload) |
protected void |
doPut(CloudletTopic reqTopic,
KuraRequestPayload reqPayload,
KuraResponsePayload respPayload) |
String |
getAppId() |
protected CloudClient |
getCloudApplicationClient() |
protected CloudService |
getCloudService() |
protected org.osgi.service.component.ComponentContext |
getComponentContext() |
void |
onConnectionEstablished()
Called when the CloudClient has successfully connected with the broker.
|
void |
onConnectionLost()
Called when the client has lost its connection with the broker.
|
void |
onControlMessageArrived(String deviceId,
String appTopic,
KuraPayload msg,
int qos,
boolean retain)
Called by the CloudClient when it receives a published control message from the broker.
|
void |
onMessageArrived(String deviceId,
String appTopic,
KuraPayload msg,
int qos,
boolean retain)
Called by the client when it receives a published data message from the broker.
|
void |
onMessageConfirmed(int messageId,
String topic)
Called by the CloudClient when a published message has been fully acknowledged by the broker,
as appropriate for the quality of service.
|
void |
onMessagePublished(int messageId,
String topic)
Called by the CloudClient when a message has been transfered from the publishing queue
to the underlying
DataTransportService for publishing on the wire. |
void |
setCloudService(CloudService cloudService) |
void |
unsetCloudService(CloudService cloudService) |
protected static final int DFLT_PUB_QOS
protected static final boolean DFLT_RETAIN
protected static final int DFLT_PRIORITY
protected Cloudlet(String appId)
public void setCloudService(CloudService cloudService)
public void unsetCloudService(CloudService cloudService)
protected void activate(org.osgi.service.component.ComponentContext componentContext)
protected void deactivate(org.osgi.service.component.ComponentContext componentContext)
public String getAppId()
protected CloudService getCloudService()
protected CloudClient getCloudApplicationClient()
protected org.osgi.service.component.ComponentContext getComponentContext()
protected void doGet(CloudletTopic reqTopic, KuraRequestPayload reqPayload, KuraResponsePayload respPayload) throws KuraException
KuraExceptionprotected void doPut(CloudletTopic reqTopic, KuraRequestPayload reqPayload, KuraResponsePayload respPayload) throws KuraException
KuraExceptionprotected void doPost(CloudletTopic reqTopic, KuraRequestPayload reqPayload, KuraResponsePayload respPayload) throws KuraException
KuraExceptionprotected void doDel(CloudletTopic reqTopic, KuraRequestPayload reqPayload, KuraResponsePayload respPayload) throws KuraException
KuraExceptionprotected void doExec(CloudletTopic reqTopic, KuraRequestPayload reqPayload, KuraResponsePayload respPayload) throws KuraException
KuraExceptionpublic void onControlMessageArrived(String deviceId, String appTopic, KuraPayload msg, int qos, boolean retain)
CloudClientListeneronControlMessageArrived in interface CloudClientListenerdeviceId - The deviceId this message was addressed to.appTopic - The appTopic the message arrived on.msg - The KuraPayload that arrived.qos - The Quality of Service that the message was received on.retain - Whether the message was retained by the broker.public void onMessageArrived(String deviceId, String appTopic, KuraPayload msg, int qos, boolean retain)
CloudClientListeneronMessageArrived in interface CloudClientListenerdeviceId - The asset ID of the semanticTopic prefix the message arrived on.appTopic - The appTopic the message arrived on.msg - The KuraPayload that arrived.qos - The Quality of Service that the message was received on.retain - Whether the message was retained by the broker.public void onConnectionLost()
CloudClientListenerDataService
configuration, the client will attempt to reconnect and call the CloudClientListener.onConnectionEstablished()
method upon a successful reconnect. This is only a notification, the callback handler should
not attempt to handle the reconnect.
CloudClientListener.onConnectionEstablished()
callback method to restore the subscriptions it needs after a connection loss.onConnectionLost in interface CloudClientListenerpublic void onConnectionEstablished()
CloudClientListenerCloudClientListener.onConnectionEstablished()
callback method to restore the subscriptions it needs after a connection loss.onConnectionEstablished in interface CloudClientListenerpublic void onMessageConfirmed(int messageId,
String topic)
CloudClientListeneronMessageConfirmed in interface CloudClientListenermessageId - The message id of the published messagepublic void onMessagePublished(int messageId,
String topic)
CloudClientListenerDataTransportService for publishing on the wire.onMessagePublished in interface CloudClientListenerCopyright © 2015. All Rights Reserved.