Package org.redisson.config
Class SentinelServersConfig
- java.lang.Object
-
- org.redisson.config.BaseConfig<T>
-
- org.redisson.config.BaseMasterSlaveServersConfig<SentinelServersConfig>
-
- org.redisson.config.SentinelServersConfig
-
public class SentinelServersConfig extends BaseMasterSlaveServersConfig<SentinelServersConfig>
- Author:
- Nikita Koksharov
-
-
Constructor Summary
Constructors Constructor Description SentinelServersConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SentinelServersConfig
addSentinelAddress(String... addresses)
Add Redis Sentinel node address in host:port format.int
getDatabase()
String
getMasterName()
NatMapper
getNatMapper()
int
getScanInterval()
List<String>
getSentinelAddresses()
String
getSentinelPassword()
boolean
isCheckSentinelsList()
boolean
isCheckSlaveStatusWithSyncing()
SentinelServersConfig
setCheckSentinelsList(boolean checkSentinelsList)
Enables sentinels list check during Redisson startup.SentinelServersConfig
setCheckSlaveStatusWithSyncing(boolean checkSlaveStatusWithSyncing)
check node status from sentinel with 'master-link-status' flagSentinelServersConfig
setDatabase(int database)
Database index used for Redis connection Default is0
SentinelServersConfig
setMasterName(String masterName)
Master server name used by Redis Sentinel servers and master change monitoring task.SentinelServersConfig
setNatMap(Map<String,String> natMap)
Deprecated.SentinelServersConfig
setNatMapper(NatMapper natMapper)
Defines NAT mapper which maps Redis URI object.SentinelServersConfig
setScanInterval(int scanInterval)
Sentinel scan interval in millisecondsvoid
setSentinelAddresses(List<String> sentinelAddresses)
SentinelServersConfig
setSentinelPassword(String sentinelPassword)
Password required by the Redis Sentinel servers for authentication.-
Methods inherited from class org.redisson.config.BaseMasterSlaveServersConfig
checkSkipSlavesInit, getDnsMonitoringInterval, getFailedSlaveCheckInterval, getFailedSlaveReconnectionInterval, getLoadBalancer, getMasterConnectionMinimumIdleSize, getMasterConnectionPoolSize, getReadMode, getSlaveConnectionMinimumIdleSize, getSlaveConnectionPoolSize, getSubscriptionConnectionMinimumIdleSize, getSubscriptionConnectionPoolSize, getSubscriptionMode, setDnsMonitoringInterval, setFailedSlaveCheckInterval, setFailedSlaveReconnectionInterval, setLoadBalancer, setMasterConnectionMinimumIdleSize, setMasterConnectionPoolSize, setReadMode, setSlaveConnectionMinimumIdleSize, setSlaveConnectionPoolSize, setSubscriptionConnectionMinimumIdleSize, setSubscriptionConnectionPoolSize, setSubscriptionMode
-
Methods inherited from class org.redisson.config.BaseConfig
getClientName, getConnectTimeout, getIdleConnectionTimeout, getNameMapper, getPassword, getPingConnectionInterval, getRetryAttempts, getRetryInterval, getSslKeystore, getSslKeystorePassword, getSslProtocols, getSslProvider, getSslTruststore, getSslTruststorePassword, getSubscriptionsPerConnection, getTimeout, getUsername, isKeepAlive, isSslEnableEndpointIdentification, isTcpNoDelay, setClientName, setConnectTimeout, setIdleConnectionTimeout, setKeepAlive, setNameMapper, setPassword, setPingConnectionInterval, setRetryAttempts, setRetryInterval, setSslEnableEndpointIdentification, setSslKeystore, setSslKeystorePassword, setSslProtocols, setSslProvider, setSslTruststore, setSslTruststorePassword, setSubscriptionsPerConnection, setTcpNoDelay, setTimeout, setUsername
-
-
-
-
Method Detail
-
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()
-
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
-
setDatabase
public SentinelServersConfig setDatabase(int database)
Database index used for Redis connection Default is0
- Parameters:
database
- number- Returns:
- config
-
getDatabase
public int getDatabase()
-
getScanInterval
public int getScanInterval()
-
setScanInterval
public SentinelServersConfig setScanInterval(int scanInterval)
Sentinel scan interval in millisecondsDefault 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:
HostNatMapper
,HostPortNatMapper
-
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' flagDefault is
true
- Parameters:
checkSlaveStatusWithSyncing
- - boolean value- Returns:
- config
-
-