public class RedisStaticMasterReplicaConfiguration extends Object implements RedisConfiguration, RedisConfiguration.StaticMasterReplicaConfiguration
RedisConnection
via RedisConnectionFactory
using the provided
Master / Replica configuration to nodes know to not change address. Eg. when connecting to
AWS ElastiCache with Read Replicas. RedisConfiguration.ClusterConfiguration, RedisConfiguration.DomainSocketConfiguration, RedisConfiguration.SentinelConfiguration, RedisConfiguration.StaticMasterReplicaConfiguration, RedisConfiguration.WithDatabaseIndex, RedisConfiguration.WithDomainSocket, RedisConfiguration.WithHostAndPort, RedisConfiguration.WithPassword
Constructor and Description |
---|
RedisStaticMasterReplicaConfiguration(String hostName)
Create a new
RedisConfiguration.StaticMasterReplicaConfiguration given hostName . |
RedisStaticMasterReplicaConfiguration(String hostName,
int port)
|
Modifier and Type | Method and Description |
---|---|
void |
addNode(String hostName,
int port)
Add a
node to the list of nodes given hostName . |
int |
getDatabase()
Get the database index to use.
|
List<RedisStandaloneConfiguration> |
getNodes() |
RedisPassword |
getPassword()
Get the RedisPassword to use when connecting.
|
RedisConfiguration.StaticMasterReplicaConfiguration |
node(String hostName)
Add a
node to the list of nodes given hostName . |
RedisStaticMasterReplicaConfiguration |
node(String hostName,
int port)
|
void |
setDatabase(int index)
Set the database index to use.
|
void |
setPassword(RedisPassword password)
Create and set a
RedisPassword for given String . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDatabaseOrElse, getDatabaseOrElse, getHostOrElse, getPasswordOrElse, getPasswordOrElse, getPortOrElse, isClusterConfiguration, isDatabaseIndexAware, isDomainSocketConfiguration, isHostAndPortAware, isPasswordAware, isSentinelConfiguration, isStaticMasterReplicaConfiguration
setPassword, setPassword
public RedisStaticMasterReplicaConfiguration(String hostName)
RedisConfiguration.StaticMasterReplicaConfiguration
given hostName
.hostName
- must not be null or empty.public RedisStaticMasterReplicaConfiguration(String hostName, int port)
hostName
- must not be null or empty.port
- a valid TCP port (1-65535).public void addNode(String hostName, int port)
node
to the list of nodes given hostName
.hostName
- must not be null or empty.port
- a valid TCP port (1-65535).public RedisConfiguration.StaticMasterReplicaConfiguration node(String hostName)
node
to the list of nodes given hostName
.hostName
- must not be null or empty.this
RedisConfiguration.StaticMasterReplicaConfiguration
.public RedisStaticMasterReplicaConfiguration node(String hostName, int port)
hostName
- must not be null or empty.port
- a valid TCP port (1-65535).this
RedisConfiguration.StaticMasterReplicaConfiguration
.public int getDatabase()
RedisConfiguration.WithDatabaseIndex
getDatabase
in interface RedisConfiguration.WithDatabaseIndex
zero
by default.public void setDatabase(int index)
RedisConfiguration.WithDatabaseIndex
setDatabase
in interface RedisConfiguration.WithDatabaseIndex
public RedisPassword getPassword()
RedisConfiguration.WithPassword
getPassword
in interface RedisConfiguration.WithPassword
RedisPassword.none()
if none set.public void setPassword(RedisPassword password)
RedisConfiguration.WithPassword
RedisPassword
for given String
.setPassword
in interface RedisConfiguration.WithPassword
password
- must not be null use RedisPassword.none()
instead.public List<RedisStandaloneConfiguration> getNodes()
getNodes
in interface RedisConfiguration.StaticMasterReplicaConfiguration
List
of nodes
.Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.