public interface ConnectionListener
Modifier and Type | Method and Description |
---|---|
void |
onBufferFull()
Notification that the local buffer is full and no more data will
be read until the buffer is empty.
|
void |
onClientError(java.lang.String error)
Notification of a Client error.
|
void |
onConnectionEnd(int cause)
Notification of the closure of the Connection because of a Server
decision.
|
void |
onServerError(int code,
java.lang.String msg)
Notification that the Server has refused a connection request because of the
constraints imposed by the Metadata Adapter or by Server configuration.
|
void |
onStatusChange(java.lang.String newStatus)
Notification of each time the client status has changed.
|
void onStatusChange(java.lang.String newStatus)
newStatus
- The current client status. It can be one of the following values:LSClient.getStatus()
void onBufferFull()
void onServerError(int code, java.lang.String msg)
LSClient.OFF
and no automatic reconnection attempt will
be performed.
LSClient.OFF
is needed
before trying a reconnection.
In case the connection status is changed in the handler, no further
switch to LSClient.OFF
status will be performed.code
- The detailed error code, as received from the Server.
Its meaning depends on Lightstreamer Server or the Metadata Adapter.msg
- An error detail message, sent by Lightstreamer Server
or by the Metadata Adapter.SimpleTableListener.onControlError(int, java.lang.String)
,
ExtendedTableListener.onControlError(int, java.lang.String)
,
HandyTableListener.onControlError(int, java.lang.String)
void onConnectionEnd(int cause)
LSClient.OFF
and no automatic reconnection attempt will
be performed.
LSClient.OFF
is needed
before trying a reconnection.
In case the connection status is changed in the handler, no further
switch to LSClient.OFF
status will be performed.cause
- An integer code that describes the cause of the connection
ending or 0 if no cause information is supplied. See the "END" message
in the text protocol documentation for details on the possible causes.void onClientError(java.lang.String error)
ConnectionListener
, SimpleTableListener
,
ExtendedTableListener
, HandyTableListener
)
(note that this method is the only one not wrapped, so an exception
thrown by this method could block the entire client).ConnectionPolicy.setRetryTimeout(int)
.
In any other cases of unsuccessful requests to the Server,
no further attempts will be performed.
error
- A string representing the error occurred.LSClient.setBandwidthUnlimited()
,
LSClient.setMaxBandwidth(int)
,
LSClient.sendMessage(MessageInfo,SendMessageListener)