Enum Class DeliveryMode
- All Implemented Interfaces:
Serializable, Comparable<DeliveryMode>, Constable
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
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E>Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDeliver both in-session and to the device.Prefer the fastest available tier: if the recipient has a live session, deliver in-session; otherwise push to the device; otherwise spool.Always push to the device endpoint, even when the recipient has a live session.Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DeliveryModeThe default delivery mode:PREFER_IN_SESSION.Method Summary
Modifier and TypeMethodDescriptionstatic DeliveryModeReturns the enum constant of this class with the specified name.static DeliveryMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
Enum Constant Details
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
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
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
The default delivery mode:PREFER_IN_SESSION. Uses the fastest and cheapest tier whenever the recipient is live.
Method Details
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
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 nameNullPointerException- if the argument is null