Class SentinelServersConfig


public class SentinelServersConfig extends BaseMasterSlaveServersConfig<SentinelServersConfig>
Author:
Nikita Koksharov
  • Constructor Details

    • SentinelServersConfig

      public SentinelServersConfig()
  • Method Details

    • setMasterName

      public SentinelServersConfig setMasterName(String masterName)
      Master server name used by Redis Sentinel servers and master change monitoring task.
      Parameters:
      masterName - of Redis
      Returns:
      config
    • getMasterName

      public String getMasterName()
    • setSentinelUsername

      public SentinelServersConfig setSentinelUsername(String sentinelUsername)
      Username required by the Redis Sentinel servers for authentication.
      Parameters:
      sentinelUsername - of Redis
      Returns:
      config
    • getSentinelUsername

      public String getSentinelUsername()
    • setSentinelPassword

      public SentinelServersConfig setSentinelPassword(String sentinelPassword)
      Password required by the Redis Sentinel servers for authentication. Used only if sentinel password differs from master and slave.
      Parameters:
      sentinelPassword - of Redis
      Returns:
      config
    • getSentinelPassword

      public String getSentinelPassword()
    • addSentinelAddress

      public SentinelServersConfig addSentinelAddress(String... addresses)
      Add Redis Sentinel node address in host:port format. Multiple nodes at once could be added.
      Parameters:
      addresses - of Redis
      Returns:
      config
    • getSentinelAddresses

      public List<String> getSentinelAddresses()
    • setSentinelAddresses

      public void setSentinelAddresses(List<String> sentinelAddresses)
    • setDatabase

      public SentinelServersConfig setDatabase(int database)
      Database index used for Redis connection Default is 0
      Parameters:
      database - number
      Returns:
      config
    • getDatabase

      public int getDatabase()
    • getScanInterval

      public int getScanInterval()
    • setScanInterval

      public SentinelServersConfig setScanInterval(int scanInterval)
      Sentinel scan interval in milliseconds

      Default is 1000

      Parameters:
      scanInterval - in milliseconds
      Returns:
      config
    • setNatMap

      @Deprecated public SentinelServersConfig setNatMap(Map<String,String> natMap)
      Deprecated.
    • getNatMapper

      public NatMapper getNatMapper()
    • setNatMapper

      public SentinelServersConfig setNatMapper(NatMapper natMapper)
      Defines NAT mapper which maps Redis URI object. Applied to all Redis connections.
      Parameters:
      natMapper - - nat mapper object
      Returns:
      config
      See Also:
    • isCheckSentinelsList

      public boolean isCheckSentinelsList()
    • setCheckSentinelsList

      public SentinelServersConfig setCheckSentinelsList(boolean checkSentinelsList)
      Enables sentinels list check during Redisson startup.

      Default is true

      Parameters:
      checkSentinelsList - - boolean value
      Returns:
      config
    • isCheckSlaveStatusWithSyncing

      public boolean isCheckSlaveStatusWithSyncing()
    • setCheckSlaveStatusWithSyncing

      public SentinelServersConfig setCheckSlaveStatusWithSyncing(boolean checkSlaveStatusWithSyncing)
      check node status from sentinel with 'master-link-status' flag

      Default is true

      Parameters:
      checkSlaveStatusWithSyncing - - boolean value
      Returns:
      config
    • isSentinelsDiscovery

      public boolean isSentinelsDiscovery()
    • setSentinelsDiscovery

      public SentinelServersConfig setSentinelsDiscovery(boolean sentinelsDiscovery)
      Enables sentinels discovery.

      Default is true

      Parameters:
      sentinelsDiscovery - - boolean value
      Returns:
      config