Package com.hazelcast.config
Class EndpointConfig
- java.lang.Object
-
- com.hazelcast.config.EndpointConfig
-
- All Implemented Interfaces:
NamedConfig
- Direct Known Subclasses:
ServerSocketEndpointConfig
public class EndpointConfig extends java.lang.Object implements NamedConfig
Endpoint configuration that defines communication/networking properties common to both incoming/outgoing connections eg. - Encryption / Security - Hazelcast protocol type- Since:
- 3.12
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_SOCKET_CONNECT_TIMEOUT_SECONDS
SeeSocketOptions.SO_TIMEOUT
static int
DEFAULT_SOCKET_KEEP_COUNT
Seejdk.net.ExtendedSocketOptions#TCP_KEEPINTERVAL
static int
DEFAULT_SOCKET_KEEP_IDLE_SECONDS
Seejdk.net.ExtendedSocketOptions#TCP_KEEPIDLE
static int
DEFAULT_SOCKET_KEEP_INTERVAL_SECONDS
Seejdk.net.ExtendedSocketOptions#TCP_KEEPINTERVAL
static int
DEFAULT_SOCKET_LINGER_SECONDS
SeeSocketOptions.SO_LINGER
static int
DEFAULT_SOCKET_RECEIVE_BUFFER_SIZE_KB
SeeSocketOptions.SO_RCVBUF
.static int
DEFAULT_SOCKET_SEND_BUFFER_SIZE_KB
SeeSocketOptions.SO_SNDBUF
protected InterfacesConfig
interfaces
protected java.lang.String
name
protected com.hazelcast.instance.ProtocolType
protocolType
protected SocketInterceptorConfig
socketInterceptorConfig
protected SSLConfig
sslConfig
protected SymmetricEncryptionConfig
symmetricEncryptionConfig
-
Constructor Summary
Constructors Constructor Description EndpointConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description EndpointConfig
addOutboundPort(int port)
EndpointConfig
addOutboundPortDefinition(java.lang.String portDef)
boolean
equals(java.lang.Object o)
InterfacesConfig
getInterfaces()
java.lang.String
getName()
java.util.Collection<java.lang.String>
getOutboundPortDefinitions()
java.util.Collection<java.lang.Integer>
getOutboundPorts()
com.hazelcast.instance.ProtocolType
getProtocolType()
com.hazelcast.instance.EndpointQualifier
getQualifier()
int
getSocketConnectTimeoutSeconds()
SocketInterceptorConfig
getSocketInterceptorConfig()
Gets theSocketInterceptorConfig
.int
getSocketKeepCount()
Keep-Alive count: the maximum number of TCP keep-alive probes to send before giving up and closing the connection if no response is obtained from the other side.int
getSocketKeepIdleSeconds()
Keep-Alive idle time: the number of seconds of idle time before keep-alive initiates a probe.int
getSocketKeepIntervalSeconds()
Keep-Alive interval: the number of seconds between keep-alive probes.int
getSocketLingerSeconds()
int
getSocketRcvBufferSizeKb()
int
getSocketSendBufferSizeKb()
SSLConfig
getSSLConfig()
Returns the currentSSLConfig
.SymmetricEncryptionConfig
getSymmetricEncryptionConfig()
Deprecated.since 4.2TpcSocketConfig
getTpcSocketConfig()
Gets the TpcSocketConfig.int
hashCode()
boolean
isSocketBufferDirect()
boolean
isSocketKeepAlive()
boolean
isSocketTcpNoDelay()
EndpointConfig
setInterfaces(InterfacesConfig interfaces)
EndpointConfig
setName(java.lang.String name)
EndpointConfig
setOutboundPortDefinitions(java.util.Collection<java.lang.String> outboundPortDefs)
EndpointConfig
setOutboundPorts(java.util.Collection<java.lang.Integer> outboundPorts)
EndpointConfig
setProtocolType(com.hazelcast.instance.ProtocolType protocolType)
EndpointConfig
setSocketBufferDirect(boolean socketBufferDirect)
EndpointConfig
setSocketConnectTimeoutSeconds(int socketConnectTimeoutSeconds)
EndpointConfig
setSocketInterceptorConfig(SocketInterceptorConfig socketInterceptorConfig)
Sets theSocketInterceptorConfig
.EndpointConfig
setSocketKeepAlive(boolean socketKeepAlive)
EndpointConfig
setSocketKeepCount(int socketKeepCount)
Set the maximum number of TCP keep-alive probes to send before giving up and closing the connection if no response is obtained from the other side.EndpointConfig
setSocketKeepIdleSeconds(int socketKeepIdleSeconds)
Set the number of seconds a connection needs to be idle before TCP begins sending out keep-alive probes.EndpointConfig
setSocketKeepIntervalSeconds(int socketKeepIntervalSeconds)
Set the number of seconds between keep-alive probes.EndpointConfig
setSocketLingerSeconds(int socketLingerSeconds)
EndpointConfig
setSocketRcvBufferSizeKb(int socketRcvBufferSizeKb)
EndpointConfig
setSocketSendBufferSizeKb(int socketSendBufferSizeKb)
EndpointConfig
setSocketTcpNoDelay(boolean socketTcpNoDelay)
EndpointConfig
setSSLConfig(SSLConfig sslConfig)
Sets theSSLConfig
.EndpointConfig
setSymmetricEncryptionConfig(SymmetricEncryptionConfig symmetricEncryptionConfig)
Deprecated.since 4.2EndpointConfig
setTpcSocketConfig(TpcSocketConfig tpcSocketConfig)
Sets the TpcSocketConfig.
-
-
-
Field Detail
-
DEFAULT_SOCKET_CONNECT_TIMEOUT_SECONDS
public static final int DEFAULT_SOCKET_CONNECT_TIMEOUT_SECONDS
SeeSocketOptions.SO_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_SOCKET_SEND_BUFFER_SIZE_KB
public static final int DEFAULT_SOCKET_SEND_BUFFER_SIZE_KB
SeeSocketOptions.SO_SNDBUF
- See Also:
- Constant Field Values
-
DEFAULT_SOCKET_RECEIVE_BUFFER_SIZE_KB
public static final int DEFAULT_SOCKET_RECEIVE_BUFFER_SIZE_KB
SeeSocketOptions.SO_RCVBUF
.- See Also:
- Constant Field Values
-
DEFAULT_SOCKET_LINGER_SECONDS
public static final int DEFAULT_SOCKET_LINGER_SECONDS
SeeSocketOptions.SO_LINGER
- See Also:
- Constant Field Values
-
DEFAULT_SOCKET_KEEP_IDLE_SECONDS
public static final int DEFAULT_SOCKET_KEEP_IDLE_SECONDS
Seejdk.net.ExtendedSocketOptions#TCP_KEEPIDLE
- See Also:
- Constant Field Values
-
DEFAULT_SOCKET_KEEP_INTERVAL_SECONDS
public static final int DEFAULT_SOCKET_KEEP_INTERVAL_SECONDS
Seejdk.net.ExtendedSocketOptions#TCP_KEEPINTERVAL
- See Also:
- Constant Field Values
-
DEFAULT_SOCKET_KEEP_COUNT
public static final int DEFAULT_SOCKET_KEEP_COUNT
Seejdk.net.ExtendedSocketOptions#TCP_KEEPINTERVAL
- See Also:
- Constant Field Values
-
name
protected java.lang.String name
-
protocolType
protected com.hazelcast.instance.ProtocolType protocolType
-
interfaces
protected InterfacesConfig interfaces
-
socketInterceptorConfig
protected SocketInterceptorConfig socketInterceptorConfig
-
sslConfig
protected SSLConfig sslConfig
-
symmetricEncryptionConfig
protected SymmetricEncryptionConfig symmetricEncryptionConfig
-
-
Method Detail
-
getProtocolType
public com.hazelcast.instance.ProtocolType getProtocolType()
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceNamedConfig
-
setName
public EndpointConfig setName(java.lang.String name)
- Specified by:
setName
in interfaceNamedConfig
-
getSymmetricEncryptionConfig
@Deprecated public SymmetricEncryptionConfig getSymmetricEncryptionConfig()
Deprecated.since 4.2Gets theSymmetricEncryptionConfig
. The value can benull
which means that no symmetric encryption should be used.- Returns:
- the SymmetricEncryptionConfig
-
setSymmetricEncryptionConfig
@Deprecated public EndpointConfig setSymmetricEncryptionConfig(SymmetricEncryptionConfig symmetricEncryptionConfig)
Deprecated.since 4.2Sets theSymmetricEncryptionConfig
. The value can benull
if no symmetric encryption should be used.- Parameters:
symmetricEncryptionConfig
- the SymmetricEncryptionConfig to set- Returns:
- the updated NetworkConfig
- See Also:
getSymmetricEncryptionConfig()
-
getQualifier
public com.hazelcast.instance.EndpointQualifier getQualifier()
-
getOutboundPortDefinitions
public java.util.Collection<java.lang.String> getOutboundPortDefinitions()
-
setOutboundPortDefinitions
public EndpointConfig setOutboundPortDefinitions(java.util.Collection<java.lang.String> outboundPortDefs)
-
addOutboundPortDefinition
public EndpointConfig addOutboundPortDefinition(java.lang.String portDef)
-
getOutboundPorts
public java.util.Collection<java.lang.Integer> getOutboundPorts()
-
setOutboundPorts
public EndpointConfig setOutboundPorts(java.util.Collection<java.lang.Integer> outboundPorts)
-
addOutboundPort
public EndpointConfig addOutboundPort(int port)
-
getInterfaces
public InterfacesConfig getInterfaces()
- Returns:
- the interfaces
-
setInterfaces
public EndpointConfig setInterfaces(InterfacesConfig interfaces)
- Parameters:
interfaces
- the interfaces to set
-
isSocketBufferDirect
public boolean isSocketBufferDirect()
-
setSocketBufferDirect
public EndpointConfig setSocketBufferDirect(boolean socketBufferDirect)
-
isSocketTcpNoDelay
public boolean isSocketTcpNoDelay()
-
isSocketKeepAlive
public boolean isSocketKeepAlive()
-
setSocketKeepAlive
public EndpointConfig setSocketKeepAlive(boolean socketKeepAlive)
-
setSocketTcpNoDelay
public EndpointConfig setSocketTcpNoDelay(boolean socketTcpNoDelay)
-
getSocketSendBufferSizeKb
public int getSocketSendBufferSizeKb()
-
setSocketSendBufferSizeKb
public EndpointConfig setSocketSendBufferSizeKb(int socketSendBufferSizeKb)
-
getSocketRcvBufferSizeKb
public int getSocketRcvBufferSizeKb()
-
setSocketRcvBufferSizeKb
public EndpointConfig setSocketRcvBufferSizeKb(int socketRcvBufferSizeKb)
-
getSocketLingerSeconds
public int getSocketLingerSeconds()
-
setSocketLingerSeconds
public EndpointConfig setSocketLingerSeconds(int socketLingerSeconds)
-
getSocketConnectTimeoutSeconds
public int getSocketConnectTimeoutSeconds()
-
setSocketConnectTimeoutSeconds
public EndpointConfig setSocketConnectTimeoutSeconds(int socketConnectTimeoutSeconds)
-
getSocketInterceptorConfig
public SocketInterceptorConfig getSocketInterceptorConfig()
Gets theSocketInterceptorConfig
. The value can benull
if no socket interception is needed.- Returns:
- the SocketInterceptorConfig
- See Also:
setSocketInterceptorConfig(SocketInterceptorConfig)
-
setSocketInterceptorConfig
public EndpointConfig setSocketInterceptorConfig(SocketInterceptorConfig socketInterceptorConfig)
Sets theSocketInterceptorConfig
. The value can benull
if no socket interception is needed.- Parameters:
socketInterceptorConfig
- the SocketInterceptorConfig to set- Returns:
- the updated NetworkConfig
-
getSSLConfig
public SSLConfig getSSLConfig()
Returns the currentSSLConfig
. It is possible that null is returned if no SSLConfig has been set.- Returns:
- the SSLConfig
- See Also:
setSSLConfig(SSLConfig)
-
setSSLConfig
public EndpointConfig setSSLConfig(SSLConfig sslConfig)
Sets theSSLConfig
. null value indicates that no SSLConfig should be used.- Parameters:
sslConfig
- the SSLConfig- Returns:
- the updated NetworkConfig
- See Also:
getSSLConfig()
-
getTpcSocketConfig
@Beta @Nonnull public TpcSocketConfig getTpcSocketConfig()
Gets the TpcSocketConfig. Can't return null.- Returns:
- the TpcSocketConfig.
- Since:
- 5.3
- See Also:
TpcConfig
-
setTpcSocketConfig
@Beta @Nonnull public EndpointConfig setTpcSocketConfig(@Nonnull TpcSocketConfig tpcSocketConfig)
Sets the TpcSocketConfig. Can't return null.- Parameters:
tpcSocketConfig
- Tpc socket config to set- Returns:
- this endpoint config
- Throws:
java.lang.NullPointerException
- if tpcSocketConfig is null- Since:
- 5.3
- See Also:
TpcConfig
-
setProtocolType
@PrivateApi public EndpointConfig setProtocolType(com.hazelcast.instance.ProtocolType protocolType)
-
getSocketKeepIdleSeconds
public int getSocketKeepIdleSeconds()
Keep-Alive idle time: the number of seconds of idle time before keep-alive initiates a probe. This option is only applicable whenkeep alive is true
. Requires a recent JDK 8, JDK 11 or greater version that includes the required JDK support.- Returns:
- the configured value of Keep-Alive idle time.
- Since:
- 5.3.0
- See Also:
- jdk.net.ExtendedSocketOptions#TCP_KEEPIDLE
-
setSocketKeepIdleSeconds
public EndpointConfig setSocketKeepIdleSeconds(int socketKeepIdleSeconds)
Set the number of seconds a connection needs to be idle before TCP begins sending out keep-alive probes. Valid values are 1 to 32767. This option is only applicable whenkeep alive is true
. Requires a recent JDK 8, JDK 11 or greater version that includes the required JDK support.- Since:
- 5.3.0
- See Also:
- jdk.net.ExtendedSocketOptions#TCP_KEEPIDLE
-
getSocketKeepIntervalSeconds
public int getSocketKeepIntervalSeconds()
Keep-Alive interval: the number of seconds between keep-alive probes. This option is only applicable whenkeep alive is true
. Requires a recent JDK 8, JDK 11 or greater version that includes the required JDK support.- Returns:
- the configured value of Keep-Alive interval time.
- Since:
- 5.3.0
- See Also:
- jdk.net.ExtendedSocketOptions#TCP_KEEPINTERVAL
-
setSocketKeepIntervalSeconds
public EndpointConfig setSocketKeepIntervalSeconds(int socketKeepIntervalSeconds)
Set the number of seconds between keep-alive probes. Notice that this is the number of seconds between probes after the initialkeep-alive idle time
has passed. Valid values are 1 to 32767. This option is only applicable whenkeep alive is true
. Requires a recent JDK 8, JDK 11 or greater version that includes the required JDK support.- Since:
- 5.3.0
- See Also:
- jdk.net.ExtendedSocketOptions#TCP_KEEPINTERVAL
-
getSocketKeepCount
public int getSocketKeepCount()
Keep-Alive count: the maximum number of TCP keep-alive probes to send before giving up and closing the connection if no response is obtained from the other side. This option is only applicable whenkeep alive is true
. Requires a recent JDK 8, JDK 11 or greater version that includes the required JDK support.- Returns:
- the configured value of Keep-Alive probe count.
- Since:
- 5.3.0
- See Also:
- jdk.net.ExtendedSocketOptions#TCP_KEEPCOUNT
-
setSocketKeepCount
public EndpointConfig setSocketKeepCount(int socketKeepCount)
Set the maximum number of TCP keep-alive probes to send before giving up and closing the connection if no response is obtained from the other side. Valid values are 1 to 127. This option is only applicable whenkeep alive is true
. Requires a recent JDK 8, JDK 11 or greater version that includes the required JDK support.- Since:
- 5.3.0
- See Also:
- jdk.net.ExtendedSocketOptions#TCP_KEEPCOUNT
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-