public class GridTcpRouterConfiguration extends Object
Note that you should only set values that differ from defaults, as router will automatically pick default values for all values that are not set.
For more information about router configuration and startup refer to GridRouterFactory
documentation.
Modifier and Type | Field and Description |
---|---|
static int |
DFLT_PORT_RANGE
Default port range.
|
static Collection<String> |
DFLT_SERVERS
Default servers to which router will try to connect.
|
static String |
DFLT_TCP_HOST
Default TCP host for router to bind to.
|
static boolean |
DFLT_TCP_NODELAY
Default nodelay.
|
static int |
DFLT_TCP_PORT
Default TCP port.
|
Constructor and Description |
---|
GridTcpRouterConfiguration() |
Modifier and Type | Method and Description |
---|---|
String |
getHost()
Gets TCP host or IP address for router to bind to.
|
long |
getIdleTimeout()
Gets timeout in milliseconds to consider connection idle.
|
IgniteLogger |
getLogger()
Gets logger for the router instance.
|
int |
getPort()
Gets port for TCP binary protocol server.
|
int |
getPortRange()
Gets port range for TCP binary protocol server.
|
@Nullable SecurityCredentialsProvider |
getSecurityCredentialsProvider()
Gets credentials provider for grid access.
|
Collection<String> |
getServers()
Gets list of server addresses to which router should try to connect to.
|
@Nullable GridSslContextFactory |
getSslContextFactory()
Gets SSL context factory that will be used for creating a secure socket layer
of both rest binary server and out coming connections.
|
boolean |
isNoDelay()
Gets flag indicating whether
TCP_NODELAY option should be set for accepted client connections. |
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.
|
GridTcpRouterConfiguration |
setHost(String host)
Sets host for router.
|
GridTcpRouterConfiguration |
setIdleTimeout(long idleTimeout)
Sets idle timeout.
|
GridTcpRouterConfiguration |
setLogger(IgniteLogger log)
Sets logger for the router instance.
|
GridTcpRouterConfiguration |
setNoDelay(boolean noDelay)
Sets flag indicating whether
TCP_NODELAY option should be set
for accepted client connections. |
GridTcpRouterConfiguration |
setPort(int port)
Sets port for router.
|
GridTcpRouterConfiguration |
setPortRange(int portRange)
Sets port range router will be allowed to try.
|
GridTcpRouterConfiguration |
setSecurityCredentialsProvider(SecurityCredentialsProvider credsProvider)
Sets credentials provider for grid access.
|
GridTcpRouterConfiguration |
setServers(Collection<String> srvrs)
Sets list of server addresses where router's embedded client should connect.
|
GridTcpRouterConfiguration |
setSslClientAuth(boolean sslClientAuth)
Sets flag indicating whether or not remote clients will be required to have
a valid SSL certificate which validity will be verified with trust manager.
|
GridTcpRouterConfiguration |
setSslContextFactory(GridSslContextFactory sslCtxFactory)
Sets SSL context factory that will be used for creating a secure socket layer
of both rest binary server and out coming connections.
|
String |
toString() |
public static final Collection<String> DFLT_SERVERS
public static final String DFLT_TCP_HOST
public static final int DFLT_TCP_PORT
public static final int DFLT_PORT_RANGE
public static final boolean DFLT_TCP_NODELAY
public String getHost()
If not defined, router will try to bind to all interfaces.
public int getPort()
Default is DFLT_TCP_PORT
.
public int getPortRange()
getPort()
is busy then ports withing this range will be tried.
Note: zero-range means only user-specified port will be used.
Default is DFLT_PORT_RANGE
.
public boolean isNoDelay()
TCP_NODELAY
option should be set for accepted client connections.
Setting this option reduces network latency and should be set to true
in majority of cases.
For more information, see Socket.setTcpNoDelay(boolean)
If not specified, default value is true
.TCP_NODELAY
option should be enabled.public long getIdleTimeout()
ConnectorConfiguration.DFLT_IDLE_TIMEOUT
.public boolean isSslClientAuth()
@Nullable public @Nullable GridSslContextFactory getSslContextFactory()
GridSslContextFactory
public Collection<String> getServers()
Node that this list will be used only for initial grid connectivity. Once connected to the grid, router may establish connections to any grid node.
public IgniteLogger getLogger()
null
if no logger provided by configuration.@Nullable public @Nullable SecurityCredentialsProvider getSecurityCredentialsProvider()
This credentials will be used only for initial connection and topology discovery by the router, not for client's request authorization.
public GridTcpRouterConfiguration setHost(String host)
host
- Host.this
for chaining.public GridTcpRouterConfiguration setPort(int port)
port
- Port.this
for chaining.public GridTcpRouterConfiguration setPortRange(int portRange)
Note: zero-range means only user-specified port will be used.
portRange
- Port range.this
for chaining.DFLT_PORT_RANGE
public GridTcpRouterConfiguration setNoDelay(boolean noDelay)
TCP_NODELAY
option should be set
for accepted client connections.noDelay
- No delay.this
for chaining.public GridTcpRouterConfiguration setIdleTimeout(long idleTimeout)
idleTimeout
- Idle timeout in milliseconds.this
for chaining.public GridTcpRouterConfiguration setSslClientAuth(boolean sslClientAuth)
sslClientAuth
- Ssl client auth.this
for chaining.public GridTcpRouterConfiguration setSslContextFactory(GridSslContextFactory sslCtxFactory)
sslCtxFactory
- Ssl context factory.this
for chaining.public GridTcpRouterConfiguration setServers(Collection<String> srvrs)
srvrs
- List of servers.this
for chaining.public GridTcpRouterConfiguration setLogger(IgniteLogger log)
log
- Logger.this
for chaining.public GridTcpRouterConfiguration setSecurityCredentialsProvider(SecurityCredentialsProvider credsProvider)
credsProvider
- Credentials provider.this
for chaining.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021