Package com.iizix.comm.client
Interface IClientInstanceListener
- All Superinterfaces:
- TransactionCommListener
Interface used to listen to changes in client connection states.
- Author:
- Christopher Mindus
- Method SummaryModifier and TypeMethodDescription- void- 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 voidCalled 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- shouldLogboolean 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).
 
- onCommConnectedCalled to process a transaction.- Parameters:
- comm- The communication interface.
- root- The root communication property.
 
- updateStatesRequest of update connection and communication states.- Parameters:
- comm- The communication interface.
 
- onBinaryDataCalled 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.
 
- processTransactionCalled 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.
 
- onCommClosedCalled when the communication link is closed.- Specified by:
- onCommClosedin interface- TransactionCommListener
- Parameters:
- comm- The transaction communication instance.
 
- onCommConnectedCalled when the communication link is connected.- Specified by:
- onCommConnectedin interface- TransactionCommListener
- Parameters:
- comm- The transaction communication instance.
 
- onCommDataCalled when the communication link has received data.- Specified by:
- onCommDatain interface- TransactionCommListener
- Parameters:
- comm- The transaction communication instance.
- trans- The transaction received.
- size- The size of the data received, as it may have been uncompressed.
 
- onCommHeartBeatCalled when the communication link has received data.- Specified by:
- onCommHeartBeatin interface- TransactionCommListener
- Parameters:
- comm- The transaction communication instance.
- duration- The duration of the heart-beat in milliseconds.
 
- onCommTimeoutCalled when the communication link has timed out on a read or write operation.- Specified by:
- onCommTimeoutin interface- TransactionCommListener
- Parameters:
- comm- The transaction communication instance.
- isReadTimeout- Flag indicating read timeout when true, false indicates write timeout.
 
- onCommErrorCalled when the communication link is closed.- Specified by:
- onCommErrorin interface- TransactionCommListener
- Parameters:
- comm- The transaction communication instance.
- e- The exception.
 
- onCommClosingCalled when the communication link is closing.- Specified by:
- onCommClosingin interface- TransactionCommListener
- Parameters:
- comm- The transaction communication instance.