Enum Class DeliveryMode

java.lang.Object
java.lang.Enum<DeliveryMode>
com.iizix.push.DeliveryMode
All Implemented Interfaces:
Serializable, Comparable<DeliveryMode>, Constable

public enum DeliveryMode extends Enum<DeliveryMode>
Which delivery tiers a send is permitted to use.

A notification can reach a recipient by three tiers, best to worst by connection state: in-session (a write down the recipient's live WebSocket — instant, consumes no push throughput, and always residency-legal because the session was already pinned to a compliant server), device push (VAPID or FCM to the device endpoint), and spool (held for later replay). This enum controls whether the fast in-session tier may be used for a given send.

Persistence note. This value is stored in a property container by ordinal() (see the enum-storage idiom in IPushSettings). The order of these constants is therefore part of the persisted and wire contract: new constants MUST be appended at the end, never inserted or reordered, or an existing stored value will silently change meaning.

Author:
IIZI
  • Enum Constant Details

    • PREFER_IN_SESSION

      public static final DeliveryMode PREFER_IN_SESSION
      Prefer the fastest available tier: if the recipient has a live session, deliver in-session; otherwise push to the device; otherwise spool. The default for most notifications, and the mode that most relieves push throughput pressure since live recipients never touch a push endpoint.
    • REQUIRE_DEVICE

      public static final DeliveryMode REQUIRE_DEVICE
      Always push to the device endpoint, even when the recipient has a live session. Required for security-sensitive sends where the device is the trusted factor: delivering a second-factor code into a session that may be live on a different device would break the second-factor property.
    • BOTH

      public static final DeliveryMode BOTH
      Deliver both in-session and to the device. Belt-and-suspenders for critical alerts that must be seen immediately in-app and also on the device's lock screen.
  • Field Details

    • DEFAULT

      public static final DeliveryMode DEFAULT
      The default delivery mode: PREFER_IN_SESSION. Uses the fastest and cheapest tier whenever the recipient is live.
  • Method Details

    • values

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