com.lightstreamer.ls_client
Interface ConnectionListener


public interface ConnectionListener

Receives notifications of connection activity and errors. The notification sequence follows the pattern: [CE [SS (NB | DE | AW(true) AW(false) )* [AW(true)] [F1 | F2] C] ] where F1 and F1 represent the two versions of onFailure(). A distinct listener must be used for any distinct connection opened.


Method Summary
 void onActivityWarning(boolean warningOn)
          Notification that nothing has been received on the connection for more than a configured timeout.
 void onClose()
          Notification of the closure of the Connection.
 void onConnectionEstablished()
          Notification of the opening of the connection to the Server.
 void onDataError(PushServerException e)
          Notification that a block of data received from the Server could not be correctly interpreted.
 void onFailure(PushConnException e)
          Notification of the closure of the Connection because of a connection problem.
 void onFailure(PushServerException e)
          Notification of the closure of the Connection because of an unrecoverable error in data coming from the Server.
 void onNewBytes(long bytes)
          Notification of the reception of some data bytes from the Server, for statistical purposes.
 void onSessionStarted()
          Notification that a session has been started by the Server on the connection.
 

Method Detail

onConnectionEstablished

void onConnectionEstablished()
Notification of the opening of the connection to the Server.


onSessionStarted

void onSessionStarted()
Notification that a session has been started by the Server on the connection.


onNewBytes

void onNewBytes(long bytes)
Notification of the reception of some data bytes from the Server, for statistical purposes.

Parameters:
bytes - Number of data bytes received.

onDataError

void onDataError(PushServerException e)
Notification that a block of data received from the Server could not be correctly interpreted. The implementation may consider this as a severe problem and open a new connection. In normal operation, this should not happen.

Parameters:
e - Exception that describes the problem occurred.

onActivityWarning

void onActivityWarning(boolean warningOn)
Notification that nothing has been received on the connection for more than a configured timeout. If the problem persists, the connection may be closed.

Parameters:
warningOn - if true, issues the warning; otherwise resets a previously issued warning.

onClose

void onClose()
Notification of the closure of the Connection. It may be caused by a closeConnection call or by an unrecoverable error. There is no guarantee that calls to this listener will not be followed by further calls on some listener related to a table subscribed within the connection. Such extra calls should be ignored.


onFailure

void onFailure(PushServerException e)
Notification of the closure of the Connection because of an unrecoverable error in data coming from the Server. In normal operation, this should not happen.

Parameters:
e - Exception that describes the problem occurred.

onFailure

void onFailure(PushConnException e)
Notification of the closure of the Connection because of a connection problem.

Parameters:
e - Exception that describes the problem occurred.