public class RedisOptions extends Object
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.
|
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.
|
public RedisOptions()
public RedisOptions(RedisOptions other)
other
- the object to clone.public RedisOptions(JsonObject json)
json
- source jsonpublic RedisClientType getType()
public RedisOptions setType(RedisClientType type)
type
- the client type.public NetClientOptions getNetClientOptions()
public RedisOptions setNetClientOptions(NetClientOptions netClientOptions)
netClientOptions
- custom net client options.public List<SocketAddress> getEndpoints()
public SocketAddress getEndpoint()
public RedisOptions setEndpoints(List<SocketAddress> endpoints)
endpoints
- list of socket addresses.public RedisOptions addEndpoint(SocketAddress endpoint)
endpoint
- a socket addresses.public RedisOptions setEndpoint(SocketAddress endpoint)
endpoint
- a socket addresses.public int getMaxWaitingHandlers()
public RedisOptions setMaxWaitingHandlers(int maxWaitingHandlers)
maxWaitingHandlers
- max allowed queued waiting handlers.public String getMasterName()
public RedisOptions setMasterName(String masterName)
masterName
- the master name.public RedisRole getRole()
public RedisOptions setRole(RedisRole role)
role
- the master name.public RedisSlaves getUseSlave()
public RedisOptions setUseSlave(RedisSlaves slaves)
slaves
- the cluster slave mode.public int getMaxNestedArrays()
public RedisOptions setMaxNestedArrays(int maxNestedArrays)
maxNestedArrays
- the configured max nested arrays allowance.public String getPassword()
public RedisOptions setPassword(String password)
password
- the passwordpublic Integer getSelect()
public RedisOptions setSelect(Integer select)
select
- the database id.public JsonObject toJson()
Copyright © 2019 Eclipse. All rights reserved.