org.apache.ignite.spi.communication.tcp.internal

## Class GridNioServerWrapper

- java.lang.Object
- - org.apache.ignite.spi.communication.tcp.internal.GridNioServerWrapper

Deprecated.
Should be removed.

    public class GridNioServerWrapper
    extends Object

Container for nio server with required dependencies.

### Field Summary

Fields
`static int` `MAX_CONN_PER_NODE` Deprecated. Maximum `GridNioSession` connections per node.

### Constructor Summary

Constructors
Constructor and Description

`GridNioServerWrapper(IgniteLogger log, TcpCommunicationConfiguration cfg, AttributeNames attributeNames, Tracing tracing, Function<UUID,ClusterNode> nodeGetter, Supplier<ClusterNode> locNodeSupplier, ConnectGateway connectGate, ClusterStateProvider stateProvider, Supplier<IgniteExceptionRegistry> eRegistrySupplier, CommunicationWorker commWorker, IgniteConfiguration igniteCfg, GridNioServerListener<Message> srvLsnr, String igniteInstanceName, WorkersRegistry workersRegistry, @Nullable GridMetricManager metricMgr, ThrowableBiFunction<ClusterNode,Integer,GridCommunicationClient,IgniteCheckedException> createTcpClientFun, CommunicationListener<Message> lsnr, TcpHandshakeExecutor tcpHandshakeExecutor)`
Deprecated.

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`void` `clear()` Deprecated. Clears resources for gc.
`void` `clientPool(ConnectionClientPool pool)` Deprecated.
`void` `communicationWorker(CommunicationWorker commWorker)` Deprecated.
`GridNioSession` `createNioSession(ClusterNode node, int connIdx)` Deprecated. Returns the established TCP/IP connection between the current node and remote server.
`GridCommunicationClient` `createTcpClient(ClusterNode node, int connIdx, boolean backwardCompatibility)` Deprecated. Establish TCP connection to remote node and returns client.
`ConcurrentMap<ConnectionKey,GridNioRecoveryDescriptor>` `inRecDescs()` Deprecated.
`GridNioRecoveryDescriptor` `inRecoveryDescriptor(ClusterNode node, ConnectionKey key)` Deprecated.
`GridNioServer<Message>` `nio()` Deprecated. Returns original nio server instance.
`void` `nio(GridNioServer<Message> srv)` Deprecated.
`void` `onChannelCreate(GridSelectorNioSessionImpl ses, ConnectionKey connKey, Message msg)` Deprecated.
`IgniteInternalFuture<Channel>` `openChannel(ClusterNode remote, Message initMsg)` Deprecated.
`ConcurrentMap<ConnectionKey,GridNioRecoveryDescriptor>` `outRecDescs()` Deprecated.
`void` `processSessionCreationError(ClusterNode node, Collection<InetSocketAddress> addrs, IgniteCheckedException errs)` Deprecated. Process errors if TCP/IP `GridNioSession` creation to remote node hasn't been performed.
`ConcurrentMap<ConnectionKey,GridNioRecoveryDescriptor>` `recoveryDescs()` Deprecated.
`GridNioServer<Message>` `resetNioServer()` Deprecated. Recreates tpcSrvr socket instance.
`void` `socketChannelFactory(ThrowableSupplier<SocketChannel,IOException> sockChFactory)` Deprecated.
`void` `start()` Deprecated. Starts nio server.
`void` `stop()` Deprecated. Stops nio server.

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

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

### Field Detail

#### MAX_CONN_PER_NODE

    public static final int MAX_CONN_PER_NODE

Deprecated.
Maximum `GridNioSession` connections per node.

See Also:
  Constant Field Values

### Constructor Detail

#### GridNioServerWrapper

    public GridNioServerWrapper(IgniteLogger log,
                                TcpCommunicationConfiguration cfg,
                                AttributeNames attributeNames,
                                Tracing tracing,
                                Function<UUID,ClusterNode> nodeGetter,
                                Supplier<ClusterNode> locNodeSupplier,
                                ConnectGateway connectGate,
                                ClusterStateProvider stateProvider,
                                Supplier<IgniteExceptionRegistry> eRegistrySupplier,
                                CommunicationWorker commWorker,
                                IgniteConfiguration igniteCfg,
                                GridNioServerListener<Message> srvLsnr,
                                String igniteInstanceName,
                                WorkersRegistry workersRegistry,
                                @Nullable
                                @Nullable GridMetricManager metricMgr,
                                ThrowableBiFunction<ClusterNode,Integer,GridCommunicationClient,IgniteCheckedException> createTcpClientFun,
                                CommunicationListener<Message> lsnr,
                                TcpHandshakeExecutor tcpHandshakeExecutor)

Deprecated.

Parameters:
  `log` - Logger.
  `cfg` - Config.
  `attributeNames` - Attribute names.
  `tracing` - Tracing.
  `nodeGetter` - Node getter.
  `locNodeSupplier` - Local node supplier.
  `connectGate` - Connect gate.
  `stateProvider` - State provider.
  `eRegistrySupplier` - Exception registry supplier.
  `commWorker` - Communication worker.
  `igniteCfg` - Ignite config.
  `srvLsnr` - Server listener.
  `igniteInstanceName` - Ignite instance name.
  `workersRegistry` - Workers registry.
  `tcpHandshakeExecutor` - Executor for establishing a connection to a node.
  `lsnr` - Listener

