org.springframework.datastore.redis
Class RedisDatastore

java.lang.Object
  extended by org.springframework.datastore.core.AbstractDatastore
      extended by org.springframework.datastore.redis.RedisDatastore
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, Datastore, EntityInterceptorAware

public class RedisDatastore
extends AbstractDatastore
implements org.springframework.beans.factory.InitializingBean

A Datastore implementation for the Redis key/value datastore

Since:
1.0

Field Summary
static String CONFIG_HOST
           
static String CONFIG_PASSWORD
           
static String CONFIG_PORT
           
static String CONFIG_TIMEOUT
           
static String DEFAULT_HOST
           
static int DEFAULT_PORT
           
 
Fields inherited from class org.springframework.datastore.core.AbstractDatastore
connectionDetails, interceptors, mappingContext
 
Constructor Summary
RedisDatastore()
           
RedisDatastore(MappingContext mappingContext)
           
RedisDatastore(MappingContext mappingContext, Map<String,String> connectionDetails)
           
 
Method Summary
 void afterPropertiesSet()
           
protected  Session createSession(Map<String,String> connectionDetails)
          Creates the native session
 void setBackgroundIndex(boolean backgroundIndex)
          Sets whether the Redis datastore should create indices in the background instead of on startup
 
Methods inherited from class org.springframework.datastore.core.AbstractDatastore
addEntityInterceptor, bindSession, clearCurrentConnection, connect, connect, getCurrentSession, getMappingContext, retrieveSession, setConnectionDetails, setEntityInterceptors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_HOST

public static final String CONFIG_HOST
See Also:
Constant Field Values

CONFIG_TIMEOUT

public static final String CONFIG_TIMEOUT
See Also:
Constant Field Values

CONFIG_PORT

public static final String CONFIG_PORT
See Also:
Constant Field Values

CONFIG_PASSWORD

public static final String CONFIG_PASSWORD
See Also:
Constant Field Values

DEFAULT_HOST

public static final String DEFAULT_HOST
See Also:
Constant Field Values

DEFAULT_PORT

public static final int DEFAULT_PORT
See Also:
Constant Field Values
Constructor Detail

RedisDatastore

public RedisDatastore()

RedisDatastore

public RedisDatastore(MappingContext mappingContext)

RedisDatastore

public RedisDatastore(MappingContext mappingContext,
                      Map<String,String> connectionDetails)
Method Detail

setBackgroundIndex

public void setBackgroundIndex(boolean backgroundIndex)
Sets whether the Redis datastore should create indices in the background instead of on startup

Parameters:
backgroundIndex - True to create indices in the background

createSession

protected Session createSession(Map<String,String> connectionDetails)
Description copied from class: AbstractDatastore
Creates the native session

Specified by:
createSession in class AbstractDatastore
Parameters:
connectionDetails - The session details
Returns:
The session object

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception