public enum AddWatchMode extends Enum<AddWatchMode>
ZooKeeper.addWatch(String, Watcher, AddWatchMode)
Enum Constant and Description |
---|
PERSISTENT
Set a watcher on the given path that does not get removed when triggered (i.e.
|
PERSISTENT_RECURSIVE
Set a watcher on the given path that: a) does not get removed when triggered (i.e.
|
Modifier and Type | Method and Description |
---|---|
int |
getMode() |
static AddWatchMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static AddWatchMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final AddWatchMode PERSISTENT
Set a watcher on the given path that does not get removed when triggered (i.e. it stays active until it is removed). This watcher is triggered for both data and child events. To remove the watcher, use removeWatches() with WatcherType.Any. The watcher behaves as if you placed an exists() watch and a getData() watch on the ZNode at the given path.
public static final AddWatchMode PERSISTENT_RECURSIVE
Set a watcher on the given path that: a) does not get removed when triggered (i.e. it stays active until it is removed); b) applies not only to the registered path but all child paths recursively. This watcher is triggered for both data and child events. To remove the watcher, use removeWatches() with WatcherType.Any
The watcher behaves as if you placed an exists() watch and a getData() watch on the ZNode at the given path and any ZNodes that are children of the given path including children added later.
NOTE: when there are active recursive watches there is a small performance decrease as all segments of ZNode paths must be checked for watch triggering.
public static AddWatchMode[] values()
for (AddWatchMode c : AddWatchMode.values()) System.out.println(c);
public static AddWatchMode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getMode()
Copyright © 2008–2023 The Apache Software Foundation. All rights reserved.