Interface RedisConnectionFactory

All Superinterfaces:
PersistenceExceptionTranslator
All Known Implementing Classes:
JedisConnectionFactory, LettuceConnectionFactory

public interface RedisConnectionFactory extends PersistenceExceptionTranslator
Thread-safe factory of Redis connections.
Author:
Costin Leau, Christoph Strobl, John Blum
  • Method Details

    • getConvertPipelineAndTxResults

      boolean getConvertPipelineAndTxResults()
      Specifies if pipelined results should be converted to the expected data type.

      If false, results of RedisConnection.closePipeline() and RedisTxCommands.exec() will be of the type returned by the underlying driver. This method is mostly for backwards compatibility with 1.0. It is generally always a good idea to allow results to be converted and deserialized. In fact, this is now the default behavior.

      Returns:
      true to convert pipeline and transaction results; false otherwise.
    • getConnection

      RedisConnection getConnection()
      Returns a suitable connection for interacting with Redis.
      Returns:
      connection for interacting with Redis.
      Throws:
      IllegalStateException - if the connection factory requires initialization and the factory has not yet been initialized.
    • getClusterConnection

      RedisClusterConnection getClusterConnection()
      Returns a suitable connection for interacting with Redis Cluster.
      Returns:
      a connection for interacting with Redis Cluster.
      Throws:
      IllegalStateException - if the connection factory requires initialization and the factory has not yet been initialized.
      Since:
      1.7
    • getSentinelConnection

      RedisSentinelConnection getSentinelConnection()
      Returns a suitable connection for interacting with Redis Sentinel.
      Returns:
      a connection for interacting with Redis Sentinel.
      Throws:
      IllegalStateException - if the connection factory requires initialization and the factory has not yet been initialized.
      Since:
      1.4