Class GemfireMetadataStore
java.lang.Object
org.springframework.integration.gemfire.metadata.GemfireMetadataStore
- All Implemented Interfaces:
ConcurrentMetadataStore,ListenableMetadataStore,MetadataStore
public class GemfireMetadataStore extends Object implements ListenableMetadataStore
Gemfire implementation of
ListenableMetadataStore.
Use this MetadataStore
to achieve meta-data persistence shared across application instances and
restarts.- Since:
- 4.0
- Author:
- Artem Bilan, Venil Noronha, Gary Russell
-
Field Summary
-
Constructor Summary
Constructors Constructor Description GemfireMetadataStore(org.apache.geode.cache.Cache cache)GemfireMetadataStore(org.apache.geode.cache.Region<String,String> region) -
Method Summary
Modifier and Type Method Description voidaddListener(MetadataStoreListener listener)Registers a listener with the metadata storeStringget(String key)Reads a value for the given key from this MetadataStore.voidput(String key, String value)Writes a key value pair to this MetadataStore.StringputIfAbsent(String key, String value)Atomically insert the key into the store.Stringremove(String key)Remove a value for the given key from this MetadataStore.voidremoveListener(MetadataStoreListener listener)Unregisters a listenerbooleanreplace(String key, String oldValue, String newValue)Atomically replace the value for the key in the store if the old value matches the oldValue argument.
-
Field Details
-
KEY
- See Also:
- Constant Field Values
-
-
Constructor Details
-
GemfireMetadataStore
public GemfireMetadataStore(org.apache.geode.cache.Cache cache) -
GemfireMetadataStore
-
-
Method Details
-
put
Description copied from interface:MetadataStoreWrites a key value pair to this MetadataStore.- Specified by:
putin interfaceMetadataStore- Parameters:
key- The key.value- The value.
-
putIfAbsent
Description copied from interface:ConcurrentMetadataStoreAtomically insert the key into the store.- Specified by:
putIfAbsentin interfaceConcurrentMetadataStore- Parameters:
key- The key.value- The value.- Returns:
- null if successful, the old value otherwise.
-
replace
Description copied from interface:ConcurrentMetadataStoreAtomically replace the value for the key in the store if the old value matches the oldValue argument.- Specified by:
replacein interfaceConcurrentMetadataStore- Parameters:
key- The key.oldValue- The old value.newValue- The new value.- Returns:
- true if successful.
-
get
Description copied from interface:MetadataStoreReads a value for the given key from this MetadataStore.- Specified by:
getin interfaceMetadataStore- Parameters:
key- The key.- Returns:
- The value.
-
remove
Description copied from interface:MetadataStoreRemove a value for the given key from this MetadataStore.- Specified by:
removein interfaceMetadataStore- Parameters:
key- The key.- Returns:
- The previous value associated with key, or null if there was no mapping for key.
-
addListener
Description copied from interface:ListenableMetadataStoreRegisters a listener with the metadata store- Specified by:
addListenerin interfaceListenableMetadataStore- Parameters:
listener- the callback to be registered
-
removeListener
Description copied from interface:ListenableMetadataStoreUnregisters a listener- Specified by:
removeListenerin interfaceListenableMetadataStore- Parameters:
listener- the callback to be unregistered
-