public class SrpConnectionFactory extends Object implements InitializingBean, DisposableBean, RedisConnectionFactory
Constructor and Description |
---|
SrpConnectionFactory()
Constructs a new
SRedisConnectionFactory instance with default settings. |
SrpConnectionFactory(String host,
int port)
Constructs a new
SRedisConnectionFactory instance with default settings. |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
destroy() |
RedisConnection |
getConnection()
Provides a suitable connection for interacting with Redis.
|
boolean |
getConvertPipelineAndTxResults()
Specifies if pipelined results should be converted to the expected data type.
|
String |
getHostName()
Returns the current host.
|
String |
getPassword()
Returns the password used for authenticating with the Redis server.
|
int |
getPort()
Returns the current port.
|
RedisSentinelConnection |
getSentinelConnection() |
void |
setConvertPipelineAndTxResults(boolean convertPipelineAndTxResults)
Specifies if pipelined results should be converted to the expected data type.
|
void |
setHostName(String host)
Sets the host.
|
void |
setPassword(String password)
Sets the password used for authenticating with the Redis server.
|
void |
setPort(int port)
Sets the port.
|
DataAccessException |
translateExceptionIfPossible(RuntimeException ex) |
public SrpConnectionFactory()
SRedisConnectionFactory
instance with default settings.public SrpConnectionFactory(String host, int port)
SRedisConnectionFactory
instance with default settings.public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
public void destroy()
destroy
in interface DisposableBean
public RedisConnection getConnection()
RedisConnectionFactory
getConnection
in interface RedisConnectionFactory
public DataAccessException translateExceptionIfPossible(RuntimeException ex)
translateExceptionIfPossible
in interface PersistenceExceptionTranslator
public String getHostName()
public void setHostName(String host)
host
- the host to setpublic int getPort()
public void setPort(int port)
port
- the port to setpublic String getPassword()
public void setPassword(String password)
password
- the password to setpublic boolean getConvertPipelineAndTxResults()
SrpConnection.closePipeline()
and SrpConnection.exec()
will be of the type returned by the SRP
drivergetConvertPipelineAndTxResults
in interface RedisConnectionFactory
public void setConvertPipelineAndTxResults(boolean convertPipelineAndTxResults)
SrpConnection.closePipeline()
and SrpConnection.exec()
will be of the type returned by the SRP
driverconvertPipelineAndTxResults
- Whether or not to convert pipeline and tx resultspublic RedisSentinelConnection getSentinelConnection()
getSentinelConnection
in interface RedisConnectionFactory