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_ENABLED_SECURE_TRANSPORT_PROTOCOLS, DEFAULT_IDLE_TIMEOUT, DEFAULT_IDLE_TIMEOUT_TIME_UNIT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_TCP_CORK, DEFAULT_TCP_FAST_OPEN, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_TCP_QUICKACK, 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_REUSE_PORT, 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
    --- | ---
    `RedisOptions` | `addSentinel(String sentinelHostAndPort)` Add Sentinel node.
    `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` | `getDomainSocketAddress()` Get the domain socket address for the Redis server.
    `String` | `getEncoding()` Return the character encoding for Strings, default `UTF-8`.
    `String` | `getHost()` Get the host name for the Redis server, default `localhost`.
    `String` | `getMasterName()` Get name of Redis master.
    `int` | `getPort()` Get the tcp port where the Redis server is listening, default 6379.
    `Integer` | `getSelect()` Get the database to select at connection time.
    `List<String>` | `getSentinels()` Get list of Sentinels.
    `boolean` | `isBinary()` Return if the messages to/from redis are binary, default `false`.
    `boolean` | `isDomainSocket()` Get the domain socket enabled option, 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 messages to/from redis as binary, default `false`.
    `RedisOptions` | `setDomainSocket(boolean domainSocket)` Set the domain socket enabled option, default `false`.
    `RedisOptions` | `setDomainSocketAddress(String domainSocketAddress)` Set the domain socket address where the Redis server is listening.
    `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` | `setMasterName(String masterName)` Set name of Redis master (used with Sentinel).
    `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` | `setSentinels(List<String> sentinels)` Set the list of Sentinels.

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

      `addCrlPath, addCrlValue, addEnabledCipherSuite, addEnabledSecureTransportProtocol, equals, getHostnameVerificationAlgorithm, getReconnectAttempts, getReconnectInterval, hashCode, removeEnabledSecureTransportProtocol, setConnectTimeout, setEnabledSecureTransportProtocols, setHostnameVerificationAlgorithm, setIdleTimeout, setIdleTimeoutUnit, setJdkSslEngineOptions, setKeyCertOptions, setKeyStoreOptions, setLocalAddress, setLogActivity, setMetricsName, setOpenSslEngineOptions, setPemKeyCertOptions, setPemTrustOptions, setPfxKeyCertOptions, setPfxTrustOptions, setProxyOptions, setReceiveBufferSize, setReconnectAttempts, setReconnectInterval, setReuseAddress, setReusePort, setSendBufferSize, setSoLinger, setSsl, setSslEngineOptions, setTcpCork, setTcpFastOpen, setTcpKeepAlive, setTcpNoDelay, setTcpQuickAck, setTrafficClass, setTrustAll, setTrustOptions, setTrustStoreOptions, setUseAlpn, setUsePooledBuffers`

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

      `getConnectTimeout, getLocalAddress, getMetricsName, getProxyOptions, isTrustAll, toJson`

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

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

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

      `getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress, isReusePort`

    - ### 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`. * @return character encoding

    - #### setEncoding

          public RedisOptions setEncoding(String encoding)

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

    - #### isBinary

          public boolean isBinary()

      Return if the messages to/from redis are binary, default `false`. * @return are messages binary

    - #### setBinary

          public RedisOptions setBinary(boolean binary)

      Set the messages to/from redis as binary, default `false`. * @param binary use binary messages
      Returns:
        self

    - #### getAddress

          public String getAddress()

      Get the default `PUB/SUB` eventbus address prefix, default `io.vertx.redis`. * @return eventbus address prefix

    - #### setAddress

          public RedisOptions setAddress(String address)

      Set the eventbus address prefix for `PUB/SUB`. * @param address address prefix.
      Returns:
        self

    - #### getHost

          public String getHost()

      Get the host name for the Redis server, default `localhost`. * @return host name.

    - #### setHost

          public RedisOptions setHost(String host)

      Set the host name where the Redis server is listening. * @param host host name
      Returns:
        self

    - #### getPort

          public int getPort()

      Get the tcp port where the Redis server is listening, default 6379. * @return 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. * @return 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. * @return database id

    - #### setSelect

          public RedisOptions setSelect(Integer select)

      Set the database to select at connection time. * @param select database id
      Returns:
        self

    - #### getMasterName

          public String getMasterName()

      Get name of Redis master.
      Returns:
        Redis master name

    - #### setMasterName

          public RedisOptions setMasterName(String masterName)

      Set name of Redis master (used with Sentinel).
      Parameters:
        `masterName` - name of Redis master
      Returns:
        self

    - #### addSentinel

          public RedisOptions addSentinel(String sentinelHostAndPort)

      Add Sentinel node.
      Parameters:
        `sentinelHostAndPort` - Sentinel node on the form 'hostname:port'
      Returns:
        self

    - #### getSentinels

          public List<String> getSentinels()

      Get list of Sentinels.
      Returns:
        List of Sentinels on the form 'hostname:port'

    - #### setSentinels

          public RedisOptions setSentinels(List<String> sentinels)

      Set the list of Sentinels.
      Parameters:
        `sentinels` - a list of sentinels host and port string
      Returns:
        self

    - #### setDomainSocketAddress

          public RedisOptions setDomainSocketAddress(String domainSocketAddress)

      Set the domain socket address where the Redis server is listening.
      Parameters:
        `domainSocketAddress` - * @return self

    - #### getDomainSocketAddress

          public String getDomainSocketAddress()

      Get the domain socket address for the Redis server.
      Returns:
        domain socket address

    - #### setDomainSocket

          public RedisOptions setDomainSocket(boolean domainSocket)

      Set the domain socket enabled option, default `false`.
      Parameters:
        `domainSocket` - * @return self

    - #### isDomainSocket

          public boolean isDomainSocket()

      Get the domain socket enabled option, default `false`. * @return domain socket enabled option

Copyright © 2018 Eclipse. All rights reserved.