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 Description GridTcpRouterImpl(GridTcpRouterConfiguration cfg)Creates new router instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GridTcpRouterConfigurationconfiguration()Returns configuration used to start router.booleanequals(Object o)StringgetHost()Gets host for TCP binary protocol server.intgetPort()Gets port for TCP binary protocol server.longgetReceivedCount()Returns number of messages received by this router.longgetSendCount()Returns number of responses returned by this router.Collection<String>getServers()Gets list of server addresses where router's embedded client should connect.inthashCode()UUIDid()Returns router Id.booleanisSslClientAuth()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.booleanisSslEnabled()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.voidstart()Starts router.voidstop()Stops this router.
-
-
-
Constructor Detail
-
GridTcpRouterImpl
public GridTcpRouterImpl(GridTcpRouterConfiguration cfg)
Creates new router instance.- Parameters:
cfg- Router configuration.
-
-
Method Detail
-
start
public void start() throws IgniteExceptionStarts router.- Specified by:
startin interfaceLifecycleAware- Throws:
IgniteException- If failed.
-
stop
public void stop()
Stops this router.- Specified by:
stopin interfaceLifecycleAware
-
getHost
public String getHost()
Gets host for TCP binary protocol server.- Specified by:
getHostin interfaceGridTcpRouterMBean- Returns:
- TCP host.
-
getPort
public int getPort()
Gets port for TCP binary protocol server.- Specified by:
getPortin interfaceGridTcpRouterMBean- 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:
isSslEnabledin interfaceGridTcpRouterMBean- 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:
isSslClientAuthin interfaceGridTcpRouterMBean- 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:
getServersin interfaceGridTcpRouterMBean- 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:
idin interfaceGridTcpRouter- Returns:
- Router Id.
- See Also:
GridRouterFactory.tcpRouter(UUID),GridRouterFactory.stopTcpRouter(UUID)
-
configuration
public GridTcpRouterConfiguration configuration()
Returns configuration used to start router.- Specified by:
configurationin interfaceGridTcpRouter- 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:
getReceivedCountin interfaceGridTcpRouterMBean- 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:
getSendCountin interfaceGridTcpRouterMBean- Returns:
- Number of responses returned by this router.
-
-