Class ClientConnectorConfiguration


  • public class ClientConnectorConfiguration
    extends Object
    Client connector configuration.
    • Field Detail

      • 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 for TCP_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.
      • 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. See getSocketSendBufferSize() 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. See getSocketReceiveBufferSize() 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. See getThreadPoolSize() 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. See getSelectorCount() 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 of Factory<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 to true, then a valid instance of Factory<SSLContext> should be provided in IgniteConfiguration. Otherwise, TCP binary protocol will fail to start.

        Parameters:
        sslEnabled - True if SSL should be enabled.
        Returns:
        this for chaining.
      • setUseIgniteSslContextFactory

        public ClientConnectorConfiguration setUseIgniteSslContextFactory​(boolean useIgniteSslCtxFactory)
        Sets whether to use Ignite SSL context factory. See isUseIgniteSslContextFactory() 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 value 0 means that no limit is applied to the Client outbound message queue.
        Parameters:
        sesOutboundMsgQueueLimit - Session outbound queue limit.
        Returns:
        this for chaining.