Class 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 Detail

      • DEFAULT_SOCKET_CONNECT_TIMEOUT_SECONDS

        public static final int DEFAULT_SOCKET_CONNECT_TIMEOUT_SECONDS
        See SocketOptions.SO_TIMEOUT
        See Also:
        Constant Field Values
      • DEFAULT_SOCKET_SEND_BUFFER_SIZE_KB

        public static final int DEFAULT_SOCKET_SEND_BUFFER_SIZE_KB
        See SocketOptions.SO_SNDBUF
        See Also:
        Constant Field Values
      • DEFAULT_SOCKET_RECEIVE_BUFFER_SIZE_KB

        public static final int DEFAULT_SOCKET_RECEIVE_BUFFER_SIZE_KB
        See SocketOptions.SO_RCVBUF.
        See Also:
        Constant Field Values
      • DEFAULT_SOCKET_LINGER_SECONDS

        public static final int DEFAULT_SOCKET_LINGER_SECONDS
        See SocketOptions.SO_LINGER
        See Also:
        Constant Field Values
      • DEFAULT_SOCKET_KEEP_IDLE_SECONDS

        public static final int DEFAULT_SOCKET_KEEP_IDLE_SECONDS
        See jdk.net.ExtendedSocketOptions#TCP_KEEPIDLE
        See Also:
        Constant Field Values
      • DEFAULT_SOCKET_KEEP_INTERVAL_SECONDS

        public static final int DEFAULT_SOCKET_KEEP_INTERVAL_SECONDS
        See jdk.net.ExtendedSocketOptions#TCP_KEEPINTERVAL
        See Also:
        Constant Field Values
      • DEFAULT_SOCKET_KEEP_COUNT

        public static final int DEFAULT_SOCKET_KEEP_COUNT
        See jdk.net.ExtendedSocketOptions#TCP_KEEPINTERVAL
        See Also:
        Constant Field Values
      • name

        protected java.lang.String name
      • protocolType

        protected com.hazelcast.instance.ProtocolType protocolType
    • Constructor Detail

      • EndpointConfig

        public EndpointConfig()
    • Method Detail

      • getProtocolType

        public com.hazelcast.instance.ProtocolType getProtocolType()
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface NamedConfig
      • getSymmetricEncryptionConfig

        @Deprecated
        public SymmetricEncryptionConfig getSymmetricEncryptionConfig()
        Deprecated.
        since 4.2
        Gets the SymmetricEncryptionConfig. The value can be null which means that no symmetric encryption should be used.
        Returns:
        the SymmetricEncryptionConfig
      • 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
      • 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)
      • setSocketInterceptorConfig

        public EndpointConfig setSocketInterceptorConfig​(SocketInterceptorConfig socketInterceptorConfig)
        Sets the SocketInterceptorConfig. The value can be null if no socket interception is needed.
        Parameters:
        socketInterceptorConfig - the SocketInterceptorConfig to set
        Returns:
        the updated NetworkConfig
      • setSSLConfig

        public EndpointConfig setSSLConfig​(SSLConfig sslConfig)
        Sets the SSLConfig. 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
      • 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 when keep 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 when keep 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 when keep 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
      • 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 when keep 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 when keep 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 class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object