@ProviderType
public interface CloudEndpoint
CloudPublisher
and CloudSubscriber
instances.
Applications should not use directly this API but, instead, use the CloudPublisher
and the
CloudSubscriber
interfaces to give applications the capabilities to publish and receive messages.
The implementor must register itself as a CloudEndpoint OSGi service provider.Modifier and Type | Method and Description |
---|---|
default java.util.Map<java.lang.String,java.lang.String> |
getInfo()
Provides information related to the associated connection.
|
java.lang.String |
publish(KuraMessage message)
Publishes the received
KuraMessage to the associated cloud platform and returns, if supported, a String
representing a message ID. |
void |
registerCloudDeliveryListener(CloudDeliveryListener cloudDeliveryListener)
The implementation will register the
CloudDeliveryListener instance passed as argument. |
void |
registerSubscriber(java.util.Map<java.lang.String,java.lang.Object> subscriptionProperties,
CloudSubscriberListener cloudSubscriberListener)
Registers the provided
CloudSubscriberListener using the specified subscriptionProperties that
will allow
to disambiguate the specific subscriptions. |
void |
unregisterCloudDeliveryListener(CloudDeliveryListener cloudDeliveryListener)
Unregisters the provided
CloudDeliveryListener instance from cloud connection related events
notifications. |
void |
unregisterSubscriber(CloudSubscriberListener cloudSubscriberListener)
Unregisters the provided
cloudSubscriberListener . |
java.lang.String publish(KuraMessage message) throws KuraException
KuraMessage
to the associated cloud platform and returns, if supported, a String
representing a message ID.
null
is returned if the cloud endpoint will not confirm the message delivery, either because this is not
supported by the underlying protocol or because the cloud endpoint itself is not implemented or configured to
request the confirmation.message
- the KuraMessage
to be publishednull
if not supportedKuraException
- if the publishing operation fails.void registerSubscriber(java.util.Map<java.lang.String,java.lang.Object> subscriptionProperties, CloudSubscriberListener cloudSubscriberListener)
CloudSubscriberListener
using the specified subscriptionProperties
that
will allow
to disambiguate the specific subscriptions.subscriptionProperties
- a map representing the subscription contextcloudSubscriberListener
- a CloudSubscriberListener
object that will be notified when a message is received in a context
that matches the one identified by the subscription properties.void unregisterSubscriber(CloudSubscriberListener cloudSubscriberListener)
cloudSubscriberListener
.cloudSubscriberListener
- the CloudSubscriberListener
to be unregistered.default java.util.Map<java.lang.String,java.lang.String> getInfo()
void registerCloudDeliveryListener(CloudDeliveryListener cloudDeliveryListener)
CloudDeliveryListener
instance passed as argument. Once a cloud
connection related event happens, all the registered CloudDeliveryListener
s will be notified.cloudDeliveryListener
- a CloudDeliveryListener
instancevoid unregisterCloudDeliveryListener(CloudDeliveryListener cloudDeliveryListener)
CloudDeliveryListener
instance from cloud connection related events
notifications.cloudConnectionListener
-