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()
IWatchManager
size
in interface IWatchManager
public boolean addWatch(String path, Watcher watcher)
IWatchManager
addWatch
in interface IWatchManager
path
- znode pathwatcher
- watcher object referencepublic boolean addWatch(String path, Watcher watcher, WatcherMode watcherMode)
IWatchManager
addWatch
in interface IWatchManager
path
- znode pathwatcher
- watcher object referencewatcherMode
- the watcher mode to usepublic void removeWatcher(Watcher watcher)
IWatchManager
removeWatcher
in interface IWatchManager
watcher
- watcher object referencepublic WatcherOrBitSet triggerWatch(String path, Watcher.Event.EventType type)
IWatchManager
triggerWatch
in interface IWatchManager
path
- znode pathtype
- the watch event typepublic WatcherOrBitSet triggerWatch(String path, Watcher.Event.EventType type, WatcherOrBitSet supress)
IWatchManager
triggerWatch
in interface IWatchManager
path
- znode pathtype
- the watch event typesupress
- the suppressed watcher setpublic void dumpWatches(PrintWriter pwriter, boolean byPath)
IWatchManager
dumpWatches
in interface IWatchManager
pwriter
- the writer to dump the watchesbyPath
- iff true output watches by paths, otw output
watches by connectionpublic boolean containsWatcher(String path, Watcher watcher)
IWatchManager
containsWatcher
in interface IWatchManager
path
- znode pathwatcher
- watcher object referencepublic boolean removeWatcher(String path, Watcher watcher)
IWatchManager
removeWatcher
in interface IWatchManager
path
- znode pathwatcher
- watcher object referencepublic WatchesReport getWatches()
IWatchManager
getWatches
in interface IWatchManager
WatchesReport
public WatchesPathReport getWatchesByPath()
IWatchManager
getWatchesByPath
in interface IWatchManager
WatchesPathReport
public WatchesSummary getWatchesSummary()
IWatchManager
getWatchesSummary
in interface IWatchManager
WatchesSummary
public void shutdown()
IWatchManager
shutdown
in interface IWatchManager
public int getRecursiveWatchQty()
IWatchManager
getRecursiveWatchQty
in interface IWatchManager
Copyright © 2008–2020 The Apache Software Foundation. All rights reserved.