Package io.lettuce.core
Interface RedisCredentials
-
public interface RedisCredentials
Provides credentials to access a secured Redis service.- Since:
- 6.2
- Author:
- Jon Iantosca, Mark Paluch
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description char[]
getPassword()
Retrieve the Redis password, used to authenticate the user interacting with Redis.String
getUsername()
Retrieve the Redis user, used to identify the user interacting with Redis.boolean
hasPassword()
Return whether the password is configured.boolean
hasUsername()
Return whether the username is configured.static RedisCredentials
just(String username, char[] password)
static RedisCredentials
just(String username, CharSequence password)
-
-
-
Method Detail
-
getUsername
String getUsername()
Retrieve the Redis user, used to identify the user interacting with Redis. Can be used with Redis 6 and newer server versions.- Returns:
- the user name. Can be
null
if not set. - See Also:
hasUsername()
-
hasUsername
boolean hasUsername()
Return whether the username is configured.- Returns:
true
if the username is configured;false
otherwise.
-
getPassword
char[] getPassword()
Retrieve the Redis password, used to authenticate the user interacting with Redis.- Returns:
- the password. Can be
null
if not set. - See Also:
hasUsername()
-
hasPassword
boolean hasPassword()
Return whether the password is configured.- Returns:
true
if the password is configured;false
otherwise
-
just
static RedisCredentials just(String username, CharSequence password)
- Parameters:
username
- can benull
password
- can benull
- Returns:
- the static
RedisCredentials
object fromusername
andpassword
-
just
static RedisCredentials just(String username, char[] password)
- Parameters:
username
- can benull
password
- can benull
- Returns:
- the static
RedisCredentials
object fromusername
andpassword
-
-