Enum Class Decision

java.lang.Object
java.lang.Enum<Decision>
com.tnsai.quality.ratelimit.Decision
All Implemented Interfaces:
Serializable, Comparable<Decision>, Constable

public enum Decision extends Enum<Decision>
Outcome of an EventRateLimiter probe (issue #82).

Three values, mapped onto distinct downstream behaviours:

  • ACCEPT — caller publishes the event normally.
  • DROP — caller silently discards the event. The rate-limiter records the drop so the next aggregate window emits a ratelimit.dropped summary.
  • DEFER — caller queues the event for a later, slower publish path. Useful when the limiter wants to shed load without losing important events. Implementations that don't support deferred re-publish may treat this the same as DROP.
Since:
0.10.0 (issue #82 — rate-limiting half of the cost-and-volume umbrella)
  • Enum Constant Details

    • ACCEPT

      public static final Decision ACCEPT
    • DROP

      public static final Decision DROP
    • DEFER

      public static final Decision DEFER
  • Method Details

    • values

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