Interface IWatchManager
- All Known Implementing Classes:
WatchManager,WatchManagerOptimized
public interface IWatchManager
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdd watch to specific path.default booleanaddWatch(String path, Watcher watcher, WatcherMode watcherMode) Add watch to specific path.booleancontainsWatcher(String path, Watcher watcher) Checks the specified watcher exists for the given path.voiddumpWatches(PrintWriter pwriter, boolean byPath) String representation of watches.default intReturn the current number of recursive watchersReturns a watch report.Returns a watch report by path.Returns a watch summary.booleanremoveWatcher(String path, Watcher watcher) Removes the specified watcher for the given path.voidremoveWatcher(Watcher watcher) The entry to remove the watcher when the cnxn is closed.voidshutdown()Clean up the watch manager.intsize()Get the size of watchers.triggerWatch(String path, Watcher.Event.EventType type) Distribute the watch event for the given path.triggerWatch(String path, Watcher.Event.EventType type, WatcherOrBitSet suppress) Distribute the watch event for the given path, but ignore those suppressed ones.
-
Method Details
-
addWatch
Add watch to specific path.- Parameters:
path- znode pathwatcher- watcher object reference- Returns:
- true if the watcher added is not already present
-
addWatch
Add watch to specific path.- Parameters:
path- znode pathwatcher- watcher object referencewatcherMode- the watcher mode to use- Returns:
- true if the watcher added is not already present
-
containsWatcher
Checks the specified watcher exists for the given path.- Parameters:
path- znode pathwatcher- watcher object reference- Returns:
- true if the watcher exists, false otherwise
-
removeWatcher
Removes the specified watcher for the given path.- Parameters:
path- znode pathwatcher- watcher object reference- Returns:
- true if the watcher successfully removed, false otherwise
-
removeWatcher
The entry to remove the watcher when the cnxn is closed.- Parameters:
watcher- watcher object reference
-
triggerWatch
Distribute the watch event for the given path.- Parameters:
path- znode pathtype- the watch event type- Returns:
- the watchers have been notified
-
triggerWatch
Distribute the watch event for the given path, but ignore those suppressed ones.- Parameters:
path- znode pathtype- the watch event typesuppress- the suppressed watcher set- Returns:
- the watchers have been notified
-
size
int size()Get the size of watchers.- Returns:
- the watchers number managed in this class.
-
shutdown
void shutdown()Clean up the watch manager. -
getWatchesSummary
WatchesSummary getWatchesSummary()Returns a watch summary.- Returns:
- watch summary
- See Also:
-
getWatches
WatchesReport getWatches()Returns a watch report.- Returns:
- watch report
- See Also:
-
getWatchesByPath
WatchesPathReport getWatchesByPath()Returns a watch report by path.- Returns:
- watch report
- See Also:
-
dumpWatches
String representation of watches. Warning, may be large!- Parameters:
pwriter- the writer to dump the watchesbyPath- iff true output watches by paths, otw output watches by connection
-
getRecursiveWatchQty
default int getRecursiveWatchQty()Return the current number of recursive watchers- Returns:
- qty
-