org.apache.ignite.internal.util.nio

## Class GridSelectorNioSessionImpl

- java.lang.Object
- - org.apache.ignite.internal.util.nio.GridNioSessionImpl
  - - org.apache.ignite.internal.util.nio.GridSelectorNioSessionImpl

All Implemented Interfaces:
  GridNioSession

    public class GridSelectorNioSessionImpl
    extends GridNioSessionImpl

Session implementation bound to selector API and socket API. Note that this implementation requires non-null values for local and remote socket addresses.

### Method Summary

All Methods Instance Methods Concrete Methods
`GridNioFuture<Boolean>` `close()` Performs a request for asynchronous session close.
`boolean` `closeSocketOnSessionClose()`
`void` `closeSocketOnSessionClose(boolean closeSocket)`
`boolean` `hasSession()`
`@Nullable GridNioRecoveryDescriptor` `inRecoveryDescriptor()`
`void` `inRecoveryDescriptor(GridNioRecoveryDescriptor recoveryDesc)`
`SelectionKey` `key()`
`@Nullable GridNioRecoveryDescriptor` `outRecoveryDescriptor()`
`void` `outRecoveryDescriptor(GridNioRecoveryDescriptor recoveryDesc)`
`ByteBuffer` `readBuffer()`
`@Nullable GridSelectorNioSessionImpl` `session()`
`void` `systemMessage(Object sysMsg)`
`String` `toString()`
`ByteBuffer` `writeBuffer()`

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

`accepted, addMeta, bytesReceived, bytesReceived, bytesReceived0, bytesSent, bytesSent, bytesSent0, certificates, chain, closed, closeTime, createTime, lastReceiveTime, lastSendScheduleTime, lastSendTime, localAddress, meta, pauseReads, readsPaused, readsPaused, remoteAddress, removeMeta, reset0, resetSendScheduleTime, resumeReads, send, sendNoFuture, setClosed`

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

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

### Method Detail

#### hasSession

    public boolean hasSession()

Returns:
  `True` if session was created.

#### session

    @Nullable
    public @Nullable GridSelectorNioSessionImpl session()

Returns:
  Session if it was created.

#### writeBuffer

    public ByteBuffer writeBuffer()

Returns:
  Write buffer.

#### readBuffer

    public ByteBuffer readBuffer()

Returns:
  Read buffer.

#### key

    public SelectionKey key()

Returns:
  Registered selection key for this session.

#### closeSocketOnSessionClose

    public boolean closeSocketOnSessionClose()

Returns:
  `True` to close SocketChannel on current session close occured.

#### closeSocketOnSessionClose

    public void closeSocketOnSessionClose(boolean closeSocket)

Parameters:
  `closeSocket` - `False` remain SocketChannel open on session close.

#### outRecoveryDescriptor

    public void outRecoveryDescriptor(GridNioRecoveryDescriptor recoveryDesc)

Specified by:
  `outRecoveryDescriptor` in interface `GridNioSession`
Overrides:
  `outRecoveryDescriptor` in class `GridNioSessionImpl`
Parameters:
  `recoveryDesc` - Recovery descriptor.

#### outRecoveryDescriptor

    @Nullable
    public @Nullable GridNioRecoveryDescriptor outRecoveryDescriptor()

Specified by:
  `outRecoveryDescriptor` in interface `GridNioSession`
Overrides:
  `outRecoveryDescriptor` in class `GridNioSessionImpl`
Returns:
  Recovery descriptor if recovery is supported, `null otherwise.`

#### inRecoveryDescriptor

    public void inRecoveryDescriptor(GridNioRecoveryDescriptor recoveryDesc)

Specified by:
  `inRecoveryDescriptor` in interface `GridNioSession`
Overrides:
  `inRecoveryDescriptor` in class `GridNioSessionImpl`
Parameters:
  `recoveryDesc` - Recovery descriptor.

#### inRecoveryDescriptor

    @Nullable
    public @Nullable GridNioRecoveryDescriptor inRecoveryDescriptor()

Specified by:
  `inRecoveryDescriptor` in interface `GridNioSession`
Overrides:
  `inRecoveryDescriptor` in class `GridNioSessionImpl`
Returns:
  Recovery descriptor if recovery is supported, `null otherwise.`

#### systemMessage

    public void systemMessage(Object sysMsg)

Specified by:
  `systemMessage` in interface `GridNioSession`
Overrides:
  `systemMessage` in class `GridNioSessionImpl`
Parameters:
  `sysMsg` - System message to send.

#### close

    public GridNioFuture<Boolean> close()

Performs a request for asynchronous session close.

Specified by:
  `close` in interface `GridNioSession`
Overrides:
  `close` in class `GridNioSessionImpl`
Returns:
  Future representing result.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridNioSessionImpl`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

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