io.vertx.redis

## Class RedisOptions

- java.lang.Object
- - io.vertx.redis.RedisOptions

-     public class RedisOptions
      extends Object

  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.

- - ### Constructor Summary

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

  - ### 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`.
    `boolean` | `isTcpKeepAlive()` Get wheather TCP KeepAlive option should be enabled, default true.
    `boolean` | `isTcpNoDelay()` Get wheather TCP NoDelay should be enabled, default true
    `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.
    `RedisOptions` | `setTcpKeepAlive(boolean tcpKeepAlive)` Set the TCP KeepAlive option
    `RedisOptions` | `setTcpNoDelay(boolean tcpNoDelay)` Set the TCP NoDelay at the socket level.
    `JsonObject` | `toJSON()`

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

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

- - ### Constructor Detail

    - #### RedisOptions

          public RedisOptions()

    - #### RedisOptions

          public RedisOptions(JsonObject json)

    - #### RedisOptions

          public RedisOptions(RedisOptions options)

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

    - #### isTcpKeepAlive

          public boolean isTcpKeepAlive()

      Get wheather TCP KeepAlive option should be enabled, default true.
      Returns:
        keep alive

    - #### setTcpKeepAlive

          public RedisOptions setTcpKeepAlive(boolean tcpKeepAlive)

      Set the TCP KeepAlive option
      Parameters:
        `tcpKeepAlive` - boolean
      Returns:
        self

    - #### isTcpNoDelay

          public boolean isTcpNoDelay()

      Get wheather TCP NoDelay should be enabled, default true
      Returns:
        tcp no delay

    - #### setTcpNoDelay

          public RedisOptions setTcpNoDelay(boolean tcpNoDelay)

      Set the TCP NoDelay at the socket level.
      Parameters:
        `tcpNoDelay` - boolean
      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 © 2016. All rights reserved.