public interface DataTransportService
http://www.osgi.org/wiki/uploads/Links/whiteboard.pdf
is used to notify the service users about events such as message arrived, connection lost etc.
DataTransportListener
Modifier and Type | Method and Description |
---|---|
void |
connect()
Connects to the remote broker.
|
void |
disconnect(long quiesceTimeout)
Disconnects from the broker.
|
String |
getAccountName()
Returns the account name associated with the DataTransportService
|
String |
getBrokerUrl() |
String |
getClientId() |
String |
getUsername() |
boolean |
isConnected()
Returns true if the DataTransportService is currently connected to the remote server.
|
DataTransportToken |
publish(String topic,
byte[] payload,
int qos,
boolean retain)
Enqueues a message for publishing with the underlying transport implementation.
|
void |
subscribe(String topic,
int qos)
Subscribes to a topic on the broker.
|
void |
unsubscribe(String topic)
Unsubscribes to a topic on the broker.
|
void connect() throws KuraConnectException
KuraConnectException
- the caller MAY retry connecting a later time.boolean isConnected()
String getBrokerUrl()
String getAccountName()
String getUsername()
String getClientId()
void disconnect(long quiesceTimeout)
quiesceTimeout
- - timeout that will be used before forcing a disconnectvoid subscribe(String topic, int qos) throws KuraTimeoutException, KuraException, KuraNotConnectedException
topic
- qos
- KuraTimeoutException
- TODOKuraException
KuraNotConnectedException
- TODOvoid unsubscribe(String topic) throws KuraTimeoutException, KuraException, KuraNotConnectedException
topic
- KuraTimeoutException
KuraException
KuraNotConnectedException
- TODODataTransportToken publish(String topic, byte[] payload, int qos, boolean retain) throws KuraTooManyInflightMessagesException, KuraException, KuraNotConnectedException
topic
- payload
- qos
- retain
- KuraTooManyInflightMessagesException
KuraException
KuraNotConnectedException
- TODOCopyright © 2015. All Rights Reserved.