public class AnyOfOperations extends ZooKeeperOperation implements WatchedEventProvider
AnyOfOperations is a composite operation of one or more sub
operation, executing each in turn until any one succeeds. If any execute
successfully, this operation succeeds; if the sub operations are all executed
without success it fails.
It is mostly used for test and watch scenarios where a node is tested for existence, data or children, falling back to a corresponding watch operation if the test operation fails.
connection, CONSTRUCTOR_ARGS, LOG, node, result, waitingThreads| Constructor and Description |
|---|
AnyOfOperations(String node,
ZooKeeperOperation... keeperOperations) |
| Modifier and Type | Method and Description |
|---|---|
ZooKeeperOperation |
createCopy() |
OperationResult |
get() |
OperationResult |
get(long timeout,
TimeUnit unit) |
OperationResult |
getResult()
Gets the result of this zookeeper operation, i.e.
|
org.apache.zookeeper.WatchedEvent |
getWatchedEvent() |
cancel, getNode, isCancelled, isDone, shouldProduceExchangepublic AnyOfOperations(String node, ZooKeeperOperation... keeperOperations)
public OperationResult get() throws InterruptedException, ExecutionException
get in class ZooKeeperOperationInterruptedExceptionExecutionExceptionpublic OperationResult get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in class ZooKeeperOperationInterruptedExceptionExecutionExceptionTimeoutExceptionpublic OperationResult getResult()
ZooKeeperOperationgetResult in class ZooKeeperOperationpublic ZooKeeperOperation createCopy() throws Exception
createCopy in class ZooKeeperOperationExceptionpublic org.apache.zookeeper.WatchedEvent getWatchedEvent()
getWatchedEvent in interface WatchedEventProviderApache Camel