Class ConnectorConfiguration
- java.lang.Object
- 
- org.apache.ignite.configuration.ConnectorConfiguration
 
- 
 public class ConnectorConfiguration extends Object REST access configuration.
- 
- 
Field SummaryFields Modifier and Type Field Description static intDFLT_IDLE_TIMEOUTDefault REST idle timeout.static longDFLT_KEEP_ALIVE_TIMEDefault keep alive time for REST thread pool.static intDFLT_PORT_RANGEDefault rest port range.static intDFLT_REST_CORE_THREAD_CNTDefault size of REST thread pool.static intDFLT_REST_MAX_THREAD_CNTDefault max size of REST thread pool.static intDFLT_SOCK_BUF_SIZEDefault socket send and receive buffer size.static booleanDFLT_TCP_DIRECT_BUFDefault TCP direct buffer flag.static booleanDFLT_TCP_NODELAYDefault TCP_NODELAY flag.static intDFLT_TCP_PORTDefault TCP server port.static intDFLT_THREADPOOL_QUEUE_CAPDefault max queue capacity of REST thread pool.
 - 
Constructor SummaryConstructors Constructor Description ConnectorConfiguration()Creates client connection configuration with all default values.ConnectorConfiguration(ConnectorConfiguration cfg)Creates client connection configuration by copying all properties from given configuration.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetHost()Gets host for TCP binary protocol server.longgetIdleQueryCursorCheckFrequency()Gets idle query cursors check frequency.longgetIdleQueryCursorTimeout()Gets idle query cursors timeout in milliseconds.longgetIdleTimeout()Gets idle timeout for REST server.StringgetJettyPath()Gets path, either absolute or relative toIGNITE_HOME, toJettyXML configuration file.@Nullable ConnectorMessageInterceptorgetMessageInterceptor()Gets interceptor for objects, moving to and from remote clients.intgetPort()Gets port for TCP binary protocol server.intgetPortRange()Gets number of ports to try if configured port is already in use.intgetReceiveBufferSize()Gets REST TCP server receive buffer size in bytes.@Nullable StringgetSecretKey()Gets secret key to authenticate REST requests.intgetSelectorCount()Gets number of selector threads in REST TCP server.intgetSendBufferSize()Gets REST TCP server send buffer size.intgetSendQueueLimit()Gets REST TCP server send queue limit.javax.cache.configuration.Factory<SSLContext>getSslFactory()Gets context factory that will be used for creating a secure socket layer of rest binary server.intgetThreadPoolSize()Should return a thread pool size to be used for processing of client messages (REST requests).booleanisDirectBuffer()Gets flag indicating whether REST TCP server should use direct buffers.booleanisNoDelay()Gets flag indicating whetherTCP_NODELAYoption should be set for accepted client connections.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 binary rest server.ConnectorConfigurationsetDirectBuffer(boolean directBuf)Sets whether to use direct buffer for REST TCP server.ConnectorConfigurationsetHost(String host)Sets host for TCP binary protocol server.ConnectorConfigurationsetIdleQueryCursorCheckFrequency(long idleQryCurCheckFreq)Sets idle query cursor check frequency.ConnectorConfigurationsetIdleQueryCursorTimeout(long idleQryCurTimeout)Sets idle query cursors timeout.ConnectorConfigurationsetIdleTimeout(long idleTimeout)Sets idle timeout for REST server.ConnectorConfigurationsetJettyPath(String jettyPath)Sets path, either absolute or relative toIGNITE_HOME, toJETTYXML configuration file.ConnectorConfigurationsetMessageInterceptor(ConnectorMessageInterceptor interceptor)Sets client message interceptor.ConnectorConfigurationsetNoDelay(boolean noDelay)Sets whetherTCP_NODELAYoption should be set for all accepted client connections.ConnectorConfigurationsetPort(int port)Sets port for TCP binary protocol server.ConnectorConfigurationsetPortRange(int portRange)Sets number of ports to try if configured one is in use.ConnectorConfigurationsetReceiveBufferSize(int rcvBufSize)Sets REST TCP server receive buffer size in bytes.ConnectorConfigurationsetSecretKey(@Nullable String secretKey)Sets secret key to authenticate REST requests.ConnectorConfigurationsetSelectorCount(int selectorCnt)Sets number of selector threads for REST TCP server.ConnectorConfigurationsetSendBufferSize(int sndBufSize)Sets REST TCP server send buffer size.ConnectorConfigurationsetSendQueueLimit(int sndQueueLimit)Sets REST TCP server send queue limit.ConnectorConfigurationsetSslClientAuth(boolean sslClientAuth)Sets flag indicating whether or not SSL client authentication is required.ConnectorConfigurationsetSslEnabled(boolean sslEnabled)Sets whether Secure Socket Layer should be enabled for REST TCP binary protocol.ConnectorConfigurationsetSslFactory(javax.cache.configuration.Factory<SSLContext> sslFactory)Sets instance ofFactorythat will be used to create an instance ofSSLContextfor Secure Socket Layer on TCP binary protocol.ConnectorConfigurationsetThreadPoolSize(int threadPoolSize)Sets thread pool size to use for processing of client messages (REST requests).StringtoString()
 
