V - document tree value type@NotThreadSafe public interface AsyncDocumentTree<V> extends DistributedPrimitive
DistributedPrimitive.Status, DistributedPrimitive.TypeDEFAULT_OPERTATION_TIMEOUT_MILLIS| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
addListener(DocumentPath path,
DocumentTreeListener<V> listener)
Registers a listener to be notified when a subtree rooted at the specified path
is modified.
|
default CompletableFuture<Void> |
addListener(DocumentTreeListener<V> listener)
Registers a listener to be notified when the tree is modified.
|
CompletableFuture<Boolean> |
create(DocumentPath path,
V value)
Creates a document tree node if one does not exist already.
|
CompletableFuture<Versioned<V>> |
get(DocumentPath path)
Returns a value (and version) of the tree node at specified path.
|
CompletableFuture<Map<String,Versioned<V>>> |
getChildren(DocumentPath path)
Returns the child values for this node.
|
CompletableFuture<Void> |
removeListener(DocumentTreeListener<V> listener)
Unregisters a previously added listener.
|
CompletableFuture<Versioned<V>> |
removeNode(DocumentPath path)
Removes the node with the specified path.
|
CompletableFuture<Boolean> |
replace(DocumentPath path,
V newValue,
long version)
Conditionally updates a tree node if the current version matches a specified version.
|
CompletableFuture<Boolean> |
replace(DocumentPath path,
V newValue,
V currentValue)
Conditionally updates a tree node if the current value matches a specified value.
|
DocumentPath |
root()
Returns the
path to root of the tree. |
CompletableFuture<Versioned<V>> |
set(DocumentPath path,
V value)
Creates or updates a document tree node.
|
addStatusChangeListener, applicationId, destroy, name, primitiveType, removeStatusChangeListener, statusChangeListenersDocumentPath root()
path to root of the tree.CompletableFuture<Map<String,Versioned<V>>> getChildren(DocumentPath path)
path - path to the nodeNoSuchDocumentPathException - if the path does not point to a valid nodeCompletableFuture<Versioned<V>> get(DocumentPath path)
path - path to nodenull if path does not point to a valid nodeCompletableFuture<Versioned<V>> set(DocumentPath path, V value)
path - path for the node to create or updatevalue - the non-null value to be associated with the keynull if there was no previous mapping. Future will
be completed with a NoSuchDocumentPathException if the parent node (for the node to create/update) does not existCompletableFuture<Boolean> create(DocumentPath path, V value)
path - path for the node to createvalue - the non-null value to be associated with the keytrue if the mapping could be added
successfully; false otherwise. Future will be completed with a
IllegalDocumentModificationException if the parent node (for the node to create) does not existCompletableFuture<Boolean> replace(DocumentPath path, V newValue, long version)
path - path for the node to createnewValue - the non-null value to be associated with the keyversion - current version of the value for update to occurtrue if the update was made and the tree was
modified, false otherwise.CompletableFuture<Boolean> replace(DocumentPath path, V newValue, V currentValue)
path - path for the node to createnewValue - the non-null value to be associated with the keycurrentValue - current value for update to occurtrue if the update was made and the tree was
modified, false otherwise.CompletableFuture<Versioned<V>> removeNode(DocumentPath path)
path - path for the node to removeCompletableFuture<Void> addListener(DocumentPath path, DocumentTreeListener<V> listener)
path - path to root of subtree to monitor for updateslistener - listener to be notifiedCompletableFuture<Void> removeListener(DocumentTreeListener<V> listener)
listener - listener to unregisterdefault CompletableFuture<Void> addListener(DocumentTreeListener<V> listener)
listener - listener to be notified