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 Details

    • setUsername

      void setUsername(@Nullable String username)
      Create and set a username with the given String. Requires Redis 6 or newer.
      Parameters:
      username - the username.
    • setPassword

      default void setPassword(@Nullable String password)
      Create and set a RedisPassword for given String.
      Parameters:
      password - can be null.
    • setPassword

      default void setPassword(@Nullable char[] password)
      Create and set a RedisPassword for given String.
      Parameters:
      password - can be null.
    • setPassword

      void setPassword(RedisPassword password)
      Create and set a RedisPassword for given String.
      Parameters:
      password - must not be null use RedisPassword.none() instead.
    • getUsername

      @Nullable String 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.