Package com.iizix.comm.client
Interface IClientInstanceListener
- All Superinterfaces:
TransactionCommListener
Interface used to listen to changes in client connection states.
- Author:
- Christopher Mindus
Method Summary
Modifier and TypeMethodDescriptionvoid
onBinaryData
(int id, String descr, byte[] data) Called when a transaction received binary data.default void
onCommClosed
(TransactionComm comm, int code, String reason) Called when the communication link is closed.default void
onCommClosing
(TransactionComm comm) Called when the communication link is closing.default void
Called when the communication link is connected.void
onCommConnected
(TransactionComm comm, ClientProps root) Called to process a transaction.default void
onCommData
(TransactionComm comm, ReadTransaction trans, int size) Called when the communication link has received data.default void
onCommError
(TransactionComm comm, Throwable e) Called when the communication link is closed.default void
onCommHeartBeat
(TransactionComm comm, long duration) Called when the communication link has received data.default void
onCommTimeout
(TransactionComm comm, boolean isReadTimeout) Called when the communication link has timed out on a read or write operation.default boolean
processTransaction
(int code, ReadTransaction mainTrans) Called to process special transaction codes that are not processed by default.boolean
shouldLog
(int level) Called to check if the listener wishes to have an event logged.void
updateStates
(TransactionComm comm) Request of update connection and communication states.
Method Details
shouldLog
boolean shouldLog(int level) Called to check if the listener wishes to have an event logged.- Parameters:
level
- The log level of an event:{@link ILog#SEVERE}
(1) to{@link ILog#FINEST}
(7).
onCommConnected
Called to process a transaction.- Parameters:
comm
- The communication interface.root
- The root communication property.
updateStates
Request of update connection and communication states.- Parameters:
comm
- The communication interface.
onBinaryData
Called when a transaction received binary data.- Parameters:
id
- The ID of the reply local ID for error or success reply.descr
- Short description of the data.data
- The data received.
processTransaction
Called to process special transaction codes that are not processed by default.Default transaction codes are:
{@link GConstants#TRANS_ATOM}
,{@link GConstants#TRANS_UPDATE}
,{@link GConstants#TRANS_REMOTE_EVENT}
,{@link GConstants#TRANS_BINARY_DATA}
.
- Parameters:
code
- The transaction code.mainTrans
- The main transaction.- Returns:
- true if processed, false if not processed.
onCommClosed
Called when the communication link is closed.- Specified by:
onCommClosed
in interfaceTransactionCommListener
- Parameters:
comm
- The transaction communication instance.
onCommConnected
Called when the communication link is connected.- Specified by:
onCommConnected
in interfaceTransactionCommListener
- Parameters:
comm
- The transaction communication instance.
onCommData
Called when the communication link has received data.- Specified by:
onCommData
in interfaceTransactionCommListener
- Parameters:
comm
- The transaction communication instance.trans
- The transaction received.size
- The size of the data received, as it may have been uncompressed.
onCommHeartBeat
Called when the communication link has received data.- Specified by:
onCommHeartBeat
in interfaceTransactionCommListener
- Parameters:
comm
- The transaction communication instance.duration
- The duration of the heart-beat in nanoseconds.
onCommTimeout
Called when the communication link has timed out on a read or write operation.- Specified by:
onCommTimeout
in interfaceTransactionCommListener
- Parameters:
comm
- The transaction communication instance.isReadTimeout
- Flag indicating read timeout when true, false indicates write timeout.
onCommError
Called when the communication link is closed.- Specified by:
onCommError
in interfaceTransactionCommListener
- Parameters:
comm
- The transaction communication instance.e
- The exception.
onCommClosing
Called when the communication link is closing.- Specified by:
onCommClosing
in interfaceTransactionCommListener
- Parameters:
comm
- The transaction communication instance.