org.apache.ignite.internal.client.router.impl

## Class GridTcpRouterImpl

- java.lang.Object
- - org.apache.ignite.internal.client.router.impl.GridTcpRouterImpl

All Implemented Interfaces:
  GridTcpRouter, GridTcpRouterMBean, LifecycleAware

    public class GridTcpRouterImpl
    extends Object
    implements GridTcpRouter, GridTcpRouterMBean, LifecycleAware

Wrapper class for router process.

### Constructor Summary

Constructors
Constructor and Description
`GridTcpRouterImpl(GridTcpRouterConfiguration cfg)` Creates new router instance.

### Method Summary

All Methods Instance Methods Concrete Methods
`GridTcpRouterConfiguration` `configuration()` Returns configuration used to start router.
`boolean` `equals(Object o)`
`String` `getHost()` Gets host for TCP binary protocol server.
`int` `getPort()` Gets port for TCP binary protocol server.
`long` `getReceivedCount()` Returns number of messages received by this router.
`long` `getSendCount()` Returns number of responses returned by this router.
`Collection<String>` `getServers()` Gets list of server addresses where router's embedded client should connect.
`int` `hashCode()`
`UUID` `id()` Returns router Id.
`boolean` `isSslClientAuth()` Gets a flag indicating whether or not remote clients will be required to have a valid SSL certificate which validity will be verified with trust manager.
`boolean` `isSslEnabled()` Gets a flag indicating whether or not remote clients will be required to have a valid SSL certificate which validity will be verified with trust manager.
`void` `start()` Starts router.
`void` `stop()` Stops this router.

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

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

### Constructor Detail

#### GridTcpRouterImpl

    public GridTcpRouterImpl(GridTcpRouterConfiguration cfg)

Creates new router instance.

Parameters:
  `cfg` - Router configuration.

### Method Detail

#### start

    public void start()
               throws IgniteException

Starts router.

Specified by:
  `start` in interface `LifecycleAware`
Throws:
  `IgniteException` - If failed.

#### stop

    public void stop()

Stops this router.

Specified by:
  `stop` in interface `LifecycleAware`

#### getHost

    public String getHost()

Gets host for TCP binary protocol server.

Specified by:
  `getHost` in interface `GridTcpRouterMBean`
Returns:
  TCP host.

#### getPort

    public int getPort()

Gets port for TCP binary protocol server.

Specified by:
  `getPort` in interface `GridTcpRouterMBean`
Returns:
  TCP port.

#### isSslEnabled

    public boolean isSslEnabled()

Gets a flag indicating whether or not remote clients will be required to have a valid SSL certificate which validity will be verified with trust manager.

Specified by:
  `isSslEnabled` in interface `GridTcpRouterMBean`
Returns:
  Whether or not client authentication is required.

#### isSslClientAuth

    public boolean isSslClientAuth()

Gets a flag indicating whether or not remote clients will be required to have a valid SSL certificate which validity will be verified with trust manager.

Specified by:
  `isSslClientAuth` in interface `GridTcpRouterMBean`
Returns:
  Whether or not client authentication is required.

#### getServers

    public Collection<String> getServers()

Gets list of server addresses where router's embedded client should connect.

Specified by:
  `getServers` in interface `GridTcpRouterMBean`
Returns:
  List of server addresses.

#### id

    public UUID id()

Returns router Id.

Unique router Ids are automatically generated on router startup. They are used to control router's lifecycle via `GridRouterFactory`.

Specified by:
  `id` in interface `GridTcpRouter`
Returns:
  Router Id.
See Also:
  `GridRouterFactory.tcpRouter(UUID)`, `GridRouterFactory.stopTcpRouter(UUID)`

#### configuration

    public GridTcpRouterConfiguration configuration()

Returns configuration used to start router.

Specified by:
  `configuration` in interface `GridTcpRouter`
Returns:
  Router configuration.
See Also:
  `GridRouterFactory.startTcpRouter(GridTcpRouterConfiguration)`

#### getReceivedCount

    public long getReceivedCount()

Returns number of messages received by this router. Note that this parameter has approximate value.

Specified by:
  `getReceivedCount` in interface `GridTcpRouterMBean`
Returns:
  Number of messages received by this router.

#### getSendCount

    public long getSendCount()

Returns number of responses returned by this router. Note that this parameter has approximate value.

Specified by:
  `getSendCount` in interface `GridTcpRouterMBean`
Returns:
  Number of responses returned by this router.

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021