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
-
Constructor Summary
Constructors Constructor Description ZookeeperMetadataStore(org.apache.curator.framework.CuratorFramework client) -
Method Summary
Modifier and Type Method Description voidaddListener(org.springframework.integration.metadata.MetadataStoreListener listener)java.lang.Stringget(java.lang.String key)java.lang.StringgetPath(java.lang.String key)intgetPhase()java.lang.StringgetRoot()booleanisAutoStartup()booleanisRunning()voidput(java.lang.String key, java.lang.String value)java.lang.StringputIfAbsent(java.lang.String key, java.lang.String value)java.lang.Stringremove(java.lang.String key)voidremoveListener(org.springframework.integration.metadata.MetadataStoreListener callback)booleanreplace(java.lang.String key, java.lang.String oldValue, java.lang.String newValue)voidsetAutoStartup(boolean autoStartup)voidsetEncoding(java.lang.String encoding)Encoding to use when storing data in ZooKeepervoidsetPhase(int phase)voidsetRoot(java.lang.String root)Root node - store entries are children of this node.voidstart()voidstop()
-
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:
putIfAbsentin interfaceorg.springframework.integration.metadata.ConcurrentMetadataStore
-
replace
public boolean replace(java.lang.String key, java.lang.String oldValue, java.lang.String newValue)- Specified by:
replacein interfaceorg.springframework.integration.metadata.ConcurrentMetadataStore
-
addListener
public void addListener(org.springframework.integration.metadata.MetadataStoreListener listener)- Specified by:
addListenerin interfaceorg.springframework.integration.metadata.ListenableMetadataStore
-
removeListener
public void removeListener(org.springframework.integration.metadata.MetadataStoreListener callback)- Specified by:
removeListenerin interfaceorg.springframework.integration.metadata.ListenableMetadataStore
-
put
public void put(java.lang.String key, java.lang.String value)- Specified by:
putin interfaceorg.springframework.integration.metadata.MetadataStore
-
get
public java.lang.String get(java.lang.String key)- Specified by:
getin interfaceorg.springframework.integration.metadata.MetadataStore
-
remove
public java.lang.String remove(java.lang.String key)- Specified by:
removein interfaceorg.springframework.integration.metadata.MetadataStore
-
getPath
public java.lang.String getPath(java.lang.String key) -
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceorg.springframework.context.SmartLifecycle
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
getPhase
public int getPhase()- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-