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 intDFLT_HANDSHAKE_TIMEOUTDefault handshake timeout.static intDFLT_IDLE_TIMEOUTDefault idle timeout.static intDFLT_MAX_OPEN_CURSORS_PER_CONNDefault max number of open cursors per connection.static intDFLT_PORTDefault port.static intDFLT_PORT_RANGEDefault port range.static intDFLT_SELECTOR_CNTDefault selector count.static intDFLT_SESSIONS_MESSAGE_QUEUE_LIMITDefault session outbound queue limit.static intDFLT_SOCK_BUF_SIZEDefault socket send and receive buffer size.static booleanDFLT_TCP_NO_DELAYDefault value forTCP_NODELAYsocket option (value is true).static intDFLT_THREAD_POOL_SIZEDefault size of thread pool.static booleanDFLT_USE_IGNITE_SSL_CTX_FACTORYDefault 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 longgetHandshakeTimeout()Gets handshake timeout for client connections.@Nullable StringgetHost()Get host.longgetIdleTimeout()Gets idle timeout for client connections.intgetMaxOpenCursorsPerConnection()Gets maximum number of opened cursors per connection.intgetPort()Get port.intgetPortRange()Get port range.intgetSelectorCount()Get count of selectors to use in TCP server.intgetSessionOutboundMessageQueueLimit()intgetSocketReceiveBufferSize()Gets socket receive buffer size.intgetSocketSendBufferSize()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.ThinClientConfigurationgetThinClientConfiguration()intgetThreadPoolSize()Size of thread pool that is in charge of processing client requests.booleanisJdbcEnabled()Gets whether access through JDBC is enabled.booleanisOdbcEnabled()Gets whether access through ODBC is enabled.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()Whether secure socket layer should be enabled on client connector.booleanisTcpNoDelay()Get TCP NO_DELAY flag.booleanisThinClientEnabled()Gets whether access through thin client is enabled.booleanisUseIgniteSslContextFactory()Gets whether to use Ignite SSL context factory configured throughIgniteConfiguration.getSslContextFactory()ifgetSslContextFactory()is not set.ClientConnectorConfigurationsetHandshakeTimeout(long handshakeTimeout)Sets handshake timeout for client connections.ClientConnectorConfigurationsetHost(@Nullable String host)Set host.ClientConnectorConfigurationsetIdleTimeout(long idleTimeout)Sets idle timeout for client connections.ClientConnectorConfigurationsetJdbcEnabled(boolean jdbcEnabled)Sets whether access through JDBC is enabled.ClientConnectorConfigurationsetMaxOpenCursorsPerConnection(int maxOpenCursorsPerConn)Sets maximum number of opened cursors per connection.ClientConnectorConfigurationsetOdbcEnabled(boolean odbcEnabled)Sets whether access through ODBC is enabled.ClientConnectorConfigurationsetPort(int port)Set port.ClientConnectorConfigurationsetPortRange(int portRange)Set port range.ClientConnectorConfigurationsetSelectorCount(int selectorCnt)Sets count of selectors to use in TCP server.ClientConnectorConfigurationsetSessionOutboundMessageQueueLimit(int sesOutboundMsgQueueLimit)Sets Client session outbound message queue limit.ClientConnectorConfigurationsetSocketReceiveBufferSize(int sockRcvBufSize)Sets socket receive buffer size.ClientConnectorConfigurationsetSocketSendBufferSize(int sockSndBufSize)Sets socket send buffer size.ClientConnectorConfigurationsetSslClientAuth(boolean sslClientAuth)Sets flag indicating whether or not SSL client authentication is required.ClientConnectorConfigurationsetSslContextFactory(javax.cache.configuration.Factory<SSLContext> sslCtxFactory)Sets SSL context factory that will be used for creating a secure socket layer.ClientConnectorConfigurationsetSslEnabled(boolean sslEnabled)Sets whether Secure Socket Layer should be enabled for client connector.ClientConnectorConfigurationsetTcpNoDelay(boolean tcpNoDelay)Set TCP NO_DELAY flag.ClientConnectorConfigurationsetThinClientConfiguration(ThinClientConfiguration thinCliCfg)Sets thin-client specific configuration.ClientConnectorConfigurationsetThinClientEnabled(boolean thinCliEnabled)Sets whether access through thin client is enabled.ClientConnectorConfigurationsetThreadPoolSize(int threadPoolSize)Sets thread pool that is in charge of processing client requests.ClientConnectorConfigurationsetUseIgniteSslContextFactory(boolean useIgniteSslCtxFactory)Sets whether to use Ignite SSL context factory.StringtoString()
-
-
-
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_NODELAYsocket 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:
thisfor 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:
thisfor 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:
thisfor 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:
thisfor 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:
thisfor 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:
Trueif 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-Trueif SSL should be enabled.- Returns:
thisfor chaining.
-
isUseIgniteSslContextFactory
public boolean isUseIgniteSslContextFactory()
Gets whether to use Ignite SSL context factory configured throughIgniteConfiguration.getSslContextFactory()ifgetSslContextFactory()is not set.- Returns:
Trueif 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:
thisfor 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:
thisfor 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:
thisfor 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:
thisfor 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 value0means that no limit is applied to the Client outbound message queue.- Parameters:
sesOutboundMsgQueueLimit- Session outbound queue limit.- Returns:
thisfor chaining.
-
-