org.apache.ignite.internal.processors.odbc

## Class ClientListenerNioListener

- java.lang.Object
- - org.apache.ignite.internal.util.nio.GridNioServerListenerAdapter<byte[]>
  - - org.apache.ignite.internal.processors.odbc.ClientListenerNioListener

All Implemented Interfaces:
  EventListener, GridNioServerListener<byte[]>

    public class ClientListenerNioListener
    extends GridNioServerListenerAdapter<byte[]>

Client message listener.

### Field Summary

Fields
`static int` `CONN_CTX_HANDSHAKE_PASSED` Connection handshake passed.
`static byte` `JDBC_CLIENT` JDBC driver handshake code.
`static int` `MAX_HANDSHAKE_MSG_SIZE` Maximum size of the handshake message.
`static byte` `ODBC_CLIENT` ODBC driver handshake code.
`static byte` `THIN_CLIENT` Thin client handshake code.

### Constructor Summary

Constructors
Constructor and Description
`ClientListenerNioListener(GridKernalContext ctx, GridSpinBusyLock busyLock, ClientConnectorConfiguration cliConnCfg)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `onConnected(GridNioSession ses)` This method is called whenever a new client is connected and session is created.
`void` `onDisconnected(GridNioSession ses, Exception e)` This method is called whenever client is disconnected due to correct connection close or due to `IOException` during network operations.
`void` `onMessage(GridNioSession ses, byte[] msg)` This method is called whenever a `GridNioParser` returns non-null value.
`void` `onSessionIdleTimeout(GridNioSession ses)` Called when session did not receive any activity within timeout interval.

### Methods inherited from class org.apache.ignite.internal.util.nio.GridNioServerListenerAdapter

`onFailure, onMessageSent, onSessionWriteTimeout`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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

#### CONN_CTX_HANDSHAKE_PASSED

    public static final int CONN_CTX_HANDSHAKE_PASSED

Connection handshake passed.

#### MAX_HANDSHAKE_MSG_SIZE

    public static final int MAX_HANDSHAKE_MSG_SIZE

Maximum size of the handshake message.

See Also:
  Constant Field Values

### Constructor Detail

#### ClientListenerNioListener

    public ClientListenerNioListener(GridKernalContext ctx,
                                     GridSpinBusyLock busyLock,
                                     ClientConnectorConfiguration cliConnCfg)

Constructor.

Parameters:
  `ctx` - Context.
  `busyLock` - Shutdown busy lock.
  `cliConnCfg` - Client connector configuration.

### 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
                               Exception e)

This method is called whenever client is disconnected due to correct connection close or due to `IOException` during network operations.

Parameters:
  `ses` - Closed session.
  `e` - Exception occurred, if any.

#### onMessage

    public void onMessage(GridNioSession ses,
                          byte[] msg)

This method is called whenever a `GridNioParser` returns 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:
  `onSessionIdleTimeout` in interface `GridNioServerListener<byte[]>`
Overrides:
  `onSessionIdleTimeout` in class `GridNioServerListenerAdapter<byte[]>`
Parameters:
  `ses` - Session that is idle.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.0
Release Date | : November 30 2018