Interface RedisConfiguration.SentinelConfiguration
- All Superinterfaces:
RedisConfiguration.WithAuthentication
,RedisConfiguration.WithDatabaseIndex
,RedisConfiguration.WithPassword
- All Known Implementing Classes:
RedisSentinelConfiguration
- Enclosing interface:
- RedisConfiguration
public static interface RedisConfiguration.SentinelConfiguration
extends RedisConfiguration.WithDatabaseIndex, RedisConfiguration.WithPassword
Configuration interface suitable for Redis Sentinel environments.
- Since:
- 2.1
- Author:
- Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptiondefault RedisPassword
Get theRedisPassword
used when authenticating with a Redis Server.default String
Get the username used when authenticating with a Redis Server.Get the Sentinel master node.Returns theRedisPassword
to use when connecting to a Redis Sentinel.Returns anCollections.unmodifiableSet(Set)
of Sentinels.Get the username to use when connecting.default void
Set the name of the master node.void
Set the master node.default void
setSentinelPassword
(char[] password) Create and set aRedisPassword
to be used when authenticating with Redis Sentinel from the givenCharacter
sequence.default void
setSentinelPassword
(String password) Create and set aRedisPassword
to be used when authenticating with Redis Sentinel from the givenString
.void
setSentinelPassword
(RedisPassword password) Set aRedisPassword
to be used when authenticating with Redis Sentinel.void
setSentinelUsername
(String sentinelUsername) Create and set a username with the givenString
.Methods inherited from interface org.springframework.data.redis.connection.RedisConfiguration.WithAuthentication
getPassword, getUsername, setPassword, setPassword, setPassword, setUsername
Methods inherited from interface org.springframework.data.redis.connection.RedisConfiguration.WithDatabaseIndex
getDatabase, setDatabase
-
Method Details
-
setMaster
Set the name of the master node.- Parameters:
name
- must not be null.
-
setMaster
Set the master node.- Parameters:
master
- must not be null.
-
getMaster
Get the Sentinel master node.- Returns:
- get the master node or null if not set.
-
getSentinels
Returns anCollections.unmodifiableSet(Set)
of Sentinels.- Returns:
Set
of sentinels. Never null.
-
getDataNodeUsername
Get the username used when authenticating with a Redis Server.- Returns:
- can be null if not set.
- Since:
- 2.4
-
getDataNodePassword
Get theRedisPassword
used when authenticating with a Redis Server.- Returns:
- never null.
- Since:
- 2.2.2
-
setSentinelUsername
Create and set a username with the givenString
. Requires Redis 6 or newer.- Parameters:
sentinelUsername
- the username for sentinel.- Since:
- 2.7
-
getSentinelUsername
Get the username to use when connecting.- Returns:
- null if none set.
- Since:
- 2.7
-
setSentinelPassword
Create and set aRedisPassword
to be used when authenticating with Redis Sentinel from the givenString
.- Parameters:
password
- can be null.- Since:
- 2.2.2
-
setSentinelPassword
default void setSentinelPassword(@Nullable char[] password) Create and set aRedisPassword
to be used when authenticating with Redis Sentinel from the givenCharacter
sequence.- Parameters:
password
- can be null.- Since:
- 2.2.2
-
setSentinelPassword
Set aRedisPassword
to be used when authenticating with Redis Sentinel.- Parameters:
password
- must not be null useRedisPassword.none()
instead.- Since:
- 2.2.2
-
getSentinelPassword
RedisPassword getSentinelPassword()Returns theRedisPassword
to use when connecting to a Redis Sentinel.
Can be set viasetSentinelPassword(RedisPassword)
orRedisPassword.none()
if no password has been set.- Returns:
- the
RedisPassword
for authenticating with Redis Sentinel. - Since:
- 2.2.2
-