Enum TreeCacheEvent.Type
- java.lang.Object
-
- java.lang.Enum<TreeCacheEvent.Type>
-
- org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<TreeCacheEvent.Type>
- Enclosing class:
- TreeCacheEvent
public static enum TreeCacheEvent.Type extends java.lang.Enum<TreeCacheEvent.Type>
Type of change
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CONNECTION_LOSTCalled when the connection has changed toConnectionState.LOSTCONNECTION_RECONNECTEDCalled when the connection has changed toConnectionState.RECONNECTEDCONNECTION_SUSPENDEDCalled when the connection has changed toConnectionState.SUSPENDEDINITIALIZEDPosted after the initial cache has been fully populated.NODE_ADDEDA node was added.NODE_REMOVEDA node was removed from the treeNODE_UPDATEDA node's data was changed
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TreeCacheEvent.TypevalueOf(java.lang.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.
-
-
-
Enum Constant Detail
-
NODE_ADDED
public static final TreeCacheEvent.Type NODE_ADDED
A node was added.
-
NODE_UPDATED
public static final TreeCacheEvent.Type NODE_UPDATED
A node's data was changed
-
NODE_REMOVED
public static final TreeCacheEvent.Type NODE_REMOVED
A node was removed from the tree
-
CONNECTION_SUSPENDED
public static final TreeCacheEvent.Type CONNECTION_SUSPENDED
Called when the connection has changed toConnectionState.SUSPENDEDThis 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.
-
CONNECTION_RECONNECTED
public static final TreeCacheEvent.Type CONNECTION_RECONNECTED
Called when the connection has changed toConnectionState.RECONNECTEDThis 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
INITIALIZEDevent.
-
CONNECTION_LOST
public static final TreeCacheEvent.Type CONNECTION_LOST
Called when the connection has changed toConnectionState.LOSTThis 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.
-
INITIALIZED
public static final TreeCacheEvent.Type INITIALIZED
Posted after the initial cache has been fully populated.On startup, the cache synchronizes its internal state with the server, publishing a series of
NODE_ADDEDevents as new nodes are discovered. Once the cachehas been fully synchronized, thisINITIALIZEDthis 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.
-
-
Method Detail
-
values
public static TreeCacheEvent.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TreeCacheEvent.Type c : TreeCacheEvent.Type.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TreeCacheEvent.Type valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-