Spring Data Key-Value

org.springframework.data.keyvalue.redis.core
Class StringRedisTemplate

java.lang.Object
  extended by org.springframework.data.keyvalue.redis.core.RedisAccessor
      extended by org.springframework.data.keyvalue.redis.core.RedisTemplate<String,String>
          extended by org.springframework.data.keyvalue.redis.core.StringRedisTemplate
All Implemented Interfaces:
InitializingBean, RedisOperations<String,String>

public class StringRedisTemplate
extends RedisTemplate<String,String>

String-focused extension of RedisTemplate. Since most operations against Redis are String based, this class provides a dedicated class that minimizes configuration of its more generic template especially in terms of serializers.

Note that this template exposes the RedisConnection used by the RedisCallback as a StringRedisConnection.

Author:
Costin Leau

Field Summary
 
Fields inherited from class org.springframework.data.keyvalue.redis.core.RedisAccessor
logger
 
Constructor Summary
StringRedisTemplate()
          Constructs a new StringRedisTemplate instance.
StringRedisTemplate(RedisConnectionFactory connectionFactory)
          Constructs a new StringRedisTemplate instance.
 
Method Summary
protected  RedisConnection preProcessConnection(RedisConnection connection, boolean existingConnection)
          Processes the connection (before any settings are executed on it).
 
Methods inherited from class org.springframework.data.keyvalue.redis.core.RedisTemplate
afterPropertiesSet, boundHashOps, boundListOps, boundSetOps, boundValueOps, boundZSetOps, convertAndSend, createRedisConnectionProxy, delete, discard, exec, execute, execute, execute, execute, execute, execute, expire, expireAt, getDefaultSerializer, getExpire, getKeySerializer, getValueSerializer, hasKey, isExposeConnection, keys, multi, opsForHash, opsForList, opsForSet, opsForValue, opsForZSet, persist, postProcessResult, randomKey, rename, renameIfAbsent, setDefaultSerializer, setExposeConnection, setHashKeySerializer, setHashValueSerializer, setKeySerializer, setStringSerializer, setValueSerializer, sort, sort, type, unwatch, watch
 
Methods inherited from class org.springframework.data.keyvalue.redis.core.RedisAccessor
getConnectionFactory, setConnectionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringRedisTemplate

public StringRedisTemplate()
Constructs a new StringRedisTemplate instance.


StringRedisTemplate

public StringRedisTemplate(RedisConnectionFactory connectionFactory)
Constructs a new StringRedisTemplate instance.

Parameters:
connectionFactory - connection factory for creating new connections
Method Detail

preProcessConnection

protected RedisConnection preProcessConnection(RedisConnection connection,
                                               boolean existingConnection)
Description copied from class: RedisTemplate
Processes the connection (before any settings are executed on it). Default implementation returns the connection as is.

Overrides:
preProcessConnection in class RedisTemplate<String,String>
Parameters:
connection - redis connection

Spring Data Key-Value

Copyright © 2010-2011 SpringSource. All Rights Reserved.