com.hazelcast.config

## Class ServerSocketEndpointConfig

- java.lang.Object
- - com.hazelcast.config.EndpointConfig
  - - com.hazelcast.config.ServerSocketEndpointConfig

- All Implemented Interfaces:
    NamedConfig
  Direct Known Subclasses:
    RestServerEndpointConfig

      public class ServerSocketEndpointConfig
      extends EndpointConfig

  Endpoint configuration that defines a listening side (server)
  Since:
    3.12

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_PORT` Default value of port number.
    `static int` | `PORT_AUTO_INCREMENT` Default port auto-increment count.

    - ### Fields inherited from class com.hazelcast.config.EndpointConfig

      `DEFAULT_SOCKET_CONNECT_TIMEOUT_SECONDS, DEFAULT_SOCKET_LINGER_SECONDS, DEFAULT_SOCKET_RECEIVE_BUFFER_SIZE_KB, DEFAULT_SOCKET_SEND_BUFFER_SIZE_KB, interfaces, name, protocolType, socketInterceptorConfig, sslConfig, symmetricEncryptionConfig`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServerSocketEndpointConfig()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getPort()` Returns the port the Hazelcast member will try to bind on.
    `int` | `getPortCount()` Returns the maximum number of ports allowed to try to bind on.
    `String` | `getPublicAddress()`
    `boolean` | `isPortAutoIncrement()` Checks if a Hazelcast member is allowed find a free port by incrementing the port number when it encounters an occupied port.
    `boolean` | `isReuseAddress()`
    `ServerSocketEndpointConfig` | `setInterfaces(InterfacesConfig interfaces)`
    `ServerSocketEndpointConfig` | `setName(String name)`
    `ServerSocketEndpointConfig` | `setOutboundPortDefinitions(Collection<String> outboundPortDefs)`
    `ServerSocketEndpointConfig` | `setOutboundPorts(Collection<Integer> outboundPorts)`
    `ServerSocketEndpointConfig` | `setPort(int port)` Sets the port the Hazelcast member will try to bind on.
    `ServerSocketEndpointConfig` | `setPortAutoIncrement(boolean portAutoIncrement)` Sets if a Hazelcast member is allowed to find a free port by incrementing the port number when it encounters an occupied port.
    `void` | `setPortCount(int portCount)` The maximum number of ports allowed to use.
    `ServerSocketEndpointConfig` | `setPublicAddress(String publicAddress)` Overrides the public address of a member.
    `ServerSocketEndpointConfig` | `setReuseAddress(boolean reuseAddress)` Sets the reuse address.
    `ServerSocketEndpointConfig` | `setSocketBufferDirect(boolean socketBufferDirect)`
    `ServerSocketEndpointConfig` | `setSocketConnectTimeoutSeconds(int socketConnectTimeoutSeconds)`
    `ServerSocketEndpointConfig` | `setSocketInterceptorConfig(SocketInterceptorConfig socketInterceptorConfig)` Sets the `SocketInterceptorConfig`.
    `ServerSocketEndpointConfig` | `setSocketKeepAlive(boolean socketKeepAlive)`
    `EndpointConfig` | `setSocketLingerSeconds(int socketLingerSeconds)`
    `ServerSocketEndpointConfig` | `setSocketRcvBufferSizeKb(int socketRcvBufferSizeKb)`
    `ServerSocketEndpointConfig` | `setSocketSendBufferSizeKb(int socketSendBufferSizeKb)`
    `ServerSocketEndpointConfig` | `setSocketTcpNoDelay(boolean socketTcpNoDelay)`
    `ServerSocketEndpointConfig` | `setSSLConfig(SSLConfig sslConfig)` Sets the `SSLConfig`.
    `ServerSocketEndpointConfig` | `setSymmetricEncryptionConfig(SymmetricEncryptionConfig symmetricEncryptionConfig)` Sets the `SymmetricEncryptionConfig`.
    `String` | `toString()`

    - ### Methods inherited from class com.hazelcast.config.EndpointConfig

      `addOutboundPort, addOutboundPortDefinition, getInterfaces, getName, getOutboundPortDefinitions, getOutboundPorts, getProtocolType, getQualifier, getSocketConnectTimeoutSeconds, getSocketInterceptorConfig, getSocketLingerSeconds, getSocketRcvBufferSizeKb, getSocketSendBufferSizeKb, getSSLConfig, getSymmetricEncryptionConfig, isSocketBufferDirect, isSocketKeepAlive, isSocketTcpNoDelay`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_PORT

          public static final int DEFAULT_PORT

      Default value of port number.
      See Also:
        Constant Field Values

    - #### PORT_AUTO_INCREMENT

          public static final int PORT_AUTO_INCREMENT

      Default port auto-increment count.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ServerSocketEndpointConfig

          public ServerSocketEndpointConfig()

  - ### Method Detail

    - #### getPublicAddress

          public String getPublicAddress()

    - #### setPublicAddress

          public ServerSocketEndpointConfig setPublicAddress(String publicAddress)

      Overrides the public address of a member. Behind a NAT, two endpoints may not be able to see/access each other. If both nodes set their public addresses to their defined addresses on NAT, then that way they can communicate with each other. It should be set in the format “host IP address:port number”.

    - #### getPort

          public int getPort()

      Returns the port the Hazelcast member will try to bind on. A port number of 0 will let the system pick up an ephemeral port.
      Returns:
        the port the Hazelcast member will try to bind on
      See Also:
        `setPort(int)`

    - #### setPort

          public ServerSocketEndpointConfig setPort(int port)

      Sets the port the Hazelcast member will try to bind on. A valid port value is between 0 and 65535. A port number of 0 will let the system pick up an ephemeral port.
      Parameters:
        `port` - the port the Hazelcast member will try to bind on
      Returns:
        NetworkConfig the updated NetworkConfig
      See Also:
        `getPort()`, `for more information`

    - #### getPortCount

          public int getPortCount()

      Returns the maximum number of ports allowed to try to bind on.
      Returns:
        the maximum number of ports allowed to try to bind on
      See Also:
        `setPortCount(int)`, `for more information`

    - #### setPortCount

          public void setPortCount(int portCount)

      The maximum number of ports allowed to use.
      Parameters:
        `portCount` - the maximum number of ports allowed to use
      See Also:
        `for more information`

    - #### isPortAutoIncrement

          public boolean isPortAutoIncrement()

      Checks if a Hazelcast member is allowed find a free port by incrementing the port number when it encounters an occupied port.
      Returns:
        the portAutoIncrement
      See Also:
        `setPortAutoIncrement(boolean)`

    - #### setPortAutoIncrement

          public ServerSocketEndpointConfig setPortAutoIncrement(boolean portAutoIncrement)

      Sets if a Hazelcast member is allowed to find a free port by incrementing the port number when it encounters an occupied port.

      If you explicitly want to control the port a Hazelcast member is going to use, you probably want to set portAutoincrement to false. In this case, the Hazelcast member is going to try the port `setPort(int)` and if the port is not free, the member will not start and throw an exception.

      If this value is set to true, Hazelcast will start at the port specified by `setPort(int)` and will try until it finds a free port, or until it runs out of ports to try `setPortCount(int)`.

      Parameters:
        `portAutoIncrement` - the portAutoIncrement to set
      Returns:
        the updated NetworkConfig
      See Also:
        `isPortAutoIncrement()`, `setPortCount(int)`, `setPort(int)`

    - #### isReuseAddress

          public boolean isReuseAddress()

    - #### setReuseAddress

          public ServerSocketEndpointConfig setReuseAddress(boolean reuseAddress)

      Sets the reuse address.

      When should setReuseAddress(true) be used?

      When the member is shutdown, the server socket port will be in TIME_WAIT state for the next 2 minutes or so. If you start the member right after shutting it down, you may not be able to bind to the same port because it is in TIME_WAIT state. if you set reuseAddress=true then TIME_WAIT will be ignored and you will be able to bind to the same port again.

      This property should not be set to true on the Windows platform: see

      1. http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6421091
      2. http://www.hsc.fr/ressources/articles/win_net_srv/multiple_bindings.html
      By default, if the OS is Windows then reuseAddress will be false.

    - #### setName

          public ServerSocketEndpointConfig setName(String name)

      Specified by:
        `setName` in interface `NamedConfig`
      Overrides:
        `setName` in class `EndpointConfig`

    - #### setOutboundPortDefinitions

          public ServerSocketEndpointConfig setOutboundPortDefinitions(Collection<String> outboundPortDefs)

      Overrides:
        `setOutboundPortDefinitions` in class `EndpointConfig`

    - #### setOutboundPorts

          public ServerSocketEndpointConfig setOutboundPorts(Collection<Integer> outboundPorts)

      Overrides:
        `setOutboundPorts` in class `EndpointConfig`

    - #### setInterfaces

          public ServerSocketEndpointConfig setInterfaces(InterfacesConfig interfaces)

      Overrides:
        `setInterfaces` in class `EndpointConfig`
      Parameters:
        `interfaces` - the interfaces to set

    - #### setSocketBufferDirect

          public ServerSocketEndpointConfig setSocketBufferDirect(boolean socketBufferDirect)

      Overrides:
        `setSocketBufferDirect` in class `EndpointConfig`

    - #### setSocketKeepAlive

          public ServerSocketEndpointConfig setSocketKeepAlive(boolean socketKeepAlive)

      Overrides:
        `setSocketKeepAlive` in class `EndpointConfig`

    - #### setSocketTcpNoDelay

          public ServerSocketEndpointConfig setSocketTcpNoDelay(boolean socketTcpNoDelay)

      Overrides:
        `setSocketTcpNoDelay` in class `EndpointConfig`

    - #### setSocketSendBufferSizeKb

          public ServerSocketEndpointConfig setSocketSendBufferSizeKb(int socketSendBufferSizeKb)

      Overrides:
        `setSocketSendBufferSizeKb` in class `EndpointConfig`

    - #### setSocketRcvBufferSizeKb

          public ServerSocketEndpointConfig setSocketRcvBufferSizeKb(int socketRcvBufferSizeKb)

      Overrides:
        `setSocketRcvBufferSizeKb` in class `EndpointConfig`

    - #### setSocketLingerSeconds

          public EndpointConfig setSocketLingerSeconds(int socketLingerSeconds)

      Overrides:
        `setSocketLingerSeconds` in class `EndpointConfig`

    - #### setSocketConnectTimeoutSeconds

          public ServerSocketEndpointConfig setSocketConnectTimeoutSeconds(int socketConnectTimeoutSeconds)

      Overrides:
        `setSocketConnectTimeoutSeconds` in class `EndpointConfig`

    - #### setSocketInterceptorConfig

          public ServerSocketEndpointConfig setSocketInterceptorConfig(SocketInterceptorConfig socketInterceptorConfig)

      Description copied from class: `EndpointConfig`
      Sets the `SocketInterceptorConfig`. The value can be `null` if no socket interception is needed.
      Overrides:
        `setSocketInterceptorConfig` in class `EndpointConfig`
      Parameters:
        `socketInterceptorConfig` - the SocketInterceptorConfig to set
      Returns:
        the updated NetworkConfig

    - #### setSSLConfig

          public ServerSocketEndpointConfig setSSLConfig(SSLConfig sslConfig)

      Description copied from class: `EndpointConfig`
      Sets the `SSLConfig`. null value indicates that no SSLConfig should be used.
      Overrides:
        `setSSLConfig` in class `EndpointConfig`
      Parameters:
        `sslConfig` - the SSLConfig
      Returns:
        the updated NetworkConfig
      See Also:
        `EndpointConfig.getSSLConfig()`

    - #### setSymmetricEncryptionConfig

          public ServerSocketEndpointConfig setSymmetricEncryptionConfig(SymmetricEncryptionConfig symmetricEncryptionConfig)

      Description copied from class: `EndpointConfig`
      Sets the `SymmetricEncryptionConfig`. The value can be `null` if no symmetric encryption should be used.
      Overrides:
        `setSymmetricEncryptionConfig` in class `EndpointConfig`
      Parameters:
        `symmetricEncryptionConfig` - the SymmetricEncryptionConfig to set
      Returns:
        the updated NetworkConfig
      See Also:
        `EndpointConfig.getSymmetricEncryptionConfig()`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2019. All rights reserved.