org.apache.ignite.internal.util.nio

## Interface GridNioServerListener<T>

All Superinterfaces:
  EventListener

All Known Implementing Classes:
  ClientListenerNioListener, GridNioServerListenerAdapter, GridRedisNioListener, GridTcpMemcachedNioListener, GridTcpRestNioListener, GridTcpRouterNioListenerAdapter, InboundConnectionHandler

    public interface GridNioServerListener<T>
    extends EventListener

Listener passed in to the `GridNioServer` that will be notified on client events.

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `onConnected(GridNioSession ses)` This method is called whenever a new client is connected and session is created.
`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.
`void` `onFailure(FailureType failureType, Throwable failure)` Called when critical failure occurs in server implementation.
`void` `onMessage(GridNioSession ses, T msg)` This method is called whenever a `GridNioParser` returns non-null value.
`void` `onMessageSent(GridNioSession ses, T msg)` Handle message sent.
`void` `onSessionIdleTimeout(GridNioSession ses)` Called when session did not receive any activity within timeout interval.
`void` `onSessionWriteTimeout(GridNioSession ses)` Called when session has non-empty write queue and server did not send any data within timeout interval.

### Method Detail

#### onConnected

    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

    void onDisconnected(GridNioSession ses,
                        @Nullable
                        @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.

#### onMessageSent

    void onMessageSent(GridNioSession ses,
                       T msg)

Handle message sent.

Parameters:
  `ses` - Session.
  `msg` - Message.

#### onMessage

    void onMessage(GridNioSession ses,
                   T msg)

This method is called whenever a `GridNioParser` returns non-null value.

Parameters:
  `ses` - Session on which message was received.
  `msg` - Parsed message.

#### onSessionWriteTimeout

    void onSessionWriteTimeout(GridNioSession ses)

Called when session has non-empty write queue and server did not send any data within timeout interval.

Parameters:
  `ses` - Session that has timed out writes.

#### onSessionIdleTimeout

    void onSessionIdleTimeout(GridNioSession ses)

Called when session did not receive any activity within timeout interval.

Parameters:
  `ses` - Session that is idle.

#### onFailure

    void onFailure(FailureType failureType,
                   Throwable failure)

Called when critical failure occurs in server implementation.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022