### Method Detail

#### start

    public void start()

Deprecated.
Starts nio server.

#### stop

    public void stop()

Deprecated.
Stops nio server.

#### clear

    public void clear()

Deprecated.
Clears resources for gc.

#### createNioSession

    public GridNioSession createNioSession(ClusterNode node,
                                           int connIdx)
                                    throws IgniteCheckedException

Deprecated.
Returns the established TCP/IP connection between the current node and remote server. A handshake process of negotiation between two communicating nodes will be performed before the `GridNioSession` created.

The handshaking process contains of these steps:

1. The local node opens a new `SocketChannel` in the blocking mode.
2. The local node calls `SocketChannel.connect(SocketAddress)` to remote node.
3. The remote GridNioAcceptWorker thread accepts new connection.
4. The remote node sends back the `NodeIdMessage`.
5. The local node reads NodeIdMessage from created channel.
6. The local node sends the `HandshakeMessage2` to remote.
7. The remote node processes `HandshakeMessage2` in `GridNioServerListener.onMessage(GridNioSession, Object)`.
8. The remote node sends back the `RecoveryLastReceivedMessage`.

The handshaking process ends.

Note. The `HandshakeTimeoutObject` is created to control execution timeout during the whole handshaking process.

Parameters:
  `node` - Remote node identifier to connect with.
  `connIdx` - Connection index based on configured `ConnectionPolicy`.
Returns:
  A `GridNioSession` connection representation.
Throws:
  `IgniteCheckedException` - If establish connection fails.

#### createTcpClient

    public GridCommunicationClient createTcpClient(ClusterNode node,
                                                   int connIdx,
                                                   boolean backwardCompatibility)
                                            throws IgniteCheckedException

Deprecated.
Establish TCP connection to remote node and returns client.

Parameters:
  `node` - Remote node.
  `connIdx` - Connection index.
  `backwardCompatibility` - It calls the method from protected class.
Returns:
  Client.
Throws:
  `IgniteCheckedException` - If failed.

#### nio

    public GridNioServer<Message> nio()

Deprecated.
Returns original nio server instance.

#### nio

    public void nio(GridNioServer<Message> srv)

Deprecated.

Parameters:
  `srv` - Server.

#### inRecoveryDescriptor

    public GridNioRecoveryDescriptor inRecoveryDescriptor(ClusterNode node,
                                                          ConnectionKey key)

Deprecated.

Parameters:
  `node` - Node.
  `key` - Connection key.
Returns:
  Recovery descriptor for incoming connection.

#### recoveryDescs

    public ConcurrentMap<ConnectionKey,GridNioRecoveryDescriptor> recoveryDescs()

Deprecated.

Returns:
  Recovery descs.

#### outRecDescs

    public ConcurrentMap<ConnectionKey,GridNioRecoveryDescriptor> outRecDescs()

Deprecated.

Returns:
  Out rec descs.

#### inRecDescs

    public ConcurrentMap<ConnectionKey,GridNioRecoveryDescriptor> inRecDescs()

Deprecated.

Returns:
  In rec descs.

#### processSessionCreationError

    public void processSessionCreationError(ClusterNode node,
                                            Collection<InetSocketAddress> addrs,
                                            IgniteCheckedException errs)
                                     throws IgniteCheckedException

Deprecated.
Process errors if TCP/IP `GridNioSession` creation to remote node hasn't been performed.

Parameters:
  `node` - Remote node.
  `addrs` - Remote node addresses.
  `errs` - TCP client creation errors.
Throws:
  `IgniteCheckedException` - If failed.

#### resetNioServer

    public GridNioServer<Message> resetNioServer()
                                          throws IgniteCheckedException

Deprecated.
Recreates tpcSrvr socket instance.

Returns:
  Server instance.
Throws:
  `IgniteCheckedException` - Thrown if it's not possible to create server.

#### onChannelCreate

    public void onChannelCreate(GridSelectorNioSessionImpl ses,
                                ConnectionKey connKey,
                                Message msg)

Deprecated.

#### openChannel

    public IgniteInternalFuture<Channel> openChannel(ClusterNode remote,
                                                     Message initMsg)
                                              throws IgniteSpiException

Deprecated.

Parameters:
  `remote` - Destination cluster node to communicate with.
  `initMsg` - Configuration channel attributes wrapped into the message.
Returns:
  The future, which will be finished on channel ready.
Throws:
  `IgniteSpiException` - If fails.

#### communicationWorker

    public void communicationWorker(CommunicationWorker commWorker)

Deprecated.

Parameters:
  `commWorker` - New recovery and idle clients handler.

#### clientPool

    public void clientPool(ConnectionClientPool pool)

Deprecated.

Parameters:
  `pool` - Client pool.

#### socketChannelFactory

    public void socketChannelFactory(ThrowableSupplier<SocketChannel,IOException> sockChFactory)

Deprecated.

Parameters:
  `sockChFactory` - New socket channel factory.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.14.0
Release Date | : September 29 2022