Class RedisMetadataStore
java.lang.Object
org.springframework.integration.redis.metadata.RedisMetadataStore
- All Implemented Interfaces:
- ConcurrentMetadataStore,- MetadataStore
Redis implementation of 
ConcurrentMetadataStore. Use this
 ConcurrentMetadataStore to achieve meta-data persistence across application
 restarts.
 
 This implementation is based on the RedisProperties and its
 replace(String, String, String); it can't currently be used with a Redis
 cluster because the WATCH command is not supported.
- Since:
- 3.0
- Author:
- Gunnar Hillert, Artem Bilan
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionRedisMetadataStore(RedisConnectionFactory connectionFactory) RedisMetadataStore(RedisConnectionFactory connectionFactory, String key) Initializes theRedisPropertiesby providedRedisConnectionFactoryand key.RedisMetadataStore(RedisOperations<String, ?> operations) RedisMetadataStore(RedisOperations<String, ?> operations, String key) Initializes theRedisPropertiesby providedRedisConnectionFactoryand key.RedisMetadataStore(RedisProperties properties) Specifies theRedisPropertiesbackend for thisConcurrentMetadataStore.
- 
Method SummaryModifier and TypeMethodDescriptionRetrieve the persisted value for the provided key.voidPersists the provided key and value to Redis.putIfAbsent(String key, String value) Atomically insert the key into the store.Remove a value for the given key from this MetadataStore.booleanAtomically replace the value for the key in the store if the old value matches the oldValue argument.
- 
Field Details- 
KEY- See Also:
 
 
- 
- 
Constructor Details- 
RedisMetadataStoreSpecifies theRedisPropertiesbackend for thisConcurrentMetadataStore.- Parameters:
- properties- The properties.
 
- 
RedisMetadataStore- Parameters:
- connectionFactory- The connection factory.
 
- 
RedisMetadataStoreInitializes theRedisPropertiesby providedRedisConnectionFactoryand key.- Parameters:
- connectionFactory- The connection factory.
- key- The key.
 
- 
RedisMetadataStore- Parameters:
- operations- The Redis operations object.
 
- 
RedisMetadataStoreInitializes theRedisPropertiesby providedRedisConnectionFactoryand key.- Parameters:
- operations- The Redis operations object.
- key- The key.
 
 
- 
- 
Method Details- 
putPersists the provided key and value to Redis.- Specified by:
- putin interface- MetadataStore
- Parameters:
- key- Must not be null
- value- Must not be null
 
- 
getRetrieve the persisted value for the provided key.- Specified by:
- getin interface- MetadataStore
- Parameters:
- key- Must not be null
- Returns:
- The value.
 
- 
removeDescription copied from interface:MetadataStoreRemove a value for the given key from this MetadataStore.- Specified by:
- removein interface- MetadataStore
- Parameters:
- key- The key.
- Returns:
- The previous value associated with key, or null if there was no mapping for key.
 
- 
putIfAbsentDescription copied from interface:ConcurrentMetadataStoreAtomically insert the key into the store.- Specified by:
- putIfAbsentin interface- ConcurrentMetadataStore
- Parameters:
- key- The key.
- value- The value.
- Returns:
- null if successful, the old value otherwise.
 
- 
replaceDescription copied from interface:ConcurrentMetadataStoreAtomically replace the value for the key in the store if the old value matches the oldValue argument.- Specified by:
- replacein interface- ConcurrentMetadataStore
- Parameters:
- key- The key.
- oldValue- The old value.
- newValue- The new value.
- Returns:
- true if successful.
 
 
-