public class MasterSlaveServersConfig extends BaseMasterSlaveServersConfig<MasterSlaveServersConfig>
Constructor and Description |
---|
MasterSlaveServersConfig() |
Modifier and Type | Method and Description |
---|---|
MasterSlaveServersConfig |
addSlaveAddress(String... addresses)
Add Redis slave server address.
|
MasterSlaveServersConfig |
addSlaveAddress(String slaveAddress) |
String |
getClientName() |
int |
getConnectTimeout() |
int |
getDatabase() |
int |
getIdleConnectionTimeout() |
String |
getMasterAddress() |
String |
getPassword() |
int |
getPingConnectionInterval() |
int |
getPingTimeout() |
int |
getRetryAttempts() |
int |
getRetryInterval() |
Set<String> |
getSlaveAddresses() |
URL |
getSslKeystore() |
String |
getSslKeystorePassword() |
SslProvider |
getSslProvider() |
URL |
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.
|
MasterSlaveServersConfig |
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 |
MasterSlaveServersConfig |
setMasterAddress(String masterAddress)
Set Redis master server address.
|
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.
|
void |
setSlaveAddresses(Set<String> readAddresses) |
T |
setSslEnableEndpointIdentification(boolean sslEnableEndpointIdentification)
Enables SSL endpoint identification.
|
T |
setSslKeystore(URL 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(URL 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 MasterSlaveServersConfig setMasterAddress(String masterAddress)
masterAddress
- of Redispublic String getMasterAddress()
public MasterSlaveServersConfig addSlaveAddress(String... addresses)
addresses
- of Redispublic MasterSlaveServersConfig addSlaveAddress(String slaveAddress)
public MasterSlaveServersConfig setDatabase(int database)
0
database
- numberpublic int getDatabase()
public 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 millisecondspublic 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.
Default is 10000
milliseconds.
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 URL getSslTruststore()
public T setSslTruststore(URL sslTruststore)
sslTruststore
- - pathpublic String getSslTruststorePassword()
public T setSslTruststorePassword(String sslTruststorePassword)
sslTruststorePassword
- - passwordpublic URL getSslKeystore()
public T setSslKeystore(URL 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–2020 Redisson. All rights reserved.