|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.eurotech.framework.core.data.DataServiceImpl
public class DataServiceImpl
| Constructor Summary | |
|---|---|
DataServiceImpl()
|
|
| Method Summary | |
|---|---|
protected void |
activate(org.osgi.service.component.ComponentContext componentContext,
Map<String,Object> properties)
|
void |
connect()
Connects to the broker if not already connected. |
protected void |
deactivate(org.osgi.service.component.ComponentContext componentContext)
|
void |
disconnect(long quiesceTimeout)
Disconnects from the broker. |
List<Integer> |
getDroppedInFlightMessageIds(String topicRegex)
Finds the list of identifiers of in-flight messages that have been dropped. |
List<Integer> |
getInFlightMessageIds(String topicRegex)
Finds the list of identifiers of messages that are still in-flight (messages published but not confirmed yet). |
List<Integer> |
getUnpublishedMessageIds(String topicRegex)
Finds the list of identifiers of messages that have not been published yet. |
boolean |
isConnected()
Answers if the DataService is connected to the broker. |
void |
onConfigurationUpdated()
Notifies the DataTransportService has received a configuration update and it has applied the new configuration |
void |
onConfigurationUpdating()
Notifies the DataTransportService has received a configuration update. |
void |
onConnectionEstablished(boolean newSession)
Notifies the listener of the establishment of the new connection with the remote server. |
void |
onConnectionLost(Throwable cause)
Notifies the listener that the connection to the remote server has been lost. |
void |
onDisconnected()
Notifies the listener that the connection to the remote server has been terminated. |
void |
onDisconnecting()
Notifies the listener that the connection to the remote server is about to be terminated. |
void |
onMessageArrived(String topic,
byte[] payload,
int qos,
boolean retained)
Notifies the listener that a new message has been received from the remote server. |
void |
onMessageConfirmed(DataTransportToken token)
Notifies the listener that a message has been confirmed by the remote server. |
int |
publish(String topic,
byte[] payload,
int qos,
boolean retain,
int priority)
Publishes a message to the broker. |
void |
setDataTransportService(DataTransportService dataTransportService)
|
void |
setDbService(DbService dbService)
|
void |
subscribe(String topic,
int qos)
Subscribes to the specified topic with the remote server. |
void |
unsetDataTransportService(DataTransportService dataTransportService)
|
void |
unsetDbService(DbService dbService)
|
void |
unsubscribe(String topic)
Unubscribes to the specified topic with the remote server. |
void |
updated(Map<String,Object> properties)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataServiceImpl()
| Method Detail |
|---|
protected void activate(org.osgi.service.component.ComponentContext componentContext,
Map<String,Object> properties)
public void updated(Map<String,Object> properties)
protected void deactivate(org.osgi.service.component.ComponentContext componentContext)
public void setDataTransportService(DataTransportService dataTransportService)
public void unsetDataTransportService(DataTransportService dataTransportService)
public void setDbService(DbService dbService)
public void unsetDbService(DbService dbService)
public void onConnectionEstablished(boolean newSession)
DataTransportListener
onConnectionEstablished in interface DataTransportListenernewSession - true if the connection is to the same broker with the same client ID.public void onDisconnecting()
DataTransportListener
onDisconnecting in interface DataTransportListenerpublic void onDisconnected()
DataTransportListener
onDisconnected in interface DataTransportListenerpublic void onConfigurationUpdating()
DataTransportListenerDataTransportService has received a configuration update.
onConfigurationUpdating in interface DataTransportListenerpublic void onConfigurationUpdated()
DataTransportListenerDataTransportService has received a configuration update and it has applied the new configuration
onConfigurationUpdated in interface DataTransportListenerpublic void onConnectionLost(Throwable cause)
DataTransportListener
onConnectionLost in interface DataTransportListener
public void onMessageArrived(String topic,
byte[] payload,
int qos,
boolean retained)
DataTransportListener
onMessageArrived in interface DataTransportListenerpublic void onMessageConfirmed(DataTransportToken token)
DataTransportListener
onMessageConfirmed in interface DataTransportListener
public void connect()
throws EsfConnectException
DataService
connect in interface DataServiceEsfConnectExceptionpublic boolean isConnected()
DataService
isConnected in interface DataServicepublic void disconnect(long quiesceTimeout)
DataService
disconnect in interface DataService
public void subscribe(String topic,
int qos)
throws EsfTimeoutException,
EsfException,
EsfNotConnectedException
DataServiceDataTransportService.subscribe(java.lang.String, int) method.
subscribe in interface DataServiceEsfTimeoutException
EsfException
EsfNotConnectedException - TODO
public void unsubscribe(String topic)
throws EsfTimeoutException,
EsfException,
EsfNotConnectedException
DataServiceDataTransportService.unsubscribe(java.lang.String) method.
unsubscribe in interface DataServiceEsfTimeoutException
EsfException
EsfNotConnectedException - TODO
public int publish(String topic,
byte[] payload,
int qos,
boolean retain,
int priority)
throws EsfStoreException
DataServiceDataServiceListener.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:
publish in interface DataServiceEsfStoreException
public List<Integer> getUnpublishedMessageIds(String topicRegex)
throws EsfStoreException
DataService
getUnpublishedMessageIds in interface DataServiceEsfStoreException
public List<Integer> getInFlightMessageIds(String topicRegex)
throws EsfStoreException
DataService
getInFlightMessageIds in interface DataServiceEsfStoreException
public List<Integer> getDroppedInFlightMessageIds(String topicRegex)
throws EsfStoreException
DataService
getDroppedInFlightMessageIds in interface DataServiceEsfStoreException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||