io.vertx.core.net

## Class NetServerOptions

- java.lang.Object
- - io.vertx.core.net.NetworkOptions
  - - io.vertx.core.net.TCPSSLOptions
    - - io.vertx.core.net.NetServerOptions

- Direct Known Subclasses:
    HttpServerOptions, StompServerOptions, TelnetOptions

      public class NetServerOptions
      extends TCPSSLOptions

  Options for configuring a `NetServer`.
  Author:
    Tim Fox

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_ACCEPT_BACKLOG` The default accept backlog = 1024
    `static ClientAuth` | `DEFAULT_CLIENT_AUTH` Default value of whether client auth is required (SSL/TLS) = No
    `static String` | `DEFAULT_HOST` The default host to listen on = "0.0.0.0" (meaning listen on all available interfaces).
    `static int` | `DEFAULT_PORT` The default port to listen on = 0 (meaning a random ephemeral free port will be chosen)

    - ### Fields inherited from class io.vertx.core.net.TCPSSLOptions

      `DEFAULT_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_USE_POOLED_BUFFERS`

    - ### Fields inherited from class io.vertx.core.net.NetworkOptions

      `DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_ADDRESS, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetServerOptions()` Default constructor
    `NetServerOptions(JsonObject json)` Create some options from JSON
    `NetServerOptions(NetServerOptions other)` Copy constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `NetServerOptions` | `addCrlPath(String crlPath)` Add a CRL path
    `NetServerOptions` | `addCrlValue(Buffer crlValue)` Add a CRL value
    `NetServerOptions` | `addEnabledCipherSuite(String suite)` Add an enabled cipher suite
    `boolean` | `equals(Object o)`
    `int` | `getAcceptBacklog()`
    `ClientAuth` | `getClientAuth()`
    `String` | `getHost()`
    `int` | `getPort()`
    `int` | `hashCode()`
    `boolean` | `isClientAuthRequired()` Deprecated.
    `NetServerOptions` | `setAcceptBacklog(int acceptBacklog)` Set the accept back log
    `NetServerOptions` | `setClientAuth(ClientAuth clientAuth)` Set whether client auth is required
    `NetServerOptions` | `setClientAuthRequired(boolean clientAuthRequired)` Deprecated.
    `NetServerOptions` | `setHost(String host)` Set the host
    `NetServerOptions` | `setIdleTimeout(int idleTimeout)` Set the idle timeout, in seconds.
    `NetServerOptions` | `setKeyStoreOptions(JksOptions options)` Set the key/cert options in jks format, aka Java keystore.
    `NetServerOptions` | `setPemKeyCertOptions(PemKeyCertOptions options)` Set the key/cert store options in pem format.
    `NetServerOptions` | `setPemTrustOptions(PemTrustOptions options)` Set the trust options in pem format
    `NetServerOptions` | `setPfxKeyCertOptions(PfxOptions options)` Set the key/cert options in pfx format.
    `NetServerOptions` | `setPfxTrustOptions(PfxOptions options)` Set the trust options in pfx format
    `NetServerOptions` | `setPort(int port)` Set the port
    `NetServerOptions` | `setReceiveBufferSize(int receiveBufferSize)` Set the TCP receive buffer size
    `NetServerOptions` | `setReuseAddress(boolean reuseAddress)` Set the value of reuse address
    `NetServerOptions` | `setSendBufferSize(int sendBufferSize)` Set the TCP send buffer size
    `NetServerOptions` | `setSoLinger(int soLinger)` Set whether SO_linger keep alive is enabled
    `NetServerOptions` | `setSsl(boolean ssl)` Set whether SSL/TLS is enabled
    `NetServerOptions` | `setTcpKeepAlive(boolean tcpKeepAlive)` Set whether TCP keep alive is enabled
    `NetServerOptions` | `setTcpNoDelay(boolean tcpNoDelay)` Set whether TCP no delay is enabled
    `NetServerOptions` | `setTrafficClass(int trafficClass)` Set the value of traffic class
    `NetServerOptions` | `setTrustStoreOptions(JksOptions options)` Set the trust options in jks format, aka Java trustore
    `NetServerOptions` | `setUsePooledBuffers(boolean usePooledBuffers)` Set whether Netty pooled buffers are enabled

    - ### Methods inherited from class io.vertx.core.net.TCPSSLOptions

      `getCrlPaths, getCrlValues, getEnabledCipherSuites, getIdleTimeout, getKeyCertOptions, getSoLinger, getTrustOptions, isSsl, isTcpKeepAlive, isTcpNoDelay, isUsePooledBuffers`

    - ### Methods inherited from class io.vertx.core.net.NetworkOptions

      `getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress`

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

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_PORT

          public static final int DEFAULT_PORT

      The default port to listen on = 0 (meaning a random ephemeral free port will be chosen)
      See Also:
        Constant Field Values

    - #### DEFAULT_HOST

          public static final String DEFAULT_HOST

      The default host to listen on = "0.0.0.0" (meaning listen on all available interfaces).
      See Also:
        Constant Field Values

    - #### DEFAULT_ACCEPT_BACKLOG

          public static final int DEFAULT_ACCEPT_BACKLOG

      The default accept backlog = 1024
      See Also:
        Constant Field Values

    - #### DEFAULT_CLIENT_AUTH

          public static final ClientAuth DEFAULT_CLIENT_AUTH

      Default value of whether client auth is required (SSL/TLS) = No

  - ### Constructor Detail

    - #### NetServerOptions

          public NetServerOptions()

      Default constructor

    - #### NetServerOptions

          public NetServerOptions(NetServerOptions other)

      Copy constructor
      Parameters:
        `other` - the options to copy

    - #### NetServerOptions

          public NetServerOptions(JsonObject json)

      Create some options from JSON
      Parameters:
        `json` - the JSON

  - ### Method Detail

    - #### setSendBufferSize

          public NetServerOptions setSendBufferSize(int sendBufferSize)

      Description copied from class: `NetworkOptions`
      Set the TCP send buffer size
      Overrides:
        `setSendBufferSize` in class `NetworkOptions`
      Parameters:
        `sendBufferSize` - the buffers size, in bytes
      Returns:
        a reference to this, so the API can be used fluently

    - #### setReceiveBufferSize

          public NetServerOptions setReceiveBufferSize(int receiveBufferSize)

      Description copied from class: `NetworkOptions`
      Set the TCP receive buffer size
      Overrides:
        `setReceiveBufferSize` in class `NetworkOptions`
      Parameters:
        `receiveBufferSize` - the buffers size, in bytes
      Returns:
        a reference to this, so the API can be used fluently

    - #### setReuseAddress

          public NetServerOptions setReuseAddress(boolean reuseAddress)

      Description copied from class: `NetworkOptions`
      Set the value of reuse address
      Overrides:
        `setReuseAddress` in class `NetworkOptions`
      Parameters:
        `reuseAddress` - the value of reuse address
      Returns:
        a reference to this, so the API can be used fluently

    - #### setTrafficClass

          public NetServerOptions setTrafficClass(int trafficClass)

      Description copied from class: `NetworkOptions`
      Set the value of traffic class
      Overrides:
        `setTrafficClass` in class `NetworkOptions`
      Parameters:
        `trafficClass` - the value of traffic class
      Returns:
        a reference to this, so the API can be used fluently

    - #### setTcpNoDelay

          public NetServerOptions setTcpNoDelay(boolean tcpNoDelay)

      Description copied from class: `TCPSSLOptions`
      Set whether TCP no delay is enabled
      Overrides:
        `setTcpNoDelay` in class `TCPSSLOptions`
      Parameters:
        `tcpNoDelay` - true if TCP no delay is enabled (Nagle disabled)
      Returns:
        a reference to this, so the API can be used fluently

    - #### setTcpKeepAlive

          public NetServerOptions setTcpKeepAlive(boolean tcpKeepAlive)

      Description copied from class: `TCPSSLOptions`
      Set whether TCP keep alive is enabled
      Overrides:
        `setTcpKeepAlive` in class `TCPSSLOptions`
      Parameters:
        `tcpKeepAlive` - true if TCP keep alive is enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### setSoLinger

          public NetServerOptions setSoLinger(int soLinger)

      Description copied from class: `TCPSSLOptions`
      Set whether SO_linger keep alive is enabled
      Overrides:
        `setSoLinger` in class `TCPSSLOptions`
      Parameters:
        `soLinger` - true if SO_linger is enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### setUsePooledBuffers

          public NetServerOptions setUsePooledBuffers(boolean usePooledBuffers)

      Description copied from class: `TCPSSLOptions`
      Set whether Netty pooled buffers are enabled
      Overrides:
        `setUsePooledBuffers` in class `TCPSSLOptions`
      Parameters:
        `usePooledBuffers` - true if pooled buffers enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### setIdleTimeout

          public NetServerOptions setIdleTimeout(int idleTimeout)

      Description copied from class: `TCPSSLOptions`
      Set the idle timeout, in seconds. zero means don't timeout. This determines if a connection will timeout and be closed if no data is received within the timeout.
      Overrides:
        `setIdleTimeout` in class `TCPSSLOptions`
      Parameters:
        `idleTimeout` - the timeout, in seconds
      Returns:
        a reference to this, so the API can be used fluently

    - #### setSsl

          public NetServerOptions setSsl(boolean ssl)

      Description copied from class: `TCPSSLOptions`
      Set whether SSL/TLS is enabled
      Overrides:
        `setSsl` in class `TCPSSLOptions`
      Parameters:
        `ssl` - true if enabled
      Returns:
        a reference to this, so the API can be used fluently

    - #### setKeyStoreOptions

          public NetServerOptions setKeyStoreOptions(JksOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the key/cert options in jks format, aka Java keystore.
      Overrides:
        `setKeyStoreOptions` in class `TCPSSLOptions`
      Parameters:
        `options` - the key store in jks format
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPfxKeyCertOptions

          public NetServerOptions setPfxKeyCertOptions(PfxOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the key/cert options in pfx format.
      Overrides:
        `setPfxKeyCertOptions` in class `TCPSSLOptions`
      Parameters:
        `options` - the key cert options in pfx format
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPemKeyCertOptions

          public NetServerOptions setPemKeyCertOptions(PemKeyCertOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the key/cert store options in pem format.
      Overrides:
        `setPemKeyCertOptions` in class `TCPSSLOptions`
      Parameters:
        `options` - the options in pem format
      Returns:
        a reference to this, so the API can be used fluently

    - #### setTrustStoreOptions

          public NetServerOptions setTrustStoreOptions(JksOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the trust options in jks format, aka Java trustore
      Overrides:
        `setTrustStoreOptions` in class `TCPSSLOptions`
      Parameters:
        `options` - the options in jks format
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPfxTrustOptions

          public NetServerOptions setPfxTrustOptions(PfxOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the trust options in pfx format
      Overrides:
        `setPfxTrustOptions` in class `TCPSSLOptions`
      Parameters:
        `options` - the options in pfx format
      Returns:
        a reference to this, so the API can be used fluently

    - #### setPemTrustOptions

          public NetServerOptions setPemTrustOptions(PemTrustOptions options)

      Description copied from class: `TCPSSLOptions`
      Set the trust options in pem format
      Overrides:
        `setPemTrustOptions` in class `TCPSSLOptions`
      Parameters:
        `options` - the options in pem format
      Returns:
        a reference to this, so the API can be used fluently

    - #### addEnabledCipherSuite

          public NetServerOptions addEnabledCipherSuite(String suite)

      Description copied from class: `TCPSSLOptions`
      Add an enabled cipher suite
      Overrides:
        `addEnabledCipherSuite` in class `TCPSSLOptions`
      Parameters:
        `suite` - the suite
      Returns:
        a reference to this, so the API can be used fluently

    - #### addCrlPath

          public NetServerOptions addCrlPath(String crlPath)
                                      throws NullPointerException

      Description copied from class: `TCPSSLOptions`
      Add a CRL path
      Overrides:
        `addCrlPath` in class `TCPSSLOptions`
      Parameters:
        `crlPath` - the path
      Returns:
        a reference to this, so the API can be used fluently
      Throws:
        `NullPointerException`

    - #### addCrlValue

          public NetServerOptions addCrlValue(Buffer crlValue)
                                       throws NullPointerException

      Description copied from class: `TCPSSLOptions`
      Add a CRL value
      Overrides:
        `addCrlValue` in class `TCPSSLOptions`
      Parameters:
        `crlValue` - the value
      Returns:
        a reference to this, so the API can be used fluently
      Throws:
        `NullPointerException`

    - #### getAcceptBacklog

          public int getAcceptBacklog()

      Returns:
        the value of accept backlog

    - #### setAcceptBacklog

          public NetServerOptions setAcceptBacklog(int acceptBacklog)

      Set the accept back log
      Parameters:
        `acceptBacklog` - accept backlog
      Returns:
        a reference to this, so the API can be used fluently

    - #### getPort

          public int getPort()

      Returns:
        the port

    - #### setPort

          public NetServerOptions setPort(int port)

      Set the port
      Parameters:
        `port` - the port
      Returns:
        a reference to this, so the API can be used fluently

    - #### getHost

          public String getHost()

      Returns:
        the host

    - #### setHost

          public NetServerOptions setHost(String host)

      Set the host
      Parameters:
        `host` - the host
      Returns:
        a reference to this, so the API can be used fluently

    - #### isClientAuthRequired

          @Deprecated
          public boolean isClientAuthRequired()

      Deprecated.
      Returns:
        true if client auth is required

    - #### setClientAuthRequired

          @Deprecated
          public NetServerOptions setClientAuthRequired(boolean clientAuthRequired)

      Deprecated.
      Set whether client auth is required
      Parameters:
        `clientAuthRequired` - true if client auth is required
      Returns:
        a reference to this, so the API can be used fluently

    - #### getClientAuth

          public ClientAuth getClientAuth()

    - #### setClientAuth

          public NetServerOptions setClientAuth(ClientAuth clientAuth)

      Set whether client auth is required
      Parameters:
        `clientAuth` - One of "NONE, REQUEST, REQUIRED". If it's set to "REQUIRED" then server will require the SSL cert to be presented otherwise it won't accept the request. If it's set to "REQUEST" then it won't mandate the certificate to be presented, basically make it optional.
      Returns:
        a reference to this, so the API can be used fluently

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `TCPSSLOptions`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `TCPSSLOptions`

Copyright © 2015. All rights reserved.