@InterfaceAudience.Public public class WatchedEvent extends Object
Modifier and Type | Field and Description |
---|---|
static long |
NO_ZXID |
Constructor and Description |
---|
WatchedEvent(Watcher.Event.EventType eventType,
Watcher.Event.KeeperState keeperState,
String path)
Create a WatchedEvent with specified type, state and path
|
WatchedEvent(Watcher.Event.EventType eventType,
Watcher.Event.KeeperState keeperState,
String path,
long zxid)
Create a WatchedEvent with specified type, state, path and zxid
|
WatchedEvent(WatcherEvent eventMessage,
long zxid)
Convert a WatcherEvent sent over the wire into a full-fledged WatchedEvent
|
Modifier and Type | Method and Description |
---|---|
String |
getPath() |
Watcher.Event.KeeperState |
getState() |
Watcher.Event.EventType |
getType() |
WatcherEvent |
getWrapper()
Convert WatchedEvent to type that can be sent over network
|
long |
getZxid()
Returns the zxid of the transaction that triggered this watch if it is
of one of the following types:
Watcher.Event.EventType.NodeCreated
Watcher.Event.EventType.NodeDeleted
Watcher.Event.EventType.NodeDataChanged
Watcher.Event.EventType.NodeChildrenChanged
Otherwise, returns -1L. |
String |
toString() |
public static final long NO_ZXID
public WatchedEvent(Watcher.Event.EventType eventType, Watcher.Event.KeeperState keeperState, String path, long zxid)
public WatchedEvent(Watcher.Event.EventType eventType, Watcher.Event.KeeperState keeperState, String path)
public WatchedEvent(WatcherEvent eventMessage, long zxid)
public Watcher.Event.KeeperState getState()
public Watcher.Event.EventType getType()
public String getPath()
public long getZxid()
Watcher.Event.EventType.NodeCreated
Watcher.Event.EventType.NodeDeleted
Watcher.Event.EventType.NodeDataChanged
Watcher.Event.EventType.NodeChildrenChanged
public WatcherEvent getWrapper()
Copyright © 2008–2025 The Apache Software Foundation. All rights reserved.