Class SimpleMetadataStore
java.lang.Object
org.springframework.integration.metadata.SimpleMetadataStore
- All Implemented Interfaces:
- ConcurrentMetadataStore,- MetadataStore
Simple implementation of 
MetadataStore that uses a ConcurrentMap for the data store.
 The metadata may not be persisted across application restarts, if the provided ConcurrentMap
 is an in-memory instance.- Since:
- 2.0
- Author:
- Mark Fisher, Gary Russell, Artem Bilan
- 
Constructor SummaryConstructorsConstructorDescriptionInstantiate aSimpleMetadataStoreusing an in-memoryConcurrentHashMap.SimpleMetadataStore(ConcurrentMap<String, String> metadata) Instantiate aSimpleMetadataStoreusing the providedConcurrentMap.
- 
Method SummaryModifier and TypeMethodDescriptionReads a value for the given key from this MetadataStore.voidWrites a key value pair to this MetadataStore.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.
- 
Constructor Details- 
SimpleMetadataStorepublic SimpleMetadataStore()Instantiate aSimpleMetadataStoreusing an in-memoryConcurrentHashMap.
- 
SimpleMetadataStoreInstantiate aSimpleMetadataStoreusing the providedConcurrentMap. The implementation may be a distributed map provided by projects such as Redis and Hazelcast.- Parameters:
- metadata- the- ConcurrentMapinstance for metadata.
- Since:
- 4.1.4
 
 
- 
- 
Method Details- 
putDescription copied from interface:MetadataStoreWrites a key value pair to this MetadataStore.- Specified by:
- putin interface- MetadataStore
- Parameters:
- key- The key.
- value- The value.
 
- 
getDescription copied from interface:MetadataStoreReads a value for the given key from this MetadataStore.- Specified by:
- getin interface- MetadataStore
- Parameters:
- key- The key.
- 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.
 
 
-