io.vertx.redis.client

## Class RedisOptions

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

-     public class RedisOptions
      extends Object

  Redis Client Configuration options.
  Author:
    Paulo Lopes

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RedisOptions()` Creates a default configuration object using redis server defaults
    `RedisOptions(JsonObject json)` Copy from JSON constructor.
    `RedisOptions(RedisOptions other)` Copy constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `RedisOptions` | `addEndpoint(SocketAddress endpoint)` Adds a endpoint to use while connecting to the redis server.
    `SocketAddress` | `getEndpoint()` Gets the redis endpoint to use
    `List<SocketAddress>` | `getEndpoints()` Gets the list of redis endpoints to use (mostly used while connecting to a cluster)
    `String` | `getMasterName()` Get the master name (only considered in HA mode).
    `int` | `getMaxNestedArrays()` Tune how much nested arrays are allowed on a redis response.
    `int` | `getMaxWaitingHandlers()` The client will always work on pipeline mode, this means that messages can start queueing.
    `NetClientOptions` | `getNetClientOptions()` Get the net client options used to connect to the server.
    `String` | `getPassword()` Get the provided password to be used when establishing a connection to the server.
    `RedisRole` | `getRole()` Get the role name (only considered in HA mode).
    `Integer` | `getSelect()` Get the provided database to be selected when establishing a connection to the server.
    `RedisClientType` | `getType()` Get the type of client to be created.
    `RedisSlaves` | `getUseSlave()` Get whether or not to use slave nodes (only considered in Cluster mode).
    `RedisOptions` | `setEndpoint(SocketAddress endpoint)` Sets a single endpoint to use while connecting to the redis server.
    `RedisOptions` | `setEndpoints(List<SocketAddress> endpoints)` Set the endpoints to use while connecting to the redis server.
    `RedisOptions` | `setMasterName(String masterName)` Set the master name (only considered in HA mode).
    `RedisOptions` | `setMaxNestedArrays(int maxNestedArrays)` Tune how much nested arrays are allowed on a redis response.
    `RedisOptions` | `setMaxWaitingHandlers(int maxWaitingHandlers)` The client will always work on pipeline mode, this means that messages can start queueing.
    `RedisOptions` | `setNetClientOptions(NetClientOptions netClientOptions)` Set the net client options to be used while connecting to the redis server.
    `RedisOptions` | `setPassword(String password)` Set the provided password to be used when establishing a connection to the server.
    `RedisOptions` | `setRole(RedisRole role)` Set the role name (only considered in HA mode).
    `RedisOptions` | `setSelect(Integer select)` Set the provided database to be selected when establishing a connection to the server.
    `RedisOptions` | `setType(RedisClientType type)` Set the desired client type to be created.
    `RedisOptions` | `setUseSlave(RedisSlaves slaves)` Set whether or not to use slave nodes (only considered in Cluster mode).
    `JsonObject` | `toJson()` Converts this object to JSON notation.

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

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

- - ### Constructor Detail

    - #### RedisOptions

          public RedisOptions()

      Creates a default configuration object using redis server defaults

    - #### RedisOptions

          public RedisOptions(RedisOptions other)

      Copy constructor.
      Parameters:
        `other` - the object to clone.

    - #### RedisOptions

          public RedisOptions(JsonObject json)

      Copy from JSON constructor.
      Parameters:
        `json` - source json

  - ### Method Detail

    - #### getType

          public RedisClientType getType()

      Get the type of client to be created.
      Returns:
        the desired client type.

    - #### setType

          public RedisOptions setType(RedisClientType type)

      Set the desired client type to be created.
      Parameters:
        `type` - the client type.
      Returns:
        fluent self.

    - #### getNetClientOptions

          public NetClientOptions getNetClientOptions()

      Get the net client options used to connect to the server.
      Returns:
        the net socket options.

    - #### setNetClientOptions

          public RedisOptions setNetClientOptions(NetClientOptions netClientOptions)

      Set the net client options to be used while connecting to the redis server. Use this to tune your connection.
      Parameters:
        `netClientOptions` - custom net client options.
      Returns:
        fluent self.

    - #### getEndpoints

          public List<SocketAddress> getEndpoints()

      Gets the list of redis endpoints to use (mostly used while connecting to a cluster)
      Returns:
        list of socket addresses.

    - #### getEndpoint

          public SocketAddress getEndpoint()

      Gets the redis endpoint to use
      Returns:
        socket address.

    - #### setEndpoints

          public RedisOptions setEndpoints(List<SocketAddress> endpoints)

      Set the endpoints to use while connecting to the redis server. Only the cluster mode will consider more than 1 element. If more are provided, they are not considered by the client when in single server mode.
      Parameters:
        `endpoints` - list of socket addresses.
      Returns:
        fluent self.

    - #### addEndpoint

          public RedisOptions addEndpoint(SocketAddress endpoint)

      Adds a endpoint to use while connecting to the redis server. Only the cluster mode will consider more than 1 element. If more are provided, they are not considered by the client when in single server mode.
      Parameters:
        `endpoint` - a socket addresses.
      Returns:
        fluent self.

    - #### setEndpoint

          public RedisOptions setEndpoint(SocketAddress endpoint)

      Sets a single endpoint to use while connecting to the redis server. Will replace the previously configured endpoints.
      Parameters:
        `endpoint` - a socket addresses.
      Returns:
        fluent self.

    - #### getMaxWaitingHandlers

          public int getMaxWaitingHandlers()

      The client will always work on pipeline mode, this means that messages can start queueing. You can control how much backlog you're willing to accept. This methods returns how much handlers is the client willing to queue.
      Returns:
        max allowed queued waiting handlers.

    - #### setMaxWaitingHandlers

          public RedisOptions setMaxWaitingHandlers(int maxWaitingHandlers)

      The client will always work on pipeline mode, this means that messages can start queueing. You can control how much backlog you're willing to accept. This methods sets how much handlers is the client willing to queue.
      Parameters:
        `maxWaitingHandlers` - max allowed queued waiting handlers.
      Returns:
        fluent self.

    - #### getMasterName

          public String getMasterName()

      Get the master name (only considered in HA mode).
      Returns:
        the master name.

    - #### setMasterName

          public RedisOptions setMasterName(String masterName)

      Set the master name (only considered in HA mode).
      Parameters:
        `masterName` - the master name.
      Returns:
        fluent self.

    - #### getRole

          public RedisRole getRole()

      Get the role name (only considered in HA mode).
      Returns:
        the master name.

    - #### setRole

          public RedisOptions setRole(RedisRole role)

      Set the role name (only considered in HA mode).
      Parameters:
        `role` - the master name.
      Returns:
        fluent self.

    - #### getUseSlave

          public RedisSlaves getUseSlave()

      Get whether or not to use slave nodes (only considered in Cluster mode).
      Returns:
        the cluster slave mode.

    - #### setUseSlave

          public RedisOptions setUseSlave(RedisSlaves slaves)

      Set whether or not to use slave nodes (only considered in Cluster mode).
      Parameters:
        `slaves` - the cluster slave mode.
      Returns:
        fluent self.

    - #### getMaxNestedArrays

          public int getMaxNestedArrays()

      Tune how much nested arrays are allowed on a redis response. This affects the parser performance.
      Returns:
        the configured max nested arrays allowance.

    - #### setMaxNestedArrays

          public RedisOptions setMaxNestedArrays(int maxNestedArrays)

      Tune how much nested arrays are allowed on a redis response. This affects the parser performance.
      Parameters:
        `maxNestedArrays` - the configured max nested arrays allowance.
      Returns:
        fluent self.

    - #### getPassword

          public String getPassword()

      Get the provided password to be used when establishing a connection to the server.
      Returns:
        the password

    - #### setPassword

          public RedisOptions setPassword(String password)

      Set the provided password to be used when establishing a connection to the server.
      Parameters:
        `password` - the password
      Returns:
        fluent self.

    - #### getSelect

          public Integer getSelect()

      Get the provided database to be selected when establishing a connection to the server.
      Returns:
        the database id.

    - #### setSelect

          public RedisOptions setSelect(Integer select)

      Set the provided database to be selected when establishing a connection to the server.
      Parameters:
        `select` - the database id.
      Returns:
        fluent self.

    - #### toJson

          public JsonObject toJson()

      Converts this object to JSON notation.
      Returns:
        JSON

Copyright © 2019 Eclipse. All rights reserved.