Enum Class AlertLevel

java.lang.Object
java.lang.Enum<AlertLevel>
io.github.pimak.ntfy.core.AlertLevel
All Implemented Interfaces:
Serializable, Comparable<AlertLevel>, Constable

public enum AlertLevel extends Enum<AlertLevel>
The severity of an AlertEvent, as far as the alerting engine is concerned — the value AlertEngine routes on.

Framework-neutral by construction: adapters map their own level type onto one of these two constants (Logback/Log4j2 WARN, JUL WARNING → WARN; ERROR/FATAL/SEVERE and above → ERROR) so no logging framework's level class leaks into core.

There are deliberately only two constants. Alerting is ERROR-only by default and a WARN route is opt-in (warn-topic); there is intentionally no way to express "route INFO" or "route DEBUG". That floor used to be a convention repeated in every adapter's gate — as an enum with no sub-WARN constant it becomes a property of the type instead, so no adapter, and no future one, can widen it by accident. Anything below WARN is dropped by the adapter before an AlertEvent is ever built.

  • Enum Constant Details

    • WARN

      public static final AlertLevel WARN
      Warning-level. Alerted only when the operator configured a warn-topic; otherwise the adapters never submit such an event and the engine drops it if one arrives anyway.
    • ERROR

      public static final AlertLevel ERROR
      Error-level and above (Log4j2 FATAL, JUL SEVERE, and any custom level above them). Always alerted — this is the engine's default and only mandatory route.
  • Method Details

    • values

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