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 Details

    • setMaster

      default void setMaster(String name)
      Set the name of the master node.
      Parameters:
      name - must not be null.
    • setMaster

      void setMaster(NamedNode master)
      Set the master node.
      Parameters:
      master - must not be null.
    • getMaster

      @Nullable NamedNode getMaster()
      Get the Sentinel master node.
      Returns:
      get the master node or null if not set.
    • getSentinels

      Set<RedisNode> getSentinels()
      Returns an Collections.unmodifiableSet(Set) of Sentinels.
      Returns:
      Set of sentinels. Never null.
    • getDataNodeUsername

      @Nullable default String getDataNodeUsername()
      Get the username used when authenticating with a Redis Server.
      Returns:
      can be null if not set.
      Since:
      2.4
    • getDataNodePassword

      default RedisPassword getDataNodePassword()
      Get the RedisPassword used when authenticating with a Redis Server.
      Returns:
      never null.
      Since:
      2.2.2
    • setSentinelUsername

      void setSentinelUsername(@Nullable String sentinelUsername)
      Create and set a username with the given String. Requires Redis 6 or newer.
      Parameters:
      sentinelUsername - the username for sentinel.
      Since:
      2.7
    • getSentinelUsername

      @Nullable String getSentinelUsername()
      Get the username to use when connecting.
      Returns:
      null if none set.
      Since:
      2.7
    • setSentinelPassword

      default void setSentinelPassword(@Nullable String password)
      Create and set a RedisPassword to be used when authenticating with Redis Sentinel from the given String.
      Parameters:
      password - can be null.
      Since:
      2.2.2
    • setSentinelPassword

      default void setSentinelPassword(@Nullable char[] password)
      Create and set a RedisPassword to be used when authenticating with Redis Sentinel from the given Character sequence.
      Parameters:
      password - can be null.
      Since:
      2.2.2
    • setSentinelPassword

      void setSentinelPassword(RedisPassword password)
      Set a RedisPassword to be used when authenticating with Redis Sentinel.
      Parameters:
      password - must not be null use RedisPassword.none() instead.
      Since:
      2.2.2
    • getSentinelPassword

      RedisPassword getSentinelPassword()
      Returns the RedisPassword to use when connecting to a Redis Sentinel.
      Can be set via setSentinelPassword(RedisPassword) or RedisPassword.none() if no password has been set.
      Returns:
      the RedisPassword for authenticating with Redis Sentinel.
      Since:
      2.2.2