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 RedisPasswordGet theRedisPasswordused when authenticating with a Redis Server.default StringGet the username used when authenticating with a Redis Server.Get the Sentinel master node.Returns theRedisPasswordto use when connecting to a Redis Sentinel.Returns anCollections.unmodifiableSet(Set)of Sentinels.Get the username to use when connecting.default voidSet the name of the master node.voidSet the master node.default voidsetSentinelPassword(char[] password) Create and set aRedisPasswordto be used when authenticating with Redis Sentinel from the givenCharactersequence.default voidsetSentinelPassword(String password) Create and set aRedisPasswordto be used when authenticating with Redis Sentinel from the givenString.voidsetSentinelPassword(RedisPassword password) Set aRedisPasswordto be used when authenticating with Redis Sentinel.voidsetSentinelUsername(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, setUsernameMethods 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:
Setof 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 theRedisPasswordused 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 aRedisPasswordto be used when authenticating with Redis Sentinel from the givenString.- Parameters:
password- can be null.- Since:
- 2.2.2
-
setSentinelPassword
Create and set aRedisPasswordto be used when authenticating with Redis Sentinel from the givenCharactersequence.- Parameters:
password- can be null.- Since:
- 2.2.2
-
setSentinelPassword
Set aRedisPasswordto be used when authenticating with Redis Sentinel.- Parameters:
password- must not be null useRedisPassword.none()instead.- Since:
- 2.2.2
-
getSentinelPassword
RedisPassword getSentinelPassword()Returns theRedisPasswordto use when connecting to a Redis Sentinel.
Can be set viasetSentinelPassword(RedisPassword)orRedisPassword.none()if no password has been set.- Returns:
- the
RedisPasswordfor authenticating with Redis Sentinel. - Since:
- 2.2.2
-