Class ClientListenerNioListener
- java.lang.Object
-
- org.apache.ignite.internal.util.nio.GridNioServerListenerAdapter<ClientMessage>
-
- org.apache.ignite.internal.processors.odbc.ClientListenerNioListener
-
- All Implemented Interfaces:
EventListener,GridNioServerListener<ClientMessage>
public class ClientListenerNioListener extends GridNioServerListenerAdapter<ClientMessage>
Client message listener.
-
-
Field Summary
Fields Modifier and Type Field Description static byte[]CLI_TYPESClient types.static intCONN_CTX_HANDSHAKE_TIMEOUT_TASKConnection handshake timeout task.static intCONN_CTX_META_KEYConnection-related metadata key.static byteJDBC_CLIENTJDBC driver handshake code.static StringMANAGEMENT_CLIENT_ATTRTrueif a management client.static longMANAGEMENT_CONNECTION_SHIFTED_IDConnection shifted ID for management clients.static byteODBC_CLIENTODBC driver handshake code.static byteTHIN_CLIENTThin client handshake code.
-
Constructor Summary
Constructors Constructor Description ClientListenerNioListener(GridKernalContext ctx, GridSpinBusyLock busyLock, ClientConnectorConfiguration cliConnCfg, ClientListenerMetrics metrics)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonConnected(GridNioSession ses)This method is called whenever a new client is connected and session is created.voidonDisconnected(GridNioSession ses, @Nullable Exception e)This method is called whenever client is disconnected due to correct connection close or due toIOExceptionduring network operations.voidonFailure(FailureType failureType, Throwable failure)Called when critical failure occurs in server implementation.voidonMessage(GridNioSession ses, ClientMessage msg)This method is called whenever aGridNioParserreturns non-null value.voidonSessionIdleTimeout(GridNioSession ses)Called when session did not receive any activity within timeout interval.-
Methods inherited from class org.apache.ignite.internal.util.nio.GridNioServerListenerAdapter
onMessageSent, onSessionWriteTimeout
-
-
-
-
Field Detail
-
ODBC_CLIENT
public static final byte ODBC_CLIENT
ODBC driver handshake code.- See Also:
- Constant Field Values
-
JDBC_CLIENT
public static final byte JDBC_CLIENT
JDBC driver handshake code.- See Also:
- Constant Field Values
-
THIN_CLIENT
public static final byte THIN_CLIENT
Thin client handshake code.- See Also:
- Constant Field Values
-
CLI_TYPES
public static final byte[] CLI_TYPES
Client types.
-
CONN_CTX_HANDSHAKE_TIMEOUT_TASK
public static final int CONN_CTX_HANDSHAKE_TIMEOUT_TASK
Connection handshake timeout task.
-
CONN_CTX_META_KEY
public static final int CONN_CTX_META_KEY
Connection-related metadata key.
-
MANAGEMENT_CLIENT_ATTR
public static final String MANAGEMENT_CLIENT_ATTR
Trueif a management client. Internal operations will be available.- See Also:
- Constant Field Values
-
MANAGEMENT_CONNECTION_SHIFTED_ID
public static final long MANAGEMENT_CONNECTION_SHIFTED_ID
Connection shifted ID for management clients.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClientListenerNioListener
public ClientListenerNioListener(GridKernalContext ctx, GridSpinBusyLock busyLock, ClientConnectorConfiguration cliConnCfg, ClientListenerMetrics metrics)
Constructor.- Parameters:
ctx- Context.busyLock- Shutdown busy lock.cliConnCfg- Client connector configuration.metrics- Client listener metrics.
-
-
Method Detail
-
onConnected
public void onConnected(GridNioSession ses)
This method is called whenever a new client is connected and session is created.- Parameters:
ses- Newly created session for remote client.
-
onDisconnected
public void onDisconnected(GridNioSession ses, @Nullable @Nullable Exception e)
This method is called whenever client is disconnected due to correct connection close or due toIOExceptionduring network operations.- Parameters:
ses- Closed session.e- Exception occurred, if any.
-
onMessage
public void onMessage(GridNioSession ses, ClientMessage msg)
This method is called whenever aGridNioParserreturns non-null value.- Parameters:
ses- Session on which message was received.msg- Parsed message.
-
onSessionIdleTimeout
public void onSessionIdleTimeout(GridNioSession ses)
Called when session did not receive any activity within timeout interval.- Specified by:
onSessionIdleTimeoutin interfaceGridNioServerListener<ClientMessage>- Overrides:
onSessionIdleTimeoutin classGridNioServerListenerAdapter<ClientMessage>- Parameters:
ses- Session that is idle.
-
onFailure
public void onFailure(FailureType failureType, Throwable failure)
Called when critical failure occurs in server implementation.- Specified by:
onFailurein interfaceGridNioServerListener<ClientMessage>- Overrides:
onFailurein classGridNioServerListenerAdapter<ClientMessage>
-
-