Package org.apache.ignite.configuration
Class ClientConnectorConfiguration
- java.lang.Object
-
- org.apache.ignite.configuration.ClientConnectorConfiguration
-
public class ClientConnectorConfiguration extends Object
Client connector configuration.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DFLT_HANDSHAKE_TIMEOUT
Default handshake timeout.static int
DFLT_IDLE_TIMEOUT
Default idle timeout.static int
DFLT_MAX_OPEN_CURSORS_PER_CONN
Default max number of open cursors per connection.static int
DFLT_PORT
Default port.static int
DFLT_PORT_RANGE
Default port range.static int
DFLT_SELECTOR_CNT
Default selector count.static int
DFLT_SESSIONS_MESSAGE_QUEUE_LIMIT
Default session outbound queue limit.static int
DFLT_SOCK_BUF_SIZE
Default socket send and receive buffer size.static boolean
DFLT_TCP_NO_DELAY
Default value forTCP_NODELAY
socket option (value is true).static int
DFLT_THREAD_POOL_SIZE
Default size of thread pool.static boolean
DFLT_USE_IGNITE_SSL_CTX_FACTORY
Default value of whether to use Ignite SSL context factory.
-
Constructor Summary
Constructors Constructor Description ClientConnectorConfiguration()
Creates SQL connector configuration with all default values.ClientConnectorConfiguration(ClientConnectorConfiguration cfg)
Creates SQL connector configuration by copying all properties from given configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getHandshakeTimeout()
Gets handshake timeout for client connections.@Nullable String
getHost()
Get host.long
getIdleTimeout()
Gets idle timeout for client connections.int
getMaxOpenCursorsPerConnection()
Gets maximum number of opened cursors per connection.int
getPort()
Get port.int
getPortRange()
Get port range.int
getSelectorCount()
Get count of selectors to use in TCP server.int
getSessionOutboundMessageQueueLimit()
int
getSocketReceiveBufferSize()
Gets socket receive buffer size.int
getSocketSendBufferSize()
Gets socket send buffer size.javax.cache.configuration.Factory<SSLContext>
getSslContextFactory()
Returns SSL context factory that will be used for creating a secure socket layer.ThinClientConfiguration
getThinClientConfiguration()
int
getThreadPoolSize()
Size of thread pool that is in charge of processing client requests.boolean
isJdbcEnabled()
Gets whether access through JDBC is enabled.boolean
isOdbcEnabled()
Gets whether access through ODBC is enabled.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()
Whether secure socket layer should be enabled on client connector.boolean
isTcpNoDelay()
Get TCP NO_DELAY flag.boolean
isThinClientEnabled()
Gets whether access through thin client is enabled.boolean
isUseIgniteSslContextFactory()
Gets whether to use Ignite SSL context factory configured throughIgniteConfiguration.getSslContextFactory()
ifgetSslContextFactory()
is not set.ClientConnectorConfiguration
setHandshakeTimeout(long handshakeTimeout)
Sets handshake timeout for client connections.ClientConnectorConfiguration
setHost(@Nullable String host)
Set host.ClientConnectorConfiguration
setIdleTimeout(long idleTimeout)
Sets idle timeout for client connections.ClientConnectorConfiguration
setJdbcEnabled(boolean jdbcEnabled)
Sets whether access through JDBC is enabled.ClientConnectorConfiguration
setMaxOpenCursorsPerConnection(int maxOpenCursorsPerConn)
Sets maximum number of opened cursors per connection.ClientConnectorConfiguration
setOdbcEnabled(boolean odbcEnabled)
Sets whether access through ODBC is enabled.ClientConnectorConfiguration
setPort(int port)
Set port.ClientConnectorConfiguration
setPortRange(int portRange)
Set port range.ClientConnectorConfiguration
setSelectorCount(int selectorCnt)
Sets count of selectors to use in TCP server.ClientConnectorConfiguration
setSessionOutboundMessageQueueLimit(int sesOutboundMsgQueueLimit)
Sets Client session outbound message queue limit.ClientConnectorConfiguration
setSocketReceiveBufferSize(int sockRcvBufSize)
Sets socket receive buffer size.ClientConnectorConfiguration
setSocketSendBufferSize(int sockSndBufSize)
Sets socket send buffer size.ClientConnectorConfiguration
setSslClientAuth(boolean sslClientAuth)
Sets flag indicating whether or not SSL client authentication is required.ClientConnectorConfiguration
setSslContextFactory(javax.cache.configuration.Factory<SSLContext> sslCtxFactory)
Sets SSL context factory that will be used for creating a secure socket layer.ClientConnectorConfiguration
setSslEnabled(boolean sslEnabled)
Sets whether Secure Socket Layer should be enabled for client connector.ClientConnectorConfiguration
setTcpNoDelay(boolean tcpNoDelay)
Set TCP NO_DELAY flag.ClientConnectorConfiguration
setThinClientConfiguration(ThinClientConfiguration thinCliCfg)
Sets thin-client specific configuration.ClientConnectorConfiguration
setThinClientEnabled(boolean thinCliEnabled)
Sets whether access through thin client is enabled.ClientConnectorConfiguration
setThreadPoolSize(int threadPoolSize)
Sets thread pool that is in charge of processing client requests.ClientConnectorConfiguration
setUseIgniteSslContextFactory(boolean useIgniteSslCtxFactory)
Sets whether to use Ignite SSL context factory.String
toString()
-
-
-
Field Detail
-
DFLT_PORT
public static final int DFLT_PORT
Default port.- See Also:
- Constant Field Values
-
DFLT_PORT_RANGE
public static final int DFLT_PORT_RANGE
Default port range.- See Also:
- Constant Field Values
-
DFLT_SOCK_BUF_SIZE
public static final int DFLT_SOCK_BUF_SIZE
Default socket send and receive buffer size.- See Also:
- Constant Field Values
-
DFLT_TCP_NO_DELAY
public static final boolean DFLT_TCP_NO_DELAY
Default value forTCP_NODELAY
socket option (value is true).- See Also:
- Constant Field Values
-
DFLT_MAX_OPEN_CURSORS_PER_CONN
public static final int DFLT_MAX_OPEN_CURSORS_PER_CONN
Default max number of open cursors per connection.- See Also:
- Constant Field Values
-
DFLT_THREAD_POOL_SIZE
public static final int DFLT_THREAD_POOL_SIZE
Default size of thread pool.
-
DFLT_SELECTOR_CNT
public static final int DFLT_SELECTOR_CNT
Default selector count.
-
DFLT_HANDSHAKE_TIMEOUT
public static final int DFLT_HANDSHAKE_TIMEOUT
Default handshake timeout.- See Also:
- Constant Field Values
-
DFLT_IDLE_TIMEOUT
public static final int DFLT_IDLE_TIMEOUT
Default idle timeout.- See Also:
- Constant Field Values
-
DFLT_USE_IGNITE_SSL_CTX_FACTORY
public static final boolean DFLT_USE_IGNITE_SSL_CTX_FACTORY
Default value of whether to use Ignite SSL context factory.- See Also:
- Constant Field Values
-
DFLT_SESSIONS_MESSAGE_QUEUE_LIMIT
public static final int DFLT_SESSIONS_MESSAGE_QUEUE_LIMIT
Default session outbound queue limit.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClientConnectorConfiguration
public ClientConnectorConfiguration()
Creates SQL connector configuration with all default values.
-
ClientConnectorConfiguration
public ClientConnectorConfiguration(ClientConnectorConfiguration cfg)
Creates SQL connector configuration by copying all properties from given configuration.- Parameters:
cfg
- Configuration to copy.
-
-
Method Detail
-
getHost
@Nullable public @Nullable String getHost()
Get host.- Returns:
- Host.
-
setHost
public ClientConnectorConfiguration setHost(@Nullable @Nullable String host)
Set host.- Parameters:
host
- Host.- Returns:
- This instance for chaining.
-
getPort
public int getPort()
Get port.- Returns:
- Port.
-
setPort
public ClientConnectorConfiguration setPort(int port)
Set port.- Parameters:
port
- Port.- Returns:
- This instance for chaining.
-
getPortRange
public int getPortRange()
Get port range.- Returns:
- Port range.
-
setPortRange
public ClientConnectorConfiguration setPortRange(int portRange)
Set port range.- Parameters:
portRange
- Port range.- Returns:
- This instance for chaining.
-
getSocketSendBufferSize
public int getSocketSendBufferSize()
Gets socket send buffer size. When set to zero, operation system default will be used.Defaults to
DFLT_SOCK_BUF_SIZE
- Returns:
- Socket send buffer size in bytes.
-
setSocketSendBufferSize
public ClientConnectorConfiguration setSocketSendBufferSize(int sockSndBufSize)
Sets socket send buffer size. SeegetSocketSendBufferSize()
for more information.- Parameters:
sockSndBufSize
- Socket send buffer size in bytes.- Returns:
- This instance for chaining.
-
getSocketReceiveBufferSize
public int getSocketReceiveBufferSize()
Gets socket receive buffer size. When set to zero, operation system default will be used.Defaults to
DFLT_SOCK_BUF_SIZE
.- Returns:
- Socket receive buffer size in bytes.
-
setSocketReceiveBufferSize
public ClientConnectorConfiguration setSocketReceiveBufferSize(int sockRcvBufSize)
Sets socket receive buffer size. SeegetSocketReceiveBufferSize()
for more information.- Parameters:
sockRcvBufSize
- Socket receive buffer size in bytes.- Returns:
- This instance for chaining.
-
isTcpNoDelay
public boolean isTcpNoDelay()
Get TCP NO_DELAY flag.- Returns:
- TCP NO_DELAY flag.
-
setTcpNoDelay
public ClientConnectorConfiguration setTcpNoDelay(boolean tcpNoDelay)
Set TCP NO_DELAY flag.- Parameters:
tcpNoDelay
- TCP NO_DELAY flag.- Returns:
- This instance for chaining.
-
getMaxOpenCursorsPerConnection
public int getMaxOpenCursorsPerConnection()
Gets maximum number of opened cursors per connection.Defaults to
DFLT_MAX_OPEN_CURSORS_PER_CONN
.- Returns:
- Maximum number of opened cursors.
-
setMaxOpenCursorsPerConnection
public ClientConnectorConfiguration setMaxOpenCursorsPerConnection(int maxOpenCursorsPerConn)
Sets maximum number of opened cursors per connection.- Parameters:
maxOpenCursorsPerConn
- Maximum number of opened cursors.- Returns:
- This instance for chaining.
-
getThreadPoolSize
public int getThreadPoolSize()
Size of thread pool that is in charge of processing client requests.Defaults
DFLT_THREAD_POOL_SIZE
.- Returns:
- Thread pool that is in charge of processing client requests.
-
setThreadPoolSize
public ClientConnectorConfiguration setThreadPoolSize(int threadPoolSize)
Sets thread pool that is in charge of processing client requests. SeegetThreadPoolSize()
for more information.- Parameters:
threadPoolSize
- Thread pool that is in charge of processing client requests.- Returns:
- This instance for chaining.
-
getSelectorCount
public int getSelectorCount()
Get count of selectors to use in TCP server.Defaults
DFLT_SELECTOR_CNT
.- Returns:
- Count of selectors to use in TCP server.
-
setSelectorCount
public ClientConnectorConfiguration setSelectorCount(int selectorCnt)
Sets count of selectors to use in TCP server. SeegetSelectorCount()
for more information.- Parameters:
selectorCnt
- Count of selectors to use in TCP server.- Returns:
- This instance for chaining.
-
getIdleTimeout
public long getIdleTimeout()
Gets idle timeout for client connections. If no packets come within idle timeout, the connection is closed. Zero or negative means no timeout.- Returns:
- Idle timeout in milliseconds.
-
setIdleTimeout
public ClientConnectorConfiguration setIdleTimeout(long idleTimeout)
Sets idle timeout for client connections. If no packets come within idle timeout, the connection is closed. Zero or negative means no timeout.- Parameters:
idleTimeout
- Idle timeout in milliseconds.- Returns:
this
for chaining.- See Also:
getIdleTimeout()
-
getHandshakeTimeout
public long getHandshakeTimeout()
Gets handshake timeout for client connections. If no successful handshake is performed within this timeout upon successful establishment of TCP connection, the connection is closed. Zero or negative means no timeout.- Returns:
- Handshake timeout in milliseconds.
-
setHandshakeTimeout
public ClientConnectorConfiguration setHandshakeTimeout(long handshakeTimeout)
Sets handshake timeout for client connections. If no successful handshake is performed within this timeout upon successful establishment of TCP connection, the connection is closed. Zero or negative means no timeout.- Parameters:
handshakeTimeout
- Idle timeout in milliseconds.- Returns:
this
for chaining.- See Also:
getHandshakeTimeout()
-
isJdbcEnabled
public boolean isJdbcEnabled()
Gets whether access through JDBC is enabled.Defaults to
true
.- Returns:
- Whether access through JDBC is enabled.
-
setJdbcEnabled
public ClientConnectorConfiguration setJdbcEnabled(boolean jdbcEnabled)
Sets whether access through JDBC is enabled.Defaults to
true
.- Parameters:
jdbcEnabled
- Whether access through JDBC is enabled.- Returns:
this
for chaining.
-
isOdbcEnabled
public boolean isOdbcEnabled()
Gets whether access through ODBC is enabled.Defaults to
true
.- Returns:
- Whether access through ODBC is enabled.
-
setOdbcEnabled
public ClientConnectorConfiguration setOdbcEnabled(boolean odbcEnabled)
Sets whether access through ODBC is enabled.Defaults to
true
.- Parameters:
odbcEnabled
- Whether access through ODBC is enabled.- Returns:
this
for chaining.
-
isThinClientEnabled
public boolean isThinClientEnabled()
Gets whether access through thin client is enabled.Defaults to
true
.- Returns:
- Whether access through thin client is enabled.
-
setThinClientEnabled
public ClientConnectorConfiguration setThinClientEnabled(boolean thinCliEnabled)
Sets whether access through thin client is enabled.Defaults to
true
.- Parameters:
thinCliEnabled
- Whether access through thin client is enabled.- Returns:
this
for chaining.
-
isSslEnabled
public boolean isSslEnabled()
Whether secure socket layer should be enabled on client connector.Note that if this flag is set to
true
, an instance ofFactory<SSLContext>
should be provided, otherwise client connector will fail to start.- Returns:
True
if SSL should be enabled.
-
setSslEnabled
public ClientConnectorConfiguration setSslEnabled(boolean sslEnabled)
Sets whether Secure Socket Layer should be enabled for client connector. Note that if this flag is set totrue
, then a valid instance ofFactory<SSLContext>
should be provided inIgniteConfiguration
. Otherwise, TCP binary protocol will fail to start.- Parameters:
sslEnabled
-True
if SSL should be enabled.- Returns:
this
for chaining.
-
isUseIgniteSslContextFactory
public boolean isUseIgniteSslContextFactory()
Gets whether to use Ignite SSL context factory configured throughIgniteConfiguration.getSslContextFactory()
ifgetSslContextFactory()
is not set.- Returns:
True
if Ignite SSL context factory can be used.
-
setUseIgniteSslContextFactory
public ClientConnectorConfiguration setUseIgniteSslContextFactory(boolean useIgniteSslCtxFactory)
Sets whether to use Ignite SSL context factory. SeeisUseIgniteSslContextFactory()
for more information.- Parameters:
useIgniteSslCtxFactory
- Whether to use Ignite SSL context factory- Returns:
this
for chaining.
-
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.- Returns:
- Whether or not client authentication is required.
-
setSslClientAuth
public ClientConnectorConfiguration setSslClientAuth(boolean sslClientAuth)
Sets flag indicating whether or not SSL client authentication is required.- Parameters:
sslClientAuth
- Whether or not client authentication is required.- Returns:
this
for chaining.
-
setSslContextFactory
public ClientConnectorConfiguration setSslContextFactory(javax.cache.configuration.Factory<SSLContext> sslCtxFactory)
Sets SSL context factory that will be used for creating a secure socket layer.- Parameters:
sslCtxFactory
- Ssl context factory.- Returns:
this
for chaining.- See Also:
SslContextFactory
-
getSslContextFactory
public javax.cache.configuration.Factory<SSLContext> getSslContextFactory()
Returns SSL context factory that will be used for creating a secure socket layer.- Returns:
- SSL connection factory.
- See Also:
SslContextFactory
-
getThinClientConfiguration
public ThinClientConfiguration getThinClientConfiguration()
- Returns:
- Thin-client specific configuration.
-
setThinClientConfiguration
public ClientConnectorConfiguration setThinClientConfiguration(ThinClientConfiguration thinCliCfg)
Sets thin-client specific configuration.- Parameters:
thinCliCfg
- Thin-client specific configuration..- Returns:
this
for chaining.
-
getSessionOutboundMessageQueueLimit
public int getSessionOutboundMessageQueueLimit()
- Returns:
- Session outbound message queue limit.
-
setSessionOutboundMessageQueueLimit
public ClientConnectorConfiguration setSessionOutboundMessageQueueLimit(int sesOutboundMsgQueueLimit)
Sets Client session outbound message queue limit. Limits the number of messages waiting to be sent from the server side to particular client. If the specified limit is exceeded, corresponding Client connection will be closed. The value0
means that no limit is applied to the Client outbound message queue.- Parameters:
sesOutboundMsgQueueLimit
- Session outbound queue limit.- Returns:
this
for chaining.
-
-