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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_ENDPOINT` The default redis endpoint = `redis://localhost:6379`

  - ### 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 Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `RedisOptions` | `addConnectionString(String connectionString)` Adds a connection string (endpoint) to use while connecting to the redis server.
    `RedisOptions` | `addEndpoint(String connectionString)` Deprecated. see `setConnectionString(String connectionString)` for a better naming
    `String` | `getEndpoint()` Gets the redis endpoint to use
    `List<String>` | `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` | `getMaxPoolSize()` Tune the maximum size of the connection pool.
    `int` | `getMaxPoolWaiting()` Tune the maximum waiting requests for a connection from the pool.
    `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.
    `int` | `getPoolCleanerInterval()` Tune how often in milliseconds should the connection pool cleaner execute.
    `int` | `getPoolRecycleTimeout()` Tune when a connection should be recycled in milliseconds.
    `RedisRole` | `getRole()` Get the role name (only considered in HA mode).
    `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` | `setConnectionString(String connectionString)` Sets a single connection string (endpoint) to use while connecting to the redis server.
    `RedisOptions` | `setEndpoint(String connectionString)` Deprecated. see `setConnectionString(String connectionString)` for a better naming
    `RedisOptions` | `setEndpoints(List<String> 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` | `setMaxPoolSize(int maxPoolSize)` Tune the maximum size of the connection pool.
    `RedisOptions` | `setMaxPoolWaiting(int maxPoolWaiting)` Tune the maximum waiting requests for a connection from the pool.
    `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` | `setPoolCleanerInterval(int poolCleanerInterval)` Tune how often in milliseconds should the connection pool cleaner execute.
    `RedisOptions` | `setPoolRecycleTimeout(int poolRecycleTimeout)` Tune when a connection should be recycled in milliseconds.
    `RedisOptions` | `setRole(RedisRole role)` Set the role name (only considered in HA mode).
    `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`

- - ### Field Detail

    - #### DEFAULT_ENDPOINT

          public static final String DEFAULT_ENDPOINT

      The default redis endpoint = `redis://localhost:6379`
      See Also:
        Constant Field Values

  - ### 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<String> getEndpoints()

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

    - #### getEndpoint

          public String getEndpoint()

      Gets the redis endpoint to use
      Returns:
        the Redis connection string URI

    - #### setEndpoints

          public RedisOptions setEndpoints(List<String> 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

          @Deprecated
          public RedisOptions addEndpoint(String connectionString)

      Deprecated. see `setConnectionString(String connectionString)` for a better naming
      Adds an 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:
        `connectionString` - a string URI following the scheme: redis://[username:password@][host][:port][/database]
      Returns:
        fluent self.

    - #### setEndpoint

          @Deprecated
          public RedisOptions setEndpoint(String connectionString)

      Deprecated. see `setConnectionString(String connectionString)` for a better naming
      Sets a single connection string to use while connecting to the redis server. Will replace the previously configured connection strings.
      Parameters:
        `connectionString` - a string following the scheme: redis://[username:password@][host][:port][/[database]
      Returns:
        fluent self.

    - #### addConnectionString

          public RedisOptions addConnectionString(String connectionString)

      Adds a connection string (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.

      Does not support rediss (redis over ssl scheme) for now.

      Parameters:
        `connectionString` - a string URI following the scheme: redis://[username:password@][host][:port][/database]
      Returns:
        fluent self.
      See Also:
        Redis scheme on www.iana.org

    - #### setConnectionString

          public RedisOptions setConnectionString(String connectionString)

      Sets a single connection string (endpoint) to use while connecting to the redis server. Will replace the previously configured connection strings.

      Does not support rediss (redis over ssl scheme) for now.

      Parameters:
        `connectionString` - a string following the scheme: redis://[username:password@][host][:port][/[database].
      Returns:
        fluent self.
      See Also:
        Redis scheme on www.iana.org

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

    - #### getPoolCleanerInterval

          public int getPoolCleanerInterval()

      Tune how often in milliseconds should the connection pool cleaner execute.
      Returns:
        the cleaning internal

    - #### setPoolCleanerInterval

          public RedisOptions setPoolCleanerInterval(int poolCleanerInterval)

      Tune how often in milliseconds should the connection pool cleaner execute.
      Parameters:
        `poolCleanerInterval` - the interval in milliseconds (-1 for never)
      Returns:
        fluent self.

    - #### getMaxPoolSize

          public int getMaxPoolSize()

      Tune the maximum size of the connection pool.
      Returns:
        the size.

    - #### setMaxPoolSize

          public RedisOptions setMaxPoolSize(int maxPoolSize)

      Tune the maximum size of the connection pool. When working with cluster or sentinel this value should be atleast the total number of cluster member (or number of sentinels + 1)
      Parameters:
        `maxPoolSize` - the max pool size.
      Returns:
        fluent self.

    - #### getMaxPoolWaiting

          public int getMaxPoolWaiting()

      Tune the maximum waiting requests for a connection from the pool.
      Returns:
        the maximum waiting requests.

    - #### setMaxPoolWaiting

          public RedisOptions setMaxPoolWaiting(int maxPoolWaiting)

      Tune the maximum waiting requests for a connection from the pool.
      Parameters:
        `maxPoolWaiting` - max waiting requests
      Returns:
        fluent self.

    - #### getPoolRecycleTimeout

          public int getPoolRecycleTimeout()

      Tune when a connection should be recycled in milliseconds.
      Returns:
        the timeout for recycling.

    - #### setPoolRecycleTimeout

          public RedisOptions setPoolRecycleTimeout(int poolRecycleTimeout)

      Tune when a connection should be recycled in milliseconds.
      Parameters:
        `poolRecycleTimeout` - the timeout for recycling.
      Returns:
        fluent self.

    - #### toJson

          public JsonObject toJson()

      Converts this object to JSON notation.
      Returns:
        JSON

Copyright © 2021 Eclipse. All rights reserved.