Enum Class FlushMode
- All Implemented Interfaces:
Serializable, Comparable<FlushMode>, Constable
Members of this enum are used to indicate to the
IAquimaSessionsMap session manager the intent for a
requested session. If the intent is to modify the session, ALWAYS should be used, otherwise NEVER
should be used.
A precedence relation exists between the members of this enum: AUTO < NEVER < ALWAYS. This relation becomes relevant when multiple parties request the same session from the same session manager, but with different intents. If and when the sessions are flushed to an external session store, the flush mode with the highest precedence determines whether a session will be flushed or not.
- Since:
- 11.0
- Author:
- Petru Galanton
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic FlushModegetEffectiveFlushMode(FlushMode first, FlushMode second) When there is a choice between two flush modes to be used, this method determines the effective flush mode between the two choices, the one with the highest precedence.booleanhasHigherPrecedence(FlushMode other) Returns whether this flush mode has higher precendence than the other flush mode.static FlushModeReturns the enum constant of this class with the specified name.static FlushMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AUTO
Indicates that the flush mode should automatically be determined based on context. This flush mode has the lowest precedence.Note that different classes may have access to more or less contextual information in order to best determine the actual flush mode to be used. When insufficient information is available, FlushMode.ALWAYS should be preferred over FlushMode.NEVER.
Classes which determine an actual flush mode should document how they interpret FlushMode.AUTO.
-
NEVER
Indicates that the session should never be flushed. -
ALWAYS
Indicates that the session should always be flushed. This flush mode has the highest precedence.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
getEffectiveFlushMode
When there is a choice between two flush modes to be used, this method determines the effective flush mode between the two choices, the one with the highest precedence.- Parameters:
first- the first flush modesecond- the second flush mode- Returns:
- the first or the second flush mode, whichever has the highest precedence.
-
hasHigherPrecedence
Returns whether this flush mode has higher precendence than the other flush mode.- Parameters:
other- another flush mode to compare to- Returns:
- true if this flush mode has higher precendence than the other, false otherwise
-