io.vertx.core.net

## Class NetClientOptions

- java.lang.Object
- - io.vertx.core.net.NetworkOptions
  - - io.vertx.core.net.TCPSSLOptions
    - - io.vertx.core.net.ClientOptionsBase
      - - io.vertx.core.net.NetClientOptions

-     public class NetClientOptions
      extends ClientOptionsBase

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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_RECONNECT_ATTEMPTS` The default value for reconnect attempts = 0
    `static long` | `DEFAULT_RECONNECT_INTERVAL` The default value for reconnect interval = 1000 ms

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

      `DEFAULT_CONNECT_TIMEOUT, DEFAULT_TRUST_ALL`

    - ### 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
    `NetClientOptions()` The default constructor
    `NetClientOptions(JsonObject json)` Create options from JSON
    `NetClientOptions(NetClientOptions other)` Copy constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `NetClientOptions` | `addCrlPath(String crlPath)` Add a CRL path
    `NetClientOptions` | `addCrlValue(Buffer crlValue)` Add a CRL value
    `NetClientOptions` | `addEnabledCipherSuite(String suite)` Add an enabled cipher suite
    `boolean` | `equals(Object o)`
    `int` | `getReconnectAttempts()`
    `long` | `getReconnectInterval()`
    `int` | `hashCode()`
    `NetClientOptions` | `setConnectTimeout(int connectTimeout)` Set the connect timeout
    `NetClientOptions` | `setIdleTimeout(int idleTimeout)` Set the idle timeout, in seconds.
    `NetClientOptions` | `setKeyStoreOptions(JksOptions options)` Set the key/cert options in jks format, aka Java keystore.
    `NetClientOptions` | `setPemKeyCertOptions(PemKeyCertOptions options)` Set the key/cert store options in pem format.
    `NetClientOptions` | `setPemTrustOptions(PemTrustOptions options)` Set the trust options in pem format
    `NetClientOptions` | `setPfxKeyCertOptions(PfxOptions options)` Set the key/cert options in pfx format.
    `NetClientOptions` | `setPfxTrustOptions(PfxOptions options)` Set the trust options in pfx format
    `NetClientOptions` | `setReceiveBufferSize(int receiveBufferSize)` Set the TCP receive buffer size
    `NetClientOptions` | `setReconnectAttempts(int attempts)` Set the value of reconnect attempts
    `NetClientOptions` | `setReconnectInterval(long interval)` Set the reconnect interval
    `NetClientOptions` | `setReuseAddress(boolean reuseAddress)` Set the value of reuse address
    `NetClientOptions` | `setSendBufferSize(int sendBufferSize)` Set the TCP send buffer size
    `NetClientOptions` | `setSoLinger(int soLinger)` Set whether SO_linger keep alive is enabled
    `NetClientOptions` | `setSsl(boolean ssl)` Set whether SSL/TLS is enabled
    `NetClientOptions` | `setTcpKeepAlive(boolean tcpKeepAlive)` Set whether TCP keep alive is enabled
    `NetClientOptions` | `setTcpNoDelay(boolean tcpNoDelay)` Set whether TCP no delay is enabled
    `NetClientOptions` | `setTrafficClass(int trafficClass)` Set the value of traffic class
    `NetClientOptions` | `setTrustAll(boolean trustAll)` Set whether all server certificates should be trusted
    `NetClientOptions` | `setTrustStoreOptions(JksOptions options)` Set the trust options in jks format, aka Java trustore
    `NetClientOptions` | `setUsePooledBuffers(boolean usePooledBuffers)` Set whether Netty pooled buffers are enabled

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

      `getConnectTimeout, isTrustAll`

    - ### 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_RECONNECT_ATTEMPTS

          public static final int DEFAULT_RECONNECT_ATTEMPTS

      The default value for reconnect attempts = 0
      See Also:
        Constant Field Values

    - #### DEFAULT_RECONNECT_INTERVAL

          public static final long DEFAULT_RECONNECT_INTERVAL

      The default value for reconnect interval = 1000 ms
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### NetClientOptions

          public NetClientOptions()

      The default constructor

    - #### NetClientOptions

          public NetClientOptions(NetClientOptions other)

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

    - #### NetClientOptions

          public NetClientOptions(JsonObject json)

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

  - ### Method Detail

    - #### setSendBufferSize

          public NetClientOptions 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 NetClientOptions 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 NetClientOptions 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 NetClientOptions 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 NetClientOptions 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 NetClientOptions 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 NetClientOptions 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 NetClientOptions 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 NetClientOptions 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 NetClientOptions 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 NetClientOptions 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 NetClientOptions 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 NetClientOptions 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 NetClientOptions 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

    - #### setPemTrustOptions

          public NetClientOptions 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

    - #### setPfxTrustOptions

          public NetClientOptions 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

    - #### addEnabledCipherSuite

          public NetClientOptions 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 NetClientOptions 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 NetClientOptions 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`

    - #### setTrustAll

          public NetClientOptions setTrustAll(boolean trustAll)

      Description copied from class: `ClientOptionsBase`
      Set whether all server certificates should be trusted
      Overrides:
        `setTrustAll` in class `ClientOptionsBase`
      Parameters:
        `trustAll` - true if all should be trusted
      Returns:
        a reference to this, so the API can be used fluently

    - #### setConnectTimeout

          public NetClientOptions setConnectTimeout(int connectTimeout)

      Description copied from class: `ClientOptionsBase`
      Set the connect timeout
      Overrides:
        `setConnectTimeout` in class `ClientOptionsBase`
      Parameters:
        `connectTimeout` - connect timeout, in ms
      Returns:
        a reference to this, so the API can be used fluently

    - #### setReconnectAttempts

          public NetClientOptions setReconnectAttempts(int attempts)

      Set the value of reconnect attempts
      Parameters:
        `attempts` - the maximum number of reconnect attempts
      Returns:
        a reference to this, so the API can be used fluently

    - #### getReconnectAttempts

          public int getReconnectAttempts()

      Returns:
        the value of reconnect attempts

    - #### setReconnectInterval

          public NetClientOptions setReconnectInterval(long interval)

      Set the reconnect interval
      Parameters:
        `interval` - the reconnect interval in ms
      Returns:
        a reference to this, so the API can be used fluently

    - #### getReconnectInterval

          public long getReconnectInterval()

      Returns:
        the value of reconnect interval

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `ClientOptionsBase`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `ClientOptionsBase`

Copyright © 2015. All Rights Reserved.