T
- config typepublic class BaseConfig<T extends BaseConfig<T>> extends Object
Modifier and Type | Method and Description |
---|---|
String |
getClientName() |
int |
getConnectTimeout() |
int |
getIdleConnectionTimeout() |
String |
getPassword() |
int |
getPingConnectionInterval() |
int |
getRetryAttempts() |
int |
getRetryInterval() |
URL |
getSslKeystore() |
String |
getSslKeystorePassword() |
SslProvider |
getSslProvider() |
URL |
getSslTruststore() |
String |
getSslTruststorePassword() |
int |
getSubscriptionsPerConnection() |
int |
getTimeout() |
String |
getUsername() |
boolean |
isKeepAlive() |
boolean |
isSslEnableEndpointIdentification() |
boolean |
isTcpNoDelay() |
T |
setClientName(String clientName)
Setup connection name during connection init
via CLIENT SETNAME command
Default is
null |
T |
setConnectTimeout(int connectTimeout)
Timeout during connecting to any Redis server.
|
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 |
T |
setPassword(String password)
Password for Redis authentication.
|
T |
setPingConnectionInterval(int pingConnectionInterval)
Defines PING command sending interval per connection to Redis.
|
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.
|
T |
setSslEnableEndpointIdentification(boolean sslEnableEndpointIdentification)
Enables SSL endpoint identification.
|
T |
setSslKeystore(URL sslKeystore)
Defines path to SSL keystore
Default is
null |
T |
setSslKeystorePassword(String sslKeystorePassword)
Defines password for SSL keystore
Default is
null |
T |
setSslProvider(SslProvider sslProvider)
Defines SSL provider used to handle SSL connections.
|
T |
setSslTruststore(URL sslTruststore)
Defines path to SSL truststore
Default is
null |
T |
setSslTruststorePassword(String sslTruststorePassword)
Defines password for SSL truststore
Default is
null |
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.
|
T |
setUsername(String username)
Username for Redis authentication.
|
public T setSubscriptionsPerConnection(int subscriptionsPerConnection)
Default is 5
subscriptionsPerConnection
- amountpublic int getSubscriptionsPerConnection()
public T setPassword(String password)
Default is null
password
- for connectionpublic String getPassword()
public T setUsername(String username)
Default is null
Requires Redis 6.0+
username
- for connectionpublic String getUsername()
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)
Default is null
clientName
- - name of clientpublic String getClientName()
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()
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)
Default is null
sslTruststore
- - pathpublic String getSslTruststorePassword()
public T setSslTruststorePassword(String sslTruststorePassword)
Default is null
sslTruststorePassword
- - passwordpublic URL getSslKeystore()
public T setSslKeystore(URL sslKeystore)
Default is null
sslKeystore
- - path to keystorepublic String getSslKeystorePassword()
public T setSslKeystorePassword(String sslKeystorePassword)
Default is null
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.