Class ZookeeperMetadataStore

java.lang.Object
org.springframework.integration.zookeeper.metadata.ZookeeperMetadataStore
All Implemented Interfaces:
org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, org.springframework.integration.metadata.ConcurrentMetadataStore, org.springframework.integration.metadata.ListenableMetadataStore, org.springframework.integration.metadata.MetadataStore

public class ZookeeperMetadataStore extends Object implements org.springframework.integration.metadata.ListenableMetadataStore, org.springframework.context.SmartLifecycle
Zookeeper-based ListenableMetadataStore based on a Zookeeper node. Values are stored in the children node, the names of which are stored as keys.
Since:
4.2
  • Constructor Details

    • ZookeeperMetadataStore

      public ZookeeperMetadataStore(org.apache.curator.framework.CuratorFramework client)
  • Method Details

    • setEncoding

      public void setEncoding(String encoding)
      Encoding to use when storing data in ZooKeeper
      Parameters:
      encoding - encoding as text
    • setRoot

      public void setRoot(String root)
      Root node - store entries are children of this node.
      Parameters:
      root - encoding as text
    • getRoot

      public String getRoot()
    • setAutoStartup

      public void setAutoStartup(boolean autoStartup)
    • setPhase

      public void setPhase(int phase)
    • putIfAbsent

      public String putIfAbsent(String key, String value)
      Specified by:
      putIfAbsent in interface org.springframework.integration.metadata.ConcurrentMetadataStore
    • replace

      public boolean replace(String key, String oldValue, String newValue)
      Specified by:
      replace in interface org.springframework.integration.metadata.ConcurrentMetadataStore
    • addListener

      public void addListener(org.springframework.integration.metadata.MetadataStoreListener listener)
      Specified by:
      addListener in interface org.springframework.integration.metadata.ListenableMetadataStore
    • removeListener

      public void removeListener(org.springframework.integration.metadata.MetadataStoreListener callback)
      Specified by:
      removeListener in interface org.springframework.integration.metadata.ListenableMetadataStore
    • put

      public void put(String key, String value)
      Specified by:
      put in interface org.springframework.integration.metadata.MetadataStore
    • get

      public String get(String key)
      Specified by:
      get in interface org.springframework.integration.metadata.MetadataStore
    • remove

      public String remove(String key)
      Specified by:
      remove in interface org.springframework.integration.metadata.MetadataStore
    • getPath

      public String getPath(String key)
    • isAutoStartup

      public boolean isAutoStartup()
      Specified by:
      isAutoStartup in interface org.springframework.context.SmartLifecycle
    • start

      public void start()
      Specified by:
      start in interface org.springframework.context.Lifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
    • getPhase

      public int getPhase()
      Specified by:
      getPhase in interface org.springframework.context.Phased
      Specified by:
      getPhase in interface org.springframework.context.SmartLifecycle