public class RedisConnectionConfig extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
RedisConnectionConfig.Builder
Builder for Redis RedisConnectionConfig.
|
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_CLUSTER_PORT
The default redisCluster port.
|
static int |
DEFAULT_REDIS_PORT
The default redis port.
|
static int |
DEFAULT_SENTINEL_PORT
The default redisSentinel port.
|
static long |
DEFAULT_TIMEOUT_MILLISECONDS
Default timeout: 60 sec
|
| 构造器和说明 |
|---|
RedisConnectionConfig()
Default empty constructor.
|
RedisConnectionConfig(String host,
int port,
long timeout)
Constructor with host/port and timeout.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static RedisConnectionConfig.Builder |
builder()
Returns a new
RedisConnectionConfig.Builder to construct a RedisConnectionConfig. |
boolean |
equals(Object o) |
String |
getClientName()
Returns the client name.
|
int |
getDatabase()
Returns the Redis database number.
|
String |
getHost()
Returns the host.
|
char[] |
getPassword()
Returns the password.
|
int |
getPort()
Returns the Redis port.
|
List<RedisConnectionConfig> |
getRedisClusters() |
String |
getRedisSentinelMasterId()
Returns the Sentinel Master Id.
|
List<RedisConnectionConfig> |
getRedisSentinels() |
long |
getTimeout()
Returns the command timeout for synchronous command execution.
|
int |
hashCode() |
void |
setClientName(String clientName)
Sets the client name to be applied on Redis connections.
|
void |
setDatabase(int database)
Sets the Redis database number.
|
void |
setHost(String host)
Sets the Redis host.
|
void |
setPassword(char[] password)
Sets the password.
|
void |
setPassword(String password)
Sets the password.
|
void |
setPort(int port)
Sets the Redis port.
|
void |
setRedisSentinelMasterId(String redisSentinelMasterId)
Sets the Sentinel Master Id.
|
void |
setTimeout(Long timeout)
Sets the command timeout for synchronous command execution.
|
String |
toString() |
public static final int DEFAULT_SENTINEL_PORT
public static final int DEFAULT_CLUSTER_PORT
public static final int DEFAULT_REDIS_PORT
public static final long DEFAULT_TIMEOUT_MILLISECONDS
public RedisConnectionConfig()
public RedisConnectionConfig(String host, int port, long timeout)
host - the hostport - the porttimeout - timeout value . unit is mill secondspublic static RedisConnectionConfig.Builder builder()
RedisConnectionConfig.Builder to construct a RedisConnectionConfig.RedisConnectionConfig.Builder to construct a RedisConnectionConfig.public String getHost()
public void setHost(String host)
host - the hostpublic String getRedisSentinelMasterId()
public void setRedisSentinelMasterId(String redisSentinelMasterId)
redisSentinelMasterId - the Sentinel Master Id.public int getPort()
public void setPort(int port)
DEFAULT_REDIS_PORT.port - the Redis portpublic char[] getPassword()
public void setPassword(String password)
password - the password, must not be null.public void setPassword(char[] password)
password - the password, must not be null.public long getTimeout()
public void setTimeout(Long timeout)
timeout - the command timeout for synchronous command execution.public int getDatabase()
public void setDatabase(int database)
database - the Redis database number.public String getClientName()
public void setClientName(String clientName)
clientName - the client name.public List<RedisConnectionConfig> getRedisSentinels()
Redis Sentinel URIs.public List<RedisConnectionConfig> getRedisClusters()
Redis Cluster URIs.Copyright © 2022 Alibaba Group. All rights reserved.