io.vertx.ext.consul

## Class ConsulClientOptions

- java.lang.Object
- - io.vertx.ext.consul.ConsulClientOptions

-     public class ConsulClientOptions
      extends Object

  Options used to create Consul client.
  Author:
    Ruslan Sennov

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConsulClientOptions()` Default constructor
    `ConsulClientOptions(ConsulClientOptions options)` Copy constructor
    `ConsulClientOptions(JsonObject options)` Constructor from JSON

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getAclToken()` Get the ACL token.
    `String` | `getDc()` Get the datacenter name
    `String` | `getHost()` Get Consul host.
    `PemTrustOptions` | `getPemTrustOptions()` Get the trust options.
    `int` | `getPort()` Get Consul HTTP API port.
    `long` | `getTimeoutMs()` Get timeout in milliseconds
    `boolean` | `isSsl()` Return true if SSL/TLS enabled
    `boolean` | `isTrustAll()` Return true if all server certificates should be trusted
    `ConsulClientOptions` | `setAclToken(String aclToken)` Set the ACL token.
    `ConsulClientOptions` | `setDc(String dc)` Set the datacenter name.
    `ConsulClientOptions` | `setHost(String host)` Set Consul host.
    `ConsulClientOptions` | `setPemTrustOptions(PemTrustOptions pemTrustOptions)` Set the trust options.
    `ConsulClientOptions` | `setPort(int port)` Set Consul HTTP API port.
    `ConsulClientOptions` | `setSsl(boolean ssl)` Set whether SSL/TLS is enabled
    `ConsulClientOptions` | `setTimeoutMs(long timeoutMs)` Sets the amount of time (in milliseconds) after which if the request does not return any data within the timeout period an failure will be passed to the handler and the request will be closed.
    `ConsulClientOptions` | `setTrustAll(boolean trustAll)` Set whether all server certificates should be trusted
    `JsonObject` | `toJson()` Convert to JSON

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

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

- - ### Constructor Detail

    - #### ConsulClientOptions

          public ConsulClientOptions()

      Default constructor

    - #### ConsulClientOptions

          public ConsulClientOptions(ConsulClientOptions options)

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

    - #### ConsulClientOptions

          public ConsulClientOptions(JsonObject options)

      Constructor from JSON
      Parameters:
        `options` - the JSON

  - ### Method Detail

    - #### toJson

          public JsonObject toJson()

      Convert to JSON
      Returns:
        the JSON

    - #### getHost

          public String getHost()

      Get Consul host.
      Returns:
        consul host

    - #### getPort

          public int getPort()

      Get Consul HTTP API port.
      Returns:
        consul port

    - #### getAclToken

          public String getAclToken()

      Get the ACL token.
      Returns:
        the ACL token.

    - #### getDc

          public String getDc()

      Get the datacenter name
      Returns:
        the datacenter name

    - #### getTimeoutMs

          public long getTimeoutMs()

      Get timeout in milliseconds
      Returns:
        timeout in milliseconds

    - #### isSsl

          public boolean isSsl()

      Return true if SSL/TLS enabled
      Returns:
        true if SSL/TLS enabled

    - #### isTrustAll

          public boolean isTrustAll()

      Return true if all server certificates should be trusted
      Returns:
        true if all server certificates should be trusted

    - #### getPemTrustOptions

          public PemTrustOptions getPemTrustOptions()

      Get the trust options.
      Returns:
        the trust options.

    - #### setHost

          public ConsulClientOptions setHost(String host)

      Set Consul host. Defaults to `localhost`
      Parameters:
        `host` - consul host
      Returns:
        reference to this, for fluency

    - #### setPort

          public ConsulClientOptions setPort(int port)

      Set Consul HTTP API port. Defaults to `8500`
      Parameters:
        `port` - Consul HTTP API port
      Returns:
        reference to this, for fluency

    - #### setAclToken

          public ConsulClientOptions setAclToken(String aclToken)

      Set the ACL token. When provided, the client will use this token when making requests to the Consul by providing the "?token" query parameter. When not provided, the empty token, which maps to the 'anonymous' ACL policy, is used.
      Parameters:
        `aclToken` - the ACL token
      Returns:
        reference to this, for fluency

    - #### setDc

          public ConsulClientOptions setDc(String dc)

      Set the datacenter name. When provided, the client will use it when making requests to the Consul by providing the "?dc" query parameter. When not provided, the datacenter of the consul agent is queried.
      Parameters:
        `dc` - the datacenter name
      Returns:
        reference to this, for fluency

    - #### setTimeoutMs

          public ConsulClientOptions setTimeoutMs(long timeoutMs)

      Sets the amount of time (in milliseconds) after which if the request does not return any data within the timeout period an failure will be passed to the handler and the request will be closed.
      Parameters:
        `timeoutMs` - timeout in milliseconds
      Returns:
        reference to this, for fluency

    - #### setSsl

          public ConsulClientOptions setSsl(boolean ssl)

      Set whether SSL/TLS is enabled
      Parameters:
        `ssl` - true if enabled
      Returns:
        reference to this, for fluency

    - #### setTrustAll

          public ConsulClientOptions setTrustAll(boolean trustAll)

      Set whether all server certificates should be trusted
      Parameters:
        `trustAll` - true if all should be trusted
      Returns:
        reference to this, for fluency

    - #### setPemTrustOptions

          public ConsulClientOptions setPemTrustOptions(PemTrustOptions pemTrustOptions)

      Set the trust options.
      Parameters:
        `pemTrustOptions` - the trust options
      Returns:
        reference to this, for fluency

Copyright © 2017. All rights reserved.