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.
 String getHostName()
          Returns the current host.
 int getPort()
          Returns the current port.
 void setHostName(String host)
          Sets the host.
 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