@ProviderType
public interface DataService
DataTransportService
the implementation
of the transport protocol used to interact with the remote server.
DataServiceListener
.
DataServiceListener
Modifier and Type | Method and Description |
---|---|
void |
addDataServiceListener(DataServiceListener listener)
Adds a listener.
|
void |
connect()
Connects to the broker if not already connected.
|
void |
disconnect(long quiesceTimeout)
Disconnects from the broker.
|
java.util.List<java.lang.Integer> |
getDroppedInFlightMessageIds(java.lang.String topicRegex)
Finds the list of identifiers of in-flight messages that have been dropped.
|
java.util.List<java.lang.Integer> |
getInFlightMessageIds(java.lang.String topicRegex)
Finds the list of identifiers of messages that are still in-flight
(messages published but not confirmed yet).
|
int |
getRetryInterval() |
java.util.List<java.lang.Integer> |
getUnpublishedMessageIds(java.lang.String topicRegex)
Finds the list of identifiers of messages that have not been published yet.
|
boolean |
isAutoConnectEnabled() |
boolean |
isConnected()
Answers if the DataService is connected to the broker.
|
int |
publish(java.lang.String topic,
byte[] payload,
int qos,
boolean retain,
int priority)
Publishes a message to the broker.
|
void |
removeDataServiceListener(DataServiceListener listener)
Removes a listener.
|
void |
subscribe(java.lang.String topic,
int qos)
Subscribes to the specified topic with the remote server.
|
void |
unsubscribe(java.lang.String topic)
Unubscribes to the specified topic with the remote server.
|
void connect() throws KuraConnectException
KuraConnectException
boolean isConnected()
boolean isAutoConnectEnabled()
int getRetryInterval()
void disconnect(long quiesceTimeout)
quiesceTimeout
- void subscribe(java.lang.String topic, int qos) throws KuraTimeoutException, KuraException, KuraNotConnectedException
DataTransportService.subscribe(java.lang.String, int)
method.topic
- qos
- KuraTimeoutException
KuraException
KuraNotConnectedException
- TODOvoid unsubscribe(java.lang.String topic) throws KuraTimeoutException, KuraException, KuraNotConnectedException
DataTransportService.unsubscribe(java.lang.String)
method.topic
- KuraTimeoutException
KuraException
KuraNotConnectedException
- TODOint publish(java.lang.String topic, byte[] payload, int qos, boolean retain, int priority) throws KuraStoreException
DataServiceListener.onMessageConfirmed(int, java.lang.String)
callback.
A unique identifier is always returned, independently on the specified
QoS or priority level, which can be used to match the asynchronous
message confirm.
The actual semantics associated to a message confirm is as follows:
topic
- payload
- qos
- retain
- priority
- KuraStoreException
java.util.List<java.lang.Integer> getUnpublishedMessageIds(java.lang.String topicRegex) throws KuraStoreException
topicRegex
- KuraStoreException
java.util.List<java.lang.Integer> getInFlightMessageIds(java.lang.String topicRegex) throws KuraStoreException
topicRegex
- KuraStoreException
java.util.List<java.lang.Integer> getDroppedInFlightMessageIds(java.lang.String topicRegex) throws KuraStoreException
KuraStoreException
void addDataServiceListener(DataServiceListener listener)
listener
- void removeDataServiceListener(DataServiceListener listener)
listener
-