public class SentinelServersConfig extends BaseMasterSlaveServersConfig<SentinelServersConfig>
Constructor and Description |
---|
SentinelServersConfig() |
Modifier and Type | Method and Description |
---|---|
SentinelServersConfig |
addSentinelAddress(String... addresses)
Add Redis Sentinel node address in host:port format.
|
String |
getClientName() |
int |
getConnectTimeout() |
int |
getDatabase() |
int |
getIdleConnectionTimeout() |
String |
getMasterName() |
String |
getPassword() |
int |
getPingConnectionInterval() |
int |
getPingTimeout() |
int |
getRetryAttempts() |
int |
getRetryInterval() |
int |
getScanInterval() |
List<URI> |
getSentinelAddresses() |
URI |
getSslKeystore() |
String |
getSslKeystorePassword() |
SslProvider |
getSslProvider() |
URI |
getSslTruststore() |
String |
getSslTruststorePassword() |
int |
getSubscriptionsPerConnection() |
int |
getTimeout() |
boolean |
isKeepAlive() |
boolean |
isSslEnableEndpointIdentification() |
boolean |
isTcpNoDelay() |
T |
setClientName(String clientName)
Setup connection name during connection init
via CLIENT SETNAME command
|
T |
setConnectTimeout(int connectTimeout)
Timeout during connecting to any Redis server.
|
SentinelServersConfig |
setDatabase(int database)
Database index used for Redis connection
Default is
0 |
T |
setFailedAttempts(int slaveFailedAttempts)
Deprecated.
|
T |
setIdleConnectionTimeout(int idleConnectionTimeout)
If pooled connection not used for a
timeout time
and current connections amount bigger than minimum idle connections pool size,
then it will closed and removed from pool. |
T |
setKeepAlive(boolean keepAlive)
Enables TCP keepAlive for connection
Default is
false |
SentinelServersConfig |
setMasterName(String masterName)
Master server name used by Redis Sentinel servers and master change monitoring task.
|
T |
setPassword(String password)
Password for Redis authentication.
|
T |
setPingConnectionInterval(int pingConnectionInterval)
Defines PING command sending interval per connection to Redis.
|
T |
setPingTimeout(int pingTimeout)
Deprecated.
|
T |
setReconnectionTimeout(int slaveRetryTimeout)
Deprecated.
|
T |
setRetryAttempts(int retryAttempts)
Error will be thrown if Redis command can't be sent to Redis server after
retryAttempts . |
T |
setRetryInterval(int retryInterval)
Defines time interval for another one attempt send Redis command
if it hasn't been sent already.
|
SentinelServersConfig |
setScanInterval(int scanInterval)
Sentinel scan interval in milliseconds
|
T |
setSslEnableEndpointIdentification(boolean sslEnableEndpointIdentification)
Enables SSL endpoint identification.
|
T |
setSslKeystore(URI sslKeystore)
Defines path to SSL keystore
|
T |
setSslKeystorePassword(String sslKeystorePassword)
Defines password for SSL keystore
|
T |
setSslProvider(SslProvider sslProvider)
Defines SSL provider used to handle SSL connections.
|
T |
setSslTruststore(URI sslTruststore)
Defines path to SSL truststore
|
T |
setSslTruststorePassword(String sslTruststorePassword)
Defines password for SSL truststore
|
T |
setSubscriptionsPerConnection(int subscriptionsPerConnection)
Subscriptions per Redis connection limit
Default is 5
|
T |
setTcpNoDelay(boolean tcpNoDelay)
Enables TCP noDelay for connection
Default is
false |
T |
setTimeout(int timeout)
Redis server response timeout.
|
checkSkipSlavesInit, getDnsMonitoringInterval, getFailedSlaveCheckInterval, getFailedSlaveReconnectionInterval, getLoadBalancer, getMasterConnectionMinimumIdleSize, getMasterConnectionPoolSize, getReadMode, getSlaveConnectionMinimumIdleSize, getSlaveConnectionPoolSize, getSlaveSubscriptionConnectionMinimumIdleSize, getSlaveSubscriptionConnectionPoolSize, getSubscriptionConnectionMinimumIdleSize, getSubscriptionConnectionPoolSize, getSubscriptionMode, setDnsMonitoringInterval, setFailedSlaveCheckInterval, setFailedSlaveReconnectionInterval, setLoadBalancer, setMasterConnectionMinimumIdleSize, setMasterConnectionPoolSize, setReadMode, setSlaveConnectionMinimumIdleSize, setSlaveConnectionPoolSize, setSlaveSubscriptionConnectionMinimumIdleSize, setSlaveSubscriptionConnectionPoolSize, setSubscriptionConnectionMinimumIdleSize, setSubscriptionConnectionPoolSize, setSubscriptionMode
public SentinelServersConfig setMasterName(String masterName)
masterName
- of Redispublic String getMasterName()
public SentinelServersConfig addSentinelAddress(String... addresses)
addresses
- of Redispublic SentinelServersConfig setDatabase(int database)
0
database
- numberpublic int getDatabase()
public int getScanInterval()
public SentinelServersConfig setScanInterval(int scanInterval)
scanInterval
- in millisecondspublic T setSubscriptionsPerConnection(int subscriptionsPerConnection)
subscriptionsPerConnection
- amountpublic int getSubscriptionsPerConnection()
public T setPassword(String password)
null
password
- for connectionpublic String getPassword()
public T setRetryAttempts(int retryAttempts)
retryAttempts
.
But if it sent successfully then timeout
will be started.
Default is 3
attempts
retryAttempts
- - retry attemptstimeout
public int getRetryAttempts()
public T setRetryInterval(int retryInterval)
Default is 1500
milliseconds
retryInterval
- - time in millisecondsretryAttempts
public int getRetryInterval()
public T setTimeout(int timeout)
Default is 3000
milliseconds
timeout
- in millisecondspublic int getTimeout()
public T setClientName(String clientName)
clientName
- - name of clientpublic String getClientName()
@Deprecated public T setPingTimeout(int pingTimeout)
public int getPingTimeout()
public T setConnectTimeout(int connectTimeout)
Default is 10000
milliseconds.
connectTimeout
- - timeout in millisecondspublic int getConnectTimeout()
public T setIdleConnectionTimeout(int idleConnectionTimeout)
timeout
time
and current connections amount bigger than minimum idle connections pool size,
then it will closed and removed from pool.idleConnectionTimeout
- - timeout in millisecondspublic int getIdleConnectionTimeout()
@Deprecated public T setReconnectionTimeout(int slaveRetryTimeout)
@Deprecated public T setFailedAttempts(int slaveFailedAttempts)
public boolean isSslEnableEndpointIdentification()
public T setSslEnableEndpointIdentification(boolean sslEnableEndpointIdentification)
Default is true
sslEnableEndpointIdentification
- - boolean valuepublic SslProvider getSslProvider()
public T setSslProvider(SslProvider sslProvider)
Default is JDK
sslProvider
- - ssl providerpublic URI getSslTruststore()
public T setSslTruststore(URI sslTruststore)
sslTruststore
- - pathpublic String getSslTruststorePassword()
public T setSslTruststorePassword(String sslTruststorePassword)
sslTruststorePassword
- - passwordpublic URI getSslKeystore()
public T setSslKeystore(URI sslKeystore)
sslKeystore
- - path to keystorepublic String getSslKeystorePassword()
public T setSslKeystorePassword(String sslKeystorePassword)
sslKeystorePassword
- - passwordpublic int getPingConnectionInterval()
public T setPingConnectionInterval(int pingConnectionInterval)
0
means disable.
Default is 0
pingConnectionInterval
- - time in millisecondspublic boolean isKeepAlive()
public T setKeepAlive(boolean keepAlive)
Default is false
keepAlive
- - boolean valuepublic boolean isTcpNoDelay()
public T setTcpNoDelay(boolean tcpNoDelay)
Default is false
tcpNoDelay
- - boolean valueCopyright © 2014–2019 The Redisson Project. All rights reserved.