- 
- 
- 
Field Detail- 
DFLT_TCP_PORTpublic static final int DFLT_TCP_PORT Default TCP server port.- See Also:
- Constant Field Values
 
 - 
DFLT_TCP_NODELAYpublic static final boolean DFLT_TCP_NODELAY Default TCP_NODELAY flag.- See Also:
- Constant Field Values
 
 - 
DFLT_TCP_DIRECT_BUFpublic static final boolean DFLT_TCP_DIRECT_BUF Default TCP direct buffer flag.- See Also:
- Constant Field Values
 
 - 
DFLT_IDLE_TIMEOUTpublic static final int DFLT_IDLE_TIMEOUT Default REST idle timeout.- See Also:
- Constant Field Values
 
 - 
DFLT_PORT_RANGEpublic static final int DFLT_PORT_RANGE Default rest port range.- See Also:
- Constant Field Values
 
 - 
DFLT_REST_CORE_THREAD_CNTpublic static final int DFLT_REST_CORE_THREAD_CNT Default size of REST thread pool.
 - 
DFLT_REST_MAX_THREAD_CNTpublic static final int DFLT_REST_MAX_THREAD_CNT Default max size of REST thread pool.
 - 
DFLT_KEEP_ALIVE_TIMEpublic static final long DFLT_KEEP_ALIVE_TIME Default keep alive time for REST thread pool.- See Also:
- Constant Field Values
 
 - 
DFLT_THREADPOOL_QUEUE_CAPpublic static final int DFLT_THREADPOOL_QUEUE_CAP Default max queue capacity of REST thread pool.- See Also:
- Constant Field Values
 
 - 
DFLT_SOCK_BUF_SIZEpublic static final int DFLT_SOCK_BUF_SIZE Default socket send and receive buffer size.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
ConnectorConfigurationpublic ConnectorConfiguration() Creates client connection configuration with all default values.
 - 
ConnectorConfigurationpublic ConnectorConfiguration(ConnectorConfiguration cfg) Creates client connection configuration by copying all properties from given configuration.- Parameters:
- cfg- Client configuration.
 
 
- 
 - 
Method Detail- 
setJettyPathpublic ConnectorConfiguration setJettyPath(String jettyPath) Sets path, either absolute or relative toIGNITE_HOME, toJETTYXML configuration file.JETTYis used to support REST over HTTP protocol for accessing Ignite APIs remotely.- Parameters:
- jettyPath- Path to- JETTYXML configuration file.
- Returns:
- thisfor chaining.
 
 - 
getJettyPathpublic String getJettyPath() Gets path, either absolute or relative toIGNITE_HOME, toJettyXML configuration file.Jettyis used to support REST over HTTP protocol for accessing Ignite APIs remotely.If not provided, Jetty instance with default configuration will be started picking IgniteSystemProperties.IGNITE_JETTY_HOSTandIgniteSystemProperties.IGNITE_JETTY_PORTas host and port respectively.- Returns:
- Path to JETTYXML configuration file.
- See Also:
- IgniteSystemProperties.IGNITE_JETTY_HOST,- IgniteSystemProperties.IGNITE_JETTY_PORT
 
 - 
setSecretKeypublic ConnectorConfiguration setSecretKey(@Nullable @Nullable String secretKey) Sets secret key to authenticate REST requests. If key isnullor empty authentication is disabled.- Parameters:
- secretKey- REST secret key.
- Returns:
- thisfor chaining.
 
 - 
getSecretKey@Nullable public @Nullable String getSecretKey() Gets secret key to authenticate REST requests. If key isnullor empty authentication is disabled.- Returns:
- Secret key.
- See Also:
- IgniteSystemProperties.IGNITE_JETTY_HOST,- IgniteSystemProperties.IGNITE_JETTY_PORT
 
 - 
