com.eurotech.framework.data
Interface DataTransportListener


public interface DataTransportListener

Listener interface to be implemented by applications that needs to be notified of events in the DataTransportService. All registered listeners are called synchronously by the DataTransportService at the occurrence of the event. It expected that implementers of this interface do NOT perform long running tasks in the implementation of this interface.


Method Summary
 void onConfigurationUpdated(boolean wasConnected)
          Notifies the DataTransportService has received a configuration update and it has applied the new configuration
 void onConfigurationUpdating(boolean wasConnected)
          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.
 

Method Detail

onConnectionEstablished

void onConnectionEstablished(boolean newSession)
Notifies the listener of the establishment of the new connection with the remote server.

Parameters:
newSession - true if the connection is to the same broker with the same client ID.

onDisconnecting

void onDisconnecting()
Notifies the listener that the connection to the remote server is about to be terminated.


onDisconnected

void onDisconnected()
Notifies the listener that the connection to the remote server has been terminated.


onConfigurationUpdating

void onConfigurationUpdating(boolean wasConnected)
Notifies the DataTransportService has received a configuration update.


onConfigurationUpdated

void onConfigurationUpdated(boolean wasConnected)
Notifies the DataTransportService has received a configuration update and it has applied the new configuration


onConnectionLost

void onConnectionLost(Throwable cause)
Notifies the listener that the connection to the remote server has been lost.


onMessageArrived

void onMessageArrived(String topic,
                      byte[] payload,
                      int qos,
                      boolean retained)
Notifies the listener that a new message has been received from the remote server.


onMessageConfirmed

void onMessageConfirmed(DataTransportToken token)
Notifies the listener that a message has been confirmed by the remote server.



Copyright © 2013. All Rights Reserved.