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.
|
void |
dumpWatches(PrintWriter pwriter,
boolean byPath)
String representation of watches.
|
int |
getRecursiveWatchQty()
Return the current number of recursive watchers
|
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.
|
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)
Distribute the watch event for the given path.
|
WatcherOrBitSet |
triggerWatch(String path,
Watcher.Event.EventType type,
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)
IWatchManagertriggerWatch in interface IWatchManagerpath - znode pathtype - the watch event typepublic WatcherOrBitSet triggerWatch(String path, Watcher.Event.EventType type, WatcherOrBitSet supress)
IWatchManagertriggerWatch in interface IWatchManagerpath - znode pathtype - the watch event typesupress - 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 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 IWatchManagerpublic int getRecursiveWatchQty()
IWatchManagergetRecursiveWatchQty in interface IWatchManagerCopyright © 2008–2021 The Apache Software Foundation. All rights reserved.