public class WatchManager extends Object implements IWatchManager
| Constructor and Description |
|---|
WatchManager() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addWatch(String path,
Watcher watcher)
Add watch to specific path.
|
boolean |
addWatch(String path,
Watcher watcher,
WatcherMode watcherMode)
Add watch to specific path.
|
boolean |
containsWatcher(String path,
Watcher watcher)
Checks the specified watcher exists for the given path.
|
boolean |
containsWatcher(String path,
Watcher watcher,
WatcherMode watcherMode)
Checks the specified watcher exists for the given path and mode.
|
void |
dumpWatches(PrintWriter pwriter,
boolean byPath)
String representation of watches.
|
WatchesReport |
getWatches()
Returns a watch report.
|
WatchesPathReport |
getWatchesByPath()
Returns a watch report by path.
|
WatchesSummary |
getWatchesSummary()
Returns a watch summary.
|
boolean |
removeWatcher(String path,
Watcher watcher)
Removes the specified watcher for the given path.
|
boolean |
removeWatcher(String path,
Watcher watcher,
WatcherMode watcherMode)
Removes the specified watcher for the given path and mode.
|
void |
removeWatcher(Watcher watcher)
The entry to remove the watcher when the cnxn is closed.
|
void |
shutdown()
Clean up the watch manager.
|
int |
size()
Get the size of watchers.
|
String |
toString() |
WatcherOrBitSet |
triggerWatch(String path,
Watcher.Event.EventType type,
long zxid,
List<ACL> acl)
Distribute the watch event for the given path.
|
WatcherOrBitSet |
triggerWatch(String path,
Watcher.Event.EventType type,
long zxid,
List<ACL> acl,
WatcherOrBitSet supress)
Distribute the watch event for the given path, but ignore those
suppressed ones.
|
public int size()
IWatchManagersize in interface IWatchManagerpublic boolean addWatch(String path, Watcher watcher)
IWatchManageraddWatch in interface IWatchManagerpath - znode pathwatcher - watcher object referencepublic boolean addWatch(String path, Watcher watcher, WatcherMode watcherMode)
IWatchManageraddWatch in interface IWatchManagerpath - znode pathwatcher - watcher object referencewatcherMode - the watcher mode to usepublic void removeWatcher(Watcher watcher)
IWatchManagerremoveWatcher in interface IWatchManagerwatcher - watcher object referencepublic WatcherOrBitSet triggerWatch(String path, Watcher.Event.EventType type, long zxid, List<ACL> acl)
IWatchManagertriggerWatch in interface IWatchManagerpath - znode pathtype - the watch event typezxid - the zxid for the corresponding change that triggered this eventacl - ACL of the znode in pathpublic WatcherOrBitSet triggerWatch(String path, Watcher.Event.EventType type, long zxid, List<ACL> acl, WatcherOrBitSet supress)
IWatchManagertriggerWatch in interface IWatchManagerpath - znode pathtype - the watch event typezxid - the zxid for the corresponding change that triggered this eventsupress - the suppressed watcher setpublic void dumpWatches(PrintWriter pwriter, boolean byPath)
IWatchManagerdumpWatches in interface IWatchManagerpwriter - the writer to dump the watchesbyPath - iff true output watches by paths, otw output
watches by connectionpublic boolean containsWatcher(String path, Watcher watcher)
IWatchManagercontainsWatcher in interface IWatchManagerpath - znode pathwatcher - watcher object referencepublic boolean containsWatcher(String path, Watcher watcher, WatcherMode watcherMode)
IWatchManagercontainsWatcher in interface IWatchManagerpath - znode pathwatcher - watcher object referencewatcherMode - watcher mode, null for any modepublic boolean removeWatcher(String path, Watcher watcher, WatcherMode watcherMode)
IWatchManagerremoveWatcher in interface IWatchManagerpath - znode pathwatcher - watcher object referencewatcherMode - watcher mode, null to remove all modespublic boolean removeWatcher(String path, Watcher watcher)
IWatchManagerremoveWatcher in interface IWatchManagerpath - znode pathwatcher - watcher object referencepublic WatchesReport getWatches()
IWatchManagergetWatches in interface IWatchManagerWatchesReportpublic WatchesPathReport getWatchesByPath()
IWatchManagergetWatchesByPath in interface IWatchManagerWatchesPathReportpublic WatchesSummary getWatchesSummary()
IWatchManagergetWatchesSummary in interface IWatchManagerWatchesSummarypublic void shutdown()
IWatchManagershutdown in interface IWatchManagerCopyright © 2008–2026 The Apache Software Foundation. All rights reserved.