Enum Class FlushMode

java.lang.Object
java.lang.Enum<FlushMode>
com.blueriq.component.api.FlushMode
All Implemented Interfaces:
Serializable, Comparable<FlushMode>, Constable

public enum FlushMode extends Enum<FlushMode>
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
  • Enum Constant Details

    • AUTO

      public static final FlushMode 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

      public static final FlushMode NEVER
      Indicates that the session should never be flushed.
    • ALWAYS

      public static final FlushMode ALWAYS
      Indicates that the session should always be flushed. This flush mode has the highest precedence.
  • Method Details

    • values

      public static FlushMode[] 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

      public static FlushMode valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getEffectiveFlushMode

      public static FlushMode getEffectiveFlushMode(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.
      Parameters:
      first - the first flush mode
      second - the second flush mode
      Returns:
      the first or the second flush mode, whichever has the highest precedence.
    • hasHigherPrecedence

      public boolean hasHigherPrecedence(FlushMode other)
      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