org.springframework.data.redis.connection.srp
Class SrpConnectionFactory

java.lang.Object
  extended by org.springframework.data.redis.connection.srp.SrpConnectionFactory
All Implemented Interfaces:
DisposableBean, InitializingBean, PersistenceExceptionTranslator, RedisConnectionFactory

public class SrpConnectionFactory
extends Object
implements InitializingBean, DisposableBean, RedisConnectionFactory

Connection factory creating Redis Protocol based connections.


Constructor Summary
SrpConnectionFactory()
          Constructs a new SRedisConnectionFactory instance with default settings.
SrpConnectionFactory(String host, int port)
          Constructs a new SRedisConnectionFactory instance with default settings.
 
Method Summary
 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.
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SrpConnectionFactory

public SrpConnectionFactory()
Constructs a new SRedisConnectionFactory instance with default settings.


SrpConnectionFactory

public SrpConnectionFactory(String host,
                            int port)
Constructs a new SRedisConnectionFactory instance with default settings.

Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface InitializingBean

destroy

public void destroy()
Specified by:
destroy in interface DisposableBean

getConnection

public RedisConnection getConnection()
Description copied from interface: RedisConnectionFactory
Provides a suitable connection for interacting with Redis.

Specified by:
getConnection in interface RedisConnectionFactory
Returns:
connection for interacting with Redis.

translateExceptionIfPossible

public DataAccessException translateExceptionIfPossible(RuntimeException ex)
Specified by:
translateExceptionIfPossible in interface PersistenceExceptionTranslator

getHostName

public String getHostName()
Returns the current host.

Returns:
the host

setHostName

public void setHostName(String host)
Sets the host.

Parameters:
host - the host to set

getPort

public int getPort()
Returns the current port.

Returns:
the port

setPort

public void setPort(int port)
Sets the port.

Parameters:
port - the port to set

getPassword

public String getPassword()
Returns the password used for authenticating with the Redis server.

Returns:
password for authentication

setPassword

public void setPassword(String password)
Sets the password used for authenticating with the Redis server.

Parameters:
password - the password to set

getConvertPipelineAndTxResults

public boolean getConvertPipelineAndTxResults()
Specifies if pipelined results should be converted to the expected data type. If false, results of SrpConnection.closePipeline() and SrpConnection.exec() will be of the type returned by the SRP driver

Specified by:
getConvertPipelineAndTxResults in interface RedisConnectionFactory
Returns:
Whether or not to convert pipeline and tx results

setConvertPipelineAndTxResults

public void setConvertPipelineAndTxResults(boolean convertPipelineAndTxResults)
Specifies if pipelined results should be converted to the expected data type. If false, results of SrpConnection.closePipeline() and SrpConnection.exec() will be of the type returned by the SRP driver

Parameters:
convertPipelineAndTxResults - Whether or not to convert pipeline and tx results