public static enum TreeCacheEvent.Type extends Enum<TreeCacheEvent.Type>
Enum Constant and Description |
---|
CONNECTION_LOST
Called when the connection has changed to
ConnectionState.LOST |
CONNECTION_RECONNECTED
Called when the connection has changed to
ConnectionState.RECONNECTED |
CONNECTION_SUSPENDED
Called when the connection has changed to
ConnectionState.SUSPENDED |
INITIALIZED
Posted after the initial cache has been fully populated.
|
NODE_ADDED
A node was added.
|
NODE_REMOVED
A node was removed from the tree
|
NODE_UPDATED
A node's data was changed
|
Modifier and Type | Method and Description |
---|---|
static TreeCacheEvent.Type |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TreeCacheEvent.Type[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TreeCacheEvent.Type NODE_ADDED
public static final TreeCacheEvent.Type NODE_UPDATED
public static final TreeCacheEvent.Type NODE_REMOVED
public static final TreeCacheEvent.Type CONNECTION_SUSPENDED
ConnectionState.SUSPENDED
This is exposed so that users of the class can be notified of issues that *might* affect normal operation. The TreeCache is written such that listeners are not expected to do anything special on this event, except for those people who want to cause some application-specific logic to fire when this occurs. While the connection is down, the TreeCache will continue to have its state from before it lost the connection and after the connection is restored, the TreeCache will emit normal child events for all of the adds, deletes and updates that happened during the time that it was disconnected.
public static final TreeCacheEvent.Type CONNECTION_RECONNECTED
ConnectionState.RECONNECTED
This is exposed so that users of the class can be notified of issues that *might* affect normal operation. The TreeCache is written such that listeners are not expected to do anything special on this event, except for those people who want to cause some application-specific logic to fire when this occurs. While the connection is down, the TreeCache will continue to have its state from before it lost the connection and after the connection is restored, the TreeCache will emit normal child events for all of the adds, deletes and updates that happened during the time that it was disconnected.
After reconnection, the cache will resynchronize its internal state with the server, then fire a
INITIALIZED
event.
public static final TreeCacheEvent.Type CONNECTION_LOST
ConnectionState.LOST
This is exposed so that users of the class can be notified of issues that *might* affect normal operation. The TreeCache is written such that listeners are not expected to do anything special on this event, except for those people who want to cause some application-specific logic to fire when this occurs. While the connection is down, the TreeCache will continue to have its state from before it lost the connection and after the connection is restored, the TreeCache will emit normal child events for all of the adds, deletes and updates that happened during the time that it was disconnected.
public static final TreeCacheEvent.Type INITIALIZED
On startup, the cache synchronizes its internal
state with the server, publishing a series of NODE_ADDED
events as new nodes are discovered. Once
the cachehas been fully synchronized, this INITIALIZED
this event is published. All events
published after this event represent actual server-side mutations.
On reconnection, the cache will resynchronize its internal state with the server, and fire this event again once its internal state is completely refreshed.
Note: because the initial population is inherently asynchronous, so it's possible to observe server-side changes
(such as a NODE_UPDATED
) prior to this event being published.
public static TreeCacheEvent.Type[] values()
for (TreeCacheEvent.Type c : TreeCacheEvent.Type.values()) System.out.println(c);
public static TreeCacheEvent.Type valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.