public class RedisMetadataStore
extends java.lang.Object
implements org.springframework.integration.metadata.ConcurrentMetadataStore
MetadataStore. Use this MetadataStore 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.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
KEY |
| Constructor and Description |
|---|
RedisMetadataStore(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
|
RedisMetadataStore(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
java.lang.String key)
Initializes the
RedisProperties by provided RedisConnectionFactory and key. |
RedisMetadataStore(org.springframework.data.redis.core.RedisOperations<java.lang.String,?> operations)
|
RedisMetadataStore(org.springframework.data.redis.core.RedisOperations<java.lang.String,?> operations,
java.lang.String key)
Initializes the
RedisProperties by provided RedisConnectionFactory and key. |
RedisMetadataStore(org.springframework.data.redis.support.collections.RedisProperties properties)
Specifies the
RedisProperties backend for this MetadataStore. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
get(java.lang.String key)
Retrieve the persisted value for the provided key.
|
void |
put(java.lang.String key,
java.lang.String value)
Persists the provided key and value to Redis.
|
java.lang.String |
putIfAbsent(java.lang.String key,
java.lang.String value) |
java.lang.String |
remove(java.lang.String key) |
boolean |
replace(java.lang.String key,
java.lang.String oldValue,
java.lang.String newValue) |
public static final java.lang.String KEY
public RedisMetadataStore(org.springframework.data.redis.support.collections.RedisProperties properties)
RedisProperties backend for this MetadataStore.properties - The properties.public RedisMetadataStore(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
connectionFactory - The connection factory.public RedisMetadataStore(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
java.lang.String key)
RedisProperties by provided RedisConnectionFactory and key.connectionFactory - The connection factory.key - The key.public RedisMetadataStore(org.springframework.data.redis.core.RedisOperations<java.lang.String,?> operations)
operations - The Redis operations object.public RedisMetadataStore(org.springframework.data.redis.core.RedisOperations<java.lang.String,?> operations,
java.lang.String key)
RedisProperties by provided RedisConnectionFactory and key.operations - The Redis operations object.key - The key.public void put(java.lang.String key,
java.lang.String value)
put in interface org.springframework.integration.metadata.MetadataStorekey - Must not be nullvalue - Must not be nullpublic java.lang.String get(java.lang.String key)
get in interface org.springframework.integration.metadata.MetadataStorekey - Must not be nullpublic java.lang.String remove(java.lang.String key)
remove in interface org.springframework.integration.metadata.MetadataStorepublic java.lang.String putIfAbsent(java.lang.String key,
java.lang.String value)
putIfAbsent in interface org.springframework.integration.metadata.ConcurrentMetadataStorepublic boolean replace(java.lang.String key,
java.lang.String oldValue,
java.lang.String newValue)
replace in interface org.springframework.integration.metadata.ConcurrentMetadataStore