public interface ElasticConfigService extends ListenerService<ElasticConfigEvent,ElasticConfigListener>
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.CompletableFuture<java.lang.Void> |
addConfigListener(ConfigStoreType store,
ConfigNodePath path,
ElasticConfigListener listener)
Registers a listener to be notified when the subtree rooted at
the specified path
is modified.
|
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
addNode(ConfigStoreType store,
ConfigNodePath path,
ConfigNode node)
Adds a new node to the elastic config store.
|
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
createRecursive(ConfigStoreType store,
ConfigNodePath path,
ConfigNode node)
Creates nodes in the elastic config store, recursively by creating
all missing intermediate nodes in the path.
|
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
deleteRecursive(ConfigStoreType store,
ConfigNodePath path)
Delete nodes in the elastic config store, recursively by deleting all
intermediate nodes in the path.
|
java.util.concurrent.CompletableFuture<ConfigNode> |
getNode(ConfigStoreType store,
ConfigNodePath path,
TraversalMode mode,
ConfigFilter filter)
Returns a value node or subtree under the given path.
|
java.util.concurrent.CompletableFuture<java.lang.Integer> |
getNumberOfChildren(ConfigStoreType store,
ConfigNodePath path,
ConfigFilter filter)
Returns the number of children under the given path, excluding
the node at the path.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
removeConfigListener(ElasticConfigListener listener)
Unregisters a previously added listener.
|
java.util.concurrent.CompletableFuture<ConfigNode> |
removeNode(ConfigStoreType store,
ConfigNodePath path)
Removes a node from the elastic config store.
|
java.util.concurrent.CompletableFuture<ConfigNode> |
updateNode(ConfigStoreType store,
ConfigNodePath path,
ConfigNode node)
Creates/Updates a node in the elastic config store.
|
java.util.concurrent.CompletableFuture<java.lang.Boolean> |
updateRecursive(ConfigStoreType store,
ConfigNodePath path,
ConfigNode node)
Creates/Updates nodes in the elastic config store, recursively by creating
all missing intermediate nodes in the path.
|
addListener, removeListener
java.util.concurrent.CompletableFuture<java.lang.Boolean> addNode(ConfigStoreType store, ConfigNodePath path, ConfigNode node)
store
- type of store to which the application wants to add the node to.path
- data structure with absolute path to the parent and relative
path to the nodenode
- data structure with nodetype and value to be stored at the nodetrue
if the new node was successfully
added. Future will be completed with false
if a node already exists at
the specified path. Future will be completed exceptionally with a
FailedException
if the parent node (for the node to create) does not exist.java.util.concurrent.CompletableFuture<ConfigNode> removeNode(ConfigStoreType store, ConfigNodePath path)
store
- type of store which the application wants to access.path
- data structure with absolute path to the parent and
relative path to the nodeFailedException
if the node to be removed is either the root
node or has one or more children or if the node to be removed does not exist.java.util.concurrent.CompletableFuture<ConfigNode> updateNode(ConfigStoreType store, ConfigNodePath path, ConfigNode node)
store
- type of store which the application wants to access.path
- data structure with absolute path to the parent and
relative path to the nodenode
- data structure with nodetype and new value to be stored at the nodenull
if there was no node previously at that path.
Future will be completed with a FailedException
if the parent node (for the node to create/update) does not exist.java.util.concurrent.CompletableFuture<java.lang.Boolean> createRecursive(ConfigStoreType store, ConfigNodePath path, ConfigNode node)
store
- type of store which the application wants to access.path
- data structure with absolute path to the parent and relative
path to the nodenode
- recursive data structure with nodetype and value to
be stored at the nodetrue
if all the new
nodes were successfully
created. Future will be completed with false
if any node
already exists at the specified path
//TODOjava.util.concurrent.CompletableFuture<java.lang.Boolean> deleteRecursive(ConfigStoreType store, ConfigNodePath path)
store
- type of store which the appplication wants to access.path
- data structure with absolute path to the parent and
relative path to the nodetrue
if all the
nodes under the given path including the node at the path could
be successfully deleted. Future will be completed with false
if the node at the given path or any parent node
did not exist //TODOjava.util.concurrent.CompletableFuture<java.lang.Boolean> updateRecursive(ConfigStoreType store, ConfigNodePath path, ConfigNode node)
store
- type of store which the appplication wants to access.path
- data structure with absolute path to the parent and
relative path to the nodenode
- recursive data structure with nodetype and value to
be stored at the nodetrue
if all the
nodes under the given path
including the node at the path could be successfully updated.
Future will be completed with false
if the node at the
given path or any parent node
did not exist //TODOjava.util.concurrent.CompletableFuture<ConfigNode> getNode(ConfigStoreType store, ConfigNodePath path, TraversalMode mode, ConfigFilter filter)
store
- type of store which the application wants to access.path
- data structure with absolute path to the parent and
relative path to the nodemode
- whether to retrieve the nodes recursively or notfilter
- filtering conditions to be applied on the result
list of nodes.null
if
after applying the filter, the result is an empty list of nodes.
Future will be completed with a FailedException
if path
does not point to a valid node.java.util.concurrent.CompletableFuture<java.lang.Integer> getNumberOfChildren(ConfigStoreType store, ConfigNodePath path, ConfigFilter filter)
store
- type of store which the application wants to access.path
- data structure with absolute path to the parent and
relative path to the nodefilter
- how the value nodes should be filteredInteger
, the
count of the children
after applying the filtering conditions as well.
Future will be completed with a FailedException
if path
does not point to a valid nodejava.util.concurrent.CompletableFuture<java.lang.Void> addConfigListener(ConfigStoreType store, ConfigNodePath path, ElasticConfigListener listener)
store
- type of store which the application wants to access.path
- data structure with absolute path to the parent and
relative path to the nodelistener
- listener to be notifiedjava.util.concurrent.CompletableFuture<java.lang.Void> removeConfigListener(ElasticConfigListener listener)
listener
- listener to unregister