Package io.vertx.ext.consul
Enum SessionBehavior
- java.lang.Object
-
- java.lang.Enum<SessionBehavior>
-
- io.vertx.ext.consul.SessionBehavior
-
- All Implemented Interfaces:
Serializable
,Comparable<SessionBehavior>
public enum SessionBehavior extends Enum<SessionBehavior>
When a session is invalidated, it is destroyed and can no longer be used. What happens to the associated locks depends on the behavior specified at creation time. Consul supports a release and delete behavior. The release behavior is the default if none is specified.If the release behavior is being used, any of the locks held in association with the session are released, and the ModifyIndex of the key is incremented. Alternatively, if the delete behavior is used, the key corresponding to any of the held locks is simply deleted. This can be used to create ephemeral entries that are automatically deleted by Consul.
- Author:
- Ruslan Sennov
- See Also:
- Consul sessions documentation
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SessionBehavior
of(String key)
static SessionBehavior
valueOf(String name)
Returns the enum constant of this type with the specified name.static SessionBehavior[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
RELEASE
public static final SessionBehavior RELEASE
-
DELETE
public static final SessionBehavior DELETE
-
-
Field Detail
-
key
public final String key
-
-
Method Detail
-
values
public static SessionBehavior[] 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 (SessionBehavior c : SessionBehavior.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SessionBehavior valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
of
public static SessionBehavior of(String key)
-
-