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 TypeMethodDescriptionvoidonBinaryData(int id, String descr, byte[] data) Called when a transaction received binary data.default voidonCommClosed(TransactionComm comm, int code, String reason) Called when the communication link is closed.default voidonCommClosing(TransactionComm comm) Called when the communication link is closing.default voidCalled when the communication link is connected.voidonCommConnected(TransactionComm comm, ClientProps root) Called to process a transaction.default voidonCommData(TransactionComm comm, ReadTransaction trans, int size) Called when the communication link has received data.default voidonCommError(TransactionComm comm, Throwable e) Called when the communication link is closed.default voidonCommHeartBeat(TransactionComm comm, long duration) Called when the communication link has received data.default voidonCommTimeout(TransactionComm comm, boolean isReadTimeout) Called when the communication link has timed out on a read or write operation.default booleanprocessTransaction(int code, ReadTransaction mainTrans) Called to process special transaction codes that are not processed by default.booleanshouldLog(int level) Called to check if the listener wishes to have an event logged.voidupdateStates(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:
onCommClosedin interfaceTransactionCommListener- Parameters:
comm- The transaction communication instance.
onCommConnected
Called when the communication link is connected.- Specified by:
onCommConnectedin interfaceTransactionCommListener- Parameters:
comm- The transaction communication instance.
onCommData
Called when the communication link has received data.- Specified by:
onCommDatain 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:
onCommHeartBeatin 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:
onCommTimeoutin 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:
onCommErrorin interfaceTransactionCommListener- Parameters:
comm- The transaction communication instance.e- The exception.
onCommClosing
Called when the communication link is closing.- Specified by:
onCommClosingin interfaceTransactionCommListener- Parameters:
comm- The transaction communication instance.