getHostpublic String getHost() Gets host for TCP binary protocol server. This can be either an IP address or a domain name.If not defined, system-wide local address will be used (see IgniteConfiguration.getLocalHost().You can also use 0.0.0.0value to bind to all locally-available IP addresses.- Returns:
- TCP host.
 
 - 
setHostpublic ConnectorConfiguration setHost(String host) Sets host for TCP binary protocol server.- Parameters:
- host- TCP host.
- Returns:
- thisfor chaining.
 
 - 
getPortpublic int getPort() Gets port for TCP binary protocol server.Default is DFLT_TCP_PORT.- Returns:
- TCP port.
 
 - 
setPortpublic ConnectorConfiguration setPort(int port) Sets port for TCP binary protocol server.- Parameters:
- port- TCP port.
- Returns:
- thisfor chaining.
 
 - 
isNoDelaypublic boolean isNoDelay() Gets flag indicating whetherTCP_NODELAYoption should be set for accepted client connections. Setting this option reduces network latency and should be set totruein majority of cases. For more information, seeSocket.setTcpNoDelay(boolean)If not specified, default value isDFLT_TCP_NODELAY.- Returns:
- Whether TCP_NODELAYoption should be enabled.
 
 - 
setNoDelaypublic ConnectorConfiguration setNoDelay(boolean noDelay) Sets whetherTCP_NODELAYoption should be set for all accepted client connections.- Parameters:
- noDelay-- Trueif option should be enabled.
- Returns:
- thisfor chaining.
- See Also:
- isNoDelay()
 
 - 
isDirectBufferpublic boolean isDirectBuffer() Gets flag indicating whether REST TCP server should use direct buffers. A direct buffer is a buffer that is allocated and accessed using native system calls, without using JVM heap. Enabling direct buffer may improve performance and avoid memory issues (long GC pauses due to huge buffer size).- Returns:
- Whether direct buffer should be used.
 
 - 
setDirectBufferpublic ConnectorConfiguration setDirectBuffer(boolean directBuf) Sets whether to use direct buffer for REST TCP server.- Parameters:
- directBuf-- Trueif option should be enabled.
- Returns:
- thisfor chaining.
- See Also:
- isDirectBuffer()
 
 - 
getSendBufferSizepublic int getSendBufferSize() Gets REST TCP server send buffer size.- Returns:
- REST TCP server send buffer size (0 for default).
 
 - 
setSendBufferSizepublic ConnectorConfiguration setSendBufferSize(int sndBufSize) Sets REST TCP server send buffer size.- Parameters:
- sndBufSize- Send buffer size.
- Returns:
- thisfor chaining.
- See Also:
- getSendBufferSize()
 
 - 
getReceiveBufferSizepublic int getReceiveBufferSize() Gets REST TCP server receive buffer size in bytes.- Returns:
- REST TCP server receive buffer size in bytes(0 for default).
 
 - 
setReceiveBufferSizepublic ConnectorConfiguration setReceiveBufferSize(int rcvBufSize) Sets REST TCP server receive buffer size in bytes.- Parameters:
- rcvBufSize- Receive buffer size in bytes.
- Returns:
- thisfor chaining.
- See Also:
- getReceiveBufferSize()
 
 - 
getSendQueueLimitpublic int getSendQueueLimit() Gets REST TCP server send queue limit. If the limit exceeds, all successive writes will block until the queue has enough capacity.- Returns:
- REST TCP server send queue limit (0 for unlimited).
 
 - 
setSendQueueLimitpublic ConnectorConfiguration setSendQueueLimit(int sndQueueLimit) Sets REST TCP server send queue limit.- Parameters:
- sndQueueLimit- REST TCP server send queue limit (0 for unlimited).
- Returns:
- thisfor chaining.
- See Also:
- getSendQueueLimit()
 
 - 
getSelectorCountpublic int getSelectorCount() Gets number of selector threads in REST TCP server. Higher value for this parameter may increase throughput, but also increases context switching.- Returns:
- Number of selector threads for REST TCP server.
 
 - 
setSelectorCountpublic ConnectorConfiguration setSelectorCount(int selectorCnt) Sets number of selector threads for REST TCP server.- Parameters:
- selectorCnt- Number of selector threads for REST TCP server.
- Returns:
- thisfor chaining.
- See Also:
- getSelectorCount()
 
 - 
getIdleTimeoutpublic long getIdleTimeout() Gets idle timeout for REST server.This setting is used to reject half-opened sockets. If no packets come within idle timeout, the connection is closed. - Returns:
- Idle timeout in milliseconds.
 
 - 
setIdleTimeoutpublic ConnectorConfiguration setIdleTimeout(long idleTimeout) Sets idle timeout for REST server.- Parameters:
- idleTimeout- Idle timeout in milliseconds.
- Returns:
- thisfor chaining.
- See Also:
- getIdleTimeout()
 
 - 
isSslEnabledpublic boolean isSslEnabled() Whether secure socket layer should be enabled on binary rest server.Note that if this flag is set to true, an instance of the ssl factory should be provided, otherwise binary rest protocol will fail to start.- Returns:
- Trueif SSL should be enabled.
 
 - 
setSslEnabledpublic ConnectorConfiguration setSslEnabled(boolean sslEnabled) Sets whether Secure Socket Layer should be enabled for REST TCP binary protocol. Note that if this flag is set totrue, then a valid instance of the ssl factory should be provided inIgniteConfiguration. Otherwise, TCP binary protocol will fail to start.- Parameters:
- sslEnabled-- Trueif SSL should be enabled.
- Returns:
- thisfor chaining.
 
 - 
isSslClientAuthpublic 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.
 
 - 
setSslClientAuthpublic ConnectorConfiguration 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.
 
 - 
getSslFactorypublic javax.cache.configuration.Factory<SSLContext> getSslFactory() Gets context factory that will be used for creating a secure socket layer of rest binary server.- Returns:
- SSL context factory instance.
- See Also:
- SslContextFactory
 
 - 
setSslFactorypublic ConnectorConfiguration setSslFactory(javax.cache.configuration.Factory<SSLContext> sslFactory) Sets instance ofFactorythat will be used to create an instance ofSSLContextfor Secure Socket Layer on TCP binary protocol. This factory will only be used ifsetSslEnabled(boolean)is set totrue.- Parameters:
- sslFactory- Instance of- Factory
- Returns:
- thisfor chaining.
 
 - 
getPortRangepublic int getPortRange() Gets number of ports to try if configured port is already in use. If port range value is 0, then implementation will try bind only to the port provided bysetPort(int)method and fail if binding to this port did not succeed.- Returns:
- Number of ports to try.
 
 - 
setPortRangepublic ConnectorConfiguration setPortRange(int portRange) Sets number of ports to try if configured one is in use.- Parameters:
- portRange- Port range.
- Returns:
- thisfor chaining.
 
 - 
getThreadPoolSizepublic int getThreadPoolSize() Should return a thread pool size to be used for processing of client messages (REST requests).- Returns:
- Thread pool size to be used for processing of client messages.
 
 - 
setThreadPoolSizepublic ConnectorConfiguration setThreadPoolSize(int threadPoolSize) Sets thread pool size to use for processing of client messages (REST requests).- Parameters:
- threadPoolSize- Thread pool size to use for processing of client messages.
- Returns:
- thisfor chaining.
- See Also:
- getThreadPoolSize()
 
 - 
getMessageInterceptor@Nullable public @Nullable ConnectorMessageInterceptor getMessageInterceptor() Gets interceptor for objects, moving to and from remote clients. If this method returnsnullthen no interception will be applied.Setting interceptor allows to transform all objects exchanged via REST protocol. For example if you use custom serialisation on client you can write interceptor to transform binary representations received from client to Java objects and later access them from java code directly. Default value is null.- Returns:
- Interceptor.
- See Also:
- ConnectorMessageInterceptor
 
 - 
setMessageInterceptorpublic ConnectorConfiguration setMessageInterceptor(ConnectorMessageInterceptor interceptor) Sets client message interceptor.Setting interceptor allows to transform all objects exchanged via REST protocol. For example if you use custom serialisation on client you can write interceptor to transform binary representations received from client to Java objects and later access them from java code directly. - Parameters:
- interceptor- Interceptor.
- Returns:
- thisfor chaining.
 
 - 
setIdleQueryCursorTimeoutpublic ConnectorConfiguration setIdleQueryCursorTimeout(long idleQryCurTimeout) Sets idle query cursors timeout.- Parameters:
- idleQryCurTimeout- Idle query cursors timeout in milliseconds.
- Returns:
- thisfor chaining.
- See Also:
- getIdleQueryCursorTimeout()
 
 - 
getIdleQueryCursorTimeoutpublic long getIdleQueryCursorTimeout() Gets idle query cursors timeout in milliseconds.This setting is used to reject open query cursors that is not used. If no fetch query request come within idle timeout, it will be removed on next check for old query cursors (see getIdleQueryCursorCheckFrequency()).- Returns:
- Idle query cursors timeout in milliseconds
 
 - 
setIdleQueryCursorCheckFrequencypublic ConnectorConfiguration setIdleQueryCursorCheckFrequency(long idleQryCurCheckFreq) Sets idle query cursor check frequency.- Parameters:
- idleQryCurCheckFreq- Idle query check frequency in milliseconds.
- Returns:
- thisfor chaining.
- See Also:
- getIdleQueryCursorCheckFrequency()
 
 - 
getIdleQueryCursorCheckFrequencypublic long getIdleQueryCursorCheckFrequency() Gets idle query cursors check frequency. This setting is used to reject open query cursors that is not used.Scheduler tries with specified period to close queries' cursors that are overtime. - Returns:
- Idle query cursor check frequency in milliseconds.
 
 
- 
 
-