io.vertx.redis

## Class RedisOptions

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

-     public class RedisOptions
      extends NetClientOptions

  This object controls the connection setting to the Redis Server. There is no need to specify most of the settings since it has built the following sensible defaults:

  * `encoding`: `UTF-8` * `host`: `localhost` * `port`: 6379 * `tcpKeepAlive`: true * `tcpNoDelay`: true * `binary`: false

  However there are two extra properties that have no defaults since they are optional:

  * `auth` * `select`

  The usage of this two extra properties is to setup required authentication and optionally the selection of the active database at connection time. If you define this extra properties on every connection to Redis server this client will perform the authentication handshake and database selection, however if you don't do this and call `RedisClient.auth(String, Handler)` yourself in case of connection failure the client will not be able to perform the correct authentication handshake.

- - ### Field Summary

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

      `DEFAULT_HOSTNAME_VERIFICATION_ALGORITHM, DEFAULT_RECONNECT_ATTEMPTS, DEFAULT_RECONNECT_INTERVAL`

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

      `DEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAME, DEFAULT_TRUST_ALL`

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

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

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

      `DEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_ADDRESS, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RedisOptions()`
    `RedisOptions(JsonObject json)`
    `RedisOptions(RedisOptions other)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getAddress()` Get the default `PUB/SUB` eventbus address prefix, default `io.vertx.redis`.
    `String` | `getAuth()` Get the password for authentication at connection time.
    `String` | `getEncoding()` Return the character encoding for Strings, default `UTF-8`.
    `String` | `getHost()` Get the host name for the Redis server, default `localhost`.
    `int` | `getPort()` Get the tcp port where the Redis server is listening, default 6379.
    `Integer` | `getSelect()` Get the database to select at connection time.
    `boolean` | `isBinary()` Return if the messages to/from redis are binary, default `false`.
    `RedisOptions` | `setAddress(String address)` Set the eventbus address prefix for `PUB/SUB`.
    `RedisOptions` | `setAuth(String auth)` Set the password for authentication at connection time.
    `RedisOptions` | `setBinary(boolean binary)` Set the user defined character encoding, e.g.: `iso-8859-1`.
    `RedisOptions` | `setEncoding(String encoding)` Set the user defined character encoding, e.g.: `iso-8859-1`.
    `RedisOptions` | `setHost(String host)` Set the host name where the Redis server is listening.
    `RedisOptions` | `setPort(int port)` Set the tcp port where the Redis server is listening.
    `RedisOptions` | `setSelect(Integer select)` Set the database to select at connection time.
    `JsonObject` | `toJSON()`

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

      `addCrlPath, addCrlValue, addEnabledCipherSuite, addEnabledSecureTransportProtocol, equals, getHostnameVerificationAlgorithm, getReconnectAttempts, getReconnectInterval, hashCode, setConnectTimeout, setHostnameVerificationAlgorithm, setIdleTimeout, setKeyCertOptions, setKeyStoreOptions, setLocalAddress, setLogActivity, setMetricsName, setPemKeyCertOptions, setPemTrustOptions, setPfxKeyCertOptions, setPfxTrustOptions, setProxyOptions, setReceiveBufferSize, setReconnectAttempts, setReconnectInterval, setReuseAddress, setSendBufferSize, setSoLinger, setSsl, setTcpKeepAlive, setTcpNoDelay, setTrafficClass, setTrustAll, setTrustOptions, setTrustStoreOptions, setUsePooledBuffers`

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

      `getConnectTimeout, getLocalAddress, getMetricsName, getProxyOptions, isTrustAll, setJdkSslEngineOptions, setOpenSslEngineOptions, setSslEngineOptions, setUseAlpn, toJson`

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

      `getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getSoLinger, getSslEngineOptions, getTrustOptions, getTrustStoreOptions, isSsl, isTcpKeepAlive, isTcpNoDelay, isUseAlpn, isUsePooledBuffers`

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

      `getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress`

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

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

- - ### Constructor Detail

    - #### RedisOptions

          public RedisOptions()

    - #### RedisOptions

          public RedisOptions(RedisOptions other)

    - #### RedisOptions

          public RedisOptions(JsonObject json)

  - ### Method Detail

    - #### getEncoding

          public String getEncoding()

      Return the character encoding for Strings, default `UTF-8`.
      Returns:
        character encoding

    - #### setEncoding

          public RedisOptions setEncoding(String encoding)

      Set the user defined character encoding, e.g.: `iso-8859-1`.
      Parameters:
        `encoding` - the user character encoding
      Returns:
        self

    - #### isBinary

          public boolean isBinary()

      Return if the messages to/from redis are binary, default `false`.
      Returns:
        are messages binary

    - #### setBinary

          public RedisOptions setBinary(boolean binary)

      Set the user defined character encoding, e.g.: `iso-8859-1`.
      Parameters:
        `binary` - use binary messages
      Returns:
        self

    - #### getAddress

          public String getAddress()

      Get the default `PUB/SUB` eventbus address prefix, default `io.vertx.redis`.
      Returns:
        eventbus address prefix

    - #### setAddress

          public RedisOptions setAddress(String address)

      Set the eventbus address prefix for `PUB/SUB`.
      Parameters:
        `address` - address prefix.
      Returns:
        self

    - #### getHost

          public String getHost()

      Get the host name for the Redis server, default `localhost`.
      Returns:
        host name.

    - #### setHost

          public RedisOptions setHost(String host)

      Set the host name where the Redis server is listening.
      Parameters:
        `host` - host name
      Returns:
        self

    - #### getPort

          public int getPort()

      Get the tcp port where the Redis server is listening, default 6379.
      Returns:
        tcp port

    - #### setPort

          public RedisOptions setPort(int port)

      Set the tcp port where the Redis server is listening.
      Parameters:
        `port` - tcp port.
      Returns:
        self

    - #### getAuth

          public String getAuth()

      Get the password for authentication at connection time.
      Returns:
        password

    - #### setAuth

          public RedisOptions setAuth(String auth)

      Set the password for authentication at connection time.
      Parameters:
        `auth` - password
      Returns:
        self

    - #### getSelect

          public Integer getSelect()

      Get the database to select at connection time.
      Returns:
        database id

    - #### setSelect

          public RedisOptions setSelect(Integer select)

      Set the database to select at connection time.
      Parameters:
        `select` - database id
      Returns:
        self

    - #### toJSON

          public JsonObject toJSON()

Copyright © 2017. All rights reserved.