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: a live session gets it at once AND every subscribed device gets it, as every send did before the in-session tier existed.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:BOTH, since P4-10 (ruled 2026-09-24, RR-14b B).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 mode that most relieves push throughput pressure since live recipients never touch a push endpoint - and NOT the default (ruled 2026-09-24, RR-14b B): under it a user with a page open gets the notification in that page only and nothing on their phone.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: a live session gets it at once AND every subscribed device gets it, as every send did before the in-session tier existed. The default since P4-10 (ruled 2026-09-24, RR-14b B, PUSH-PROPS-DESIGN section 9.2). On the Browser the user has open the two arrive as ONE notification: both are shown on the same Service Worker registration under the sametag, the server's message ID (design 9.1), and the same tag replaces rather than stacks.
Field Details
DEFAULT
The default delivery mode:BOTH, since P4-10 (ruled 2026-09-24, RR-14b B). It wasPREFER_IN_SESSIONwhile the in-session tier was dormant, when every send reached devices whatever this said; the commit that made the tier available made this the default, so that a user with an open session still gets the notification on their phone.IPushSettings.getDefaultDeliveryMode()reads it at run time - never compare against this constant in a test, compare against the literal.
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