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 voidsetPassword(char[] password) Create and set aRedisPasswordfor givenString.default voidsetPassword(String password) Create and set aRedisPasswordfor givenString.voidsetPassword(RedisPassword password) Create and set aRedisPasswordfor givenString.voidsetUsername(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 aRedisPasswordfor givenString.- Parameters:
password- can be null.
-
setPassword
Create and set aRedisPasswordfor givenString.- Parameters:
password- can be null.
-
setPassword
Create and set aRedisPasswordfor 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.
-