Enum Class Guarantee

java.lang.Object
java.lang.Enum<Guarantee>
io.fluxcapacitor.common.Guarantee
All Implemented Interfaces:
Serializable, Comparable<Guarantee>, Constable

public enum Guarantee extends Enum<Guarantee>
Represents a delivery or completion guarantee for messages or state changes in Flux Capacitor.

Guarantees define how long an operation (e.g., sending a message or applying a state change) should wait before considering itself complete.

These guarantees are especially relevant when sending messages through gateways such as CommandGateway or when scheduling and persisting state changes to the Flux platform.

  • Enum Constant Details

    • NONE

      public static final Guarantee NONE
      No delivery guarantee is enforced.

      Operations complete immediately after dispatching, without waiting for acknowledgment from Flux Capacitor or local processing results.

      Use this when performance is more important than confirmation, or when confirmation is handled separately.

    • SENT

      public static final Guarantee SENT
      Guarantees that the message or action was sent successfully.

      This includes:

      • Local delivery to registered handlers
      • Sending the message to the Flux Capacitor service

      If a message is handled entirely locally, the operation completes once the local handling is done. If the message is sent remotely, the operation waits for acknowledgment that it was sent successfully.

    • STORED

      public static final Guarantee STORED
      Guarantees that the message or action was stored by Flux Capacitor.

      The operation waits until a receipt or acknowledgment from Flux Capacitor confirms that the message or state change has been durably stored.

      This is the highest level of guarantee and ensures that the message won't be lost even if there is a failure after dispatch.

  • Method Details

    • values

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