|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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 DataTransportListener
newSession
- true if the connection is to the same broker with the same client ID.public void onDisconnecting()
DataTransportListener
onDisconnecting
in interface DataTransportListener
public void onDisconnected()
DataTransportListener
onDisconnected
in interface DataTransportListener
public void onConfigurationUpdating()
DataTransportListener
DataTransportService
has received a configuration update.
onConfigurationUpdating
in interface DataTransportListener
public void onConfigurationUpdated()
DataTransportListener
DataTransportService
has received a configuration update and it has applied the new configuration
onConfigurationUpdated
in interface DataTransportListener
public void onConnectionLost(Throwable cause)
DataTransportListener
onConnectionLost
in interface DataTransportListener
public void onMessageArrived(String topic, byte[] payload, int qos, boolean retained)
DataTransportListener
onMessageArrived
in interface DataTransportListener
public void onMessageConfirmed(DataTransportToken token)
DataTransportListener
onMessageConfirmed
in interface DataTransportListener
public void connect() throws EsfConnectException
DataService
connect
in interface DataService
EsfConnectException
public boolean isConnected()
DataService
isConnected
in interface DataService
public void disconnect(long quiesceTimeout)
DataService
disconnect
in interface DataService
public void subscribe(String topic, int qos) throws EsfTimeoutException, EsfException, EsfNotConnectedException
DataService
DataTransportService.subscribe(java.lang.String, int)
method.
subscribe
in interface DataService
EsfTimeoutException
EsfException
EsfNotConnectedException
- TODOpublic void unsubscribe(String topic) throws EsfTimeoutException, EsfException, EsfNotConnectedException
DataService
DataTransportService.unsubscribe(java.lang.String)
method.
unsubscribe
in interface DataService
EsfTimeoutException
EsfException
EsfNotConnectedException
- TODOpublic int publish(String topic, byte[] payload, int qos, boolean retain, int priority) throws EsfStoreException
DataService
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:
publish
in interface DataService
EsfStoreException
public List<Integer> getUnpublishedMessageIds(String topicRegex) throws EsfStoreException
DataService
getUnpublishedMessageIds
in interface DataService
EsfStoreException
public List<Integer> getInFlightMessageIds(String topicRegex) throws EsfStoreException
DataService
getInFlightMessageIds
in interface DataService
EsfStoreException
public List<Integer> getDroppedInFlightMessageIds(String topicRegex) throws EsfStoreException
DataService
getDroppedInFlightMessageIds
in interface DataService
EsfStoreException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |