Interface RedisConfiguration.WithAuthentication
- All Known Subinterfaces:
RedisConfiguration.ClusterConfiguration
,RedisConfiguration.DomainSocketConfiguration
,RedisConfiguration.SentinelConfiguration
,RedisConfiguration.StaticMasterReplicaConfiguration
,RedisConfiguration.WithPassword
- All Known Implementing Classes:
RedisClusterConfiguration
,RedisSentinelConfiguration
,RedisSocketConfiguration
,RedisStandaloneConfiguration
,RedisStaticMasterReplicaConfiguration
- Enclosing interface:
- RedisConfiguration
public static interface RedisConfiguration.WithAuthentication
RedisConfiguration
part suitable for configurations that may use authentication when connecting.- Since:
- 2.4
- Author:
- Christoph Strobl, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionGet the RedisPassword to use when connecting.Get the username to use when connecting.default void
setPassword
(char[] password) Create and set aRedisPassword
for givenString
.default void
setPassword
(String password) Create and set aRedisPassword
for givenString
.void
setPassword
(RedisPassword password) Create and set aRedisPassword
for givenString
.void
setUsername
(String username) Create and set a username with the givenString
.
-
Method Details
-
setUsername
Create and set a username with the givenString
. Requires Redis 6 or newer.- Parameters:
username
- the username.
-
setPassword
Create and set aRedisPassword
for givenString
.- Parameters:
password
- can be null.
-
setPassword
Create and set aRedisPassword
for givenString
.- Parameters:
password
- can be null.
-
setPassword
Create and set aRedisPassword
for givenString
.- Parameters:
password
- must not be null useRedisPassword.none()
instead.
-
getUsername
Get the username to use when connecting.- Returns:
- null if none set.
-
getPassword
RedisPassword getPassword()Get the RedisPassword to use when connecting.- Returns:
RedisPassword.none()
if none set.
-