Class SimpleMetadataStore

java.lang.Object
org.springframework.integration.metadata.SimpleMetadataStore
All Implemented Interfaces:
ConcurrentMetadataStore, MetadataStore

public class SimpleMetadataStore extends Object implements ConcurrentMetadataStore
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 Details

  • Method Details

    • put

      public void put(String key, String value)
      Description copied from interface: MetadataStore
      Writes a key value pair to this MetadataStore.
      Specified by:
      put in interface MetadataStore
      Parameters:
      key - The key.
      value - The value.
    • get

      public String get(String key)
      Description copied from interface: MetadataStore
      Reads a value for the given key from this MetadataStore.
      Specified by:
      get in interface MetadataStore
      Parameters:
      key - The key.
      Returns:
      The value.
    • remove

      public String remove(String key)
      Description copied from interface: MetadataStore
      Remove a value for the given key from this MetadataStore.
      Specified by:
      remove in interface MetadataStore
      Parameters:
      key - The key.
      Returns:
      The previous value associated with key, or null if there was no mapping for key.
    • putIfAbsent

      public String putIfAbsent(String key, String value)
      Description copied from interface: ConcurrentMetadataStore
      Atomically insert the key into the store.
      Specified by:
      putIfAbsent in interface ConcurrentMetadataStore
      Parameters:
      key - The key.
      value - The value.
      Returns:
      null if successful, the old value otherwise.
    • replace

      public boolean replace(String key, String oldValue, String newValue)
      Description copied from interface: ConcurrentMetadataStore
      Atomically replace the value for the key in the store if the old value matches the oldValue argument.
      Specified by:
      replace in interface ConcurrentMetadataStore
      Parameters:
      key - The key.
      oldValue - The old value.
      newValue - The new value.
      Returns:
      true if successful.