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
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionZookeeperMetadataStore(org.apache.curator.framework.CuratorFramework client) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(org.springframework.integration.metadata.MetadataStoreListener listener) intgetPhase()getRoot()booleanbooleanvoidputIfAbsent(String key, String value) voidremoveListener(org.springframework.integration.metadata.MetadataStoreListener callback) booleanvoidsetAutoStartup(boolean autoStartup) voidsetEncoding(String encoding) Encoding to use when storing data in ZooKeepervoidsetPhase(int phase) voidRoot node - store entries are children of this node.voidstart()voidstop()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.SmartLifecycle
stop
-
Constructor Details
-
ZookeeperMetadataStore
public ZookeeperMetadataStore(org.apache.curator.framework.CuratorFramework client)
-
-
Method Details
-
setEncoding
Encoding to use when storing data in ZooKeeper- Parameters:
encoding- encoding as text
-
setRoot
Root node - store entries are children of this node.- Parameters:
root- encoding as text
-
getRoot
-
setAutoStartup
public void setAutoStartup(boolean autoStartup) -
setPhase
public void setPhase(int phase) -
putIfAbsent
- Specified by:
putIfAbsentin interfaceorg.springframework.integration.metadata.ConcurrentMetadataStore
-
replace
- 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
- Specified by:
putin interfaceorg.springframework.integration.metadata.MetadataStore
-
get
- Specified by:
getin interfaceorg.springframework.integration.metadata.MetadataStore
-
remove
- Specified by:
removein interfaceorg.springframework.integration.metadata.MetadataStore
-
getPath
-
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
-