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 java.lang.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
  • Field Summary

    Fields inherited from interface org.springframework.context.SmartLifecycle

    DEFAULT_PHASE
  • Constructor Summary

    Constructors 
    Constructor Description
    ZookeeperMetadataStore​(org.apache.curator.framework.CuratorFramework client)  
  • Method Summary

    Modifier and Type Method Description
    void addListener​(org.springframework.integration.metadata.MetadataStoreListener listener)  
    java.lang.String get​(java.lang.String key)  
    java.lang.String getPath​(java.lang.String key)  
    int getPhase()  
    java.lang.String getRoot()  
    boolean isAutoStartup()  
    boolean isRunning()  
    void put​(java.lang.String key, java.lang.String value)  
    java.lang.String putIfAbsent​(java.lang.String key, java.lang.String value)  
    java.lang.String remove​(java.lang.String key)  
    void removeListener​(org.springframework.integration.metadata.MetadataStoreListener callback)  
    boolean replace​(java.lang.String key, java.lang.String oldValue, java.lang.String newValue)  
    void setAutoStartup​(boolean autoStartup)  
    void setEncoding​(java.lang.String encoding)
    Encoding to use when storing data in ZooKeeper
    void setPhase​(int phase)  
    void setRoot​(java.lang.String root)
    Root node - store entries are children of this node.
    void start()  
    void stop()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.context.SmartLifecycle

    stop
  • Constructor Details

    • ZookeeperMetadataStore

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

    • setEncoding

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

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

      public java.lang.String getRoot()
    • setAutoStartup

      public void setAutoStartup​(boolean autoStartup)
    • setPhase

      public void setPhase​(int phase)
    • putIfAbsent

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

      public boolean replace​(java.lang.String key, java.lang.String oldValue, java.lang.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​(java.lang.String key, java.lang.String value)
      Specified by:
      put in interface org.springframework.integration.metadata.MetadataStore
    • get

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

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

      public java.lang.String getPath​(java.lang.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