Interface IPushSettings
- All Known Implementing Classes:
PushNotificationsProps
This interface defines every configurable setting the push subsystem exposes, as a set of getXxx() accessors together with the string property keys and the MIN/DEFAULT/MAX bounds each accessor enforces. It is implemented by com.iizix.prop.push.PushNotificationsProps, a PropCnr whose property container is defined in com/iizix/schema/base-properties.xml so that its values stream over standard IIZI transports (Send/ReadTransaction over WebSockets). When such a container is communicating, a modification to any one property is transferred automatically to the other connected parties as a delta — only the change is sent, not the whole container. This is how a push-setting change on one server propagates across the interconnected star of iiziServers.
Design contract for implementers. Every accessor MUST clamp the stored value into its documented range using the pattern
return Math.min(XXX_MAX, Math.max(XXX_MIN, getInt(KEY, XXX_DEFAULT)));
so that a value edited out of range (whether by an administrator, a transport error, or a hand-edited file) can never take the subsystem outside its safe envelope. The bounds are part of the contract, not advice: an accessor that returned an unclamped value would be a defect. The ServerAdmin application presents these settings as editable within the documented ranges, and takes the range documentation for each accessor directly from the JavaDoc on that accessor here.Keys and bounds. Each setting declares four constants: the string key used in the property container (XXX), and the XXX_MIN, XXX_DEFAULT and XXX_MAX bounds. Keys are the wire identity of the property and MUST NOT change once shipped — a renamed key is an incompatible change to any persisted or in-flight container.
Enum settings. An enum-valued setting is stored as an int, the constant's ordinal(), using setInt(KEY, value.ordinal()). It is read back with a bounds guard so a corrupt or out-of-range index can never throw on a configuration read:
int index = getInt(KEY, SomeEnum.DEFAULT.ordinal());
SomeEnum[] values = SomeEnum.values();
if (index < 0 || index >= values.length)
return SomeEnum.DEFAULT; // out of range -> default, never throw
return values[index];
Because the stored value is an ordinal, the order of an enum's constants is 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. Each such enum carries a persistence note to that effect.- Author:
- IIZI
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty key for the server-defaultDeliveryMode, stored as itsordinal().static final StringProperty key for the server-defaultResidencyPolicy, stored as itsordinal().static final StringProperty key for the default notification time-to-live, in milliseconds.static final StringProperty key for the maximum number of concurrently in-flight push sends.static final intDefault value forgetMaxParallelPush()when unset: 1000.static final intMaximum permitted value forgetMaxParallelPush(): 100000.static final intMinimum permitted value forgetMaxParallelPush(): 100.static final StringProperty key for this server's outbound push throughput roof, in sends per second.static final intDefault push throughput roof when unset: 500 sends/second.static final intMaximum permitted push throughput roof: 50000 sends/second.static final intMinimum permitted push throughput roof: 10 sends/second.static final StringProperty key for the spool directory path.static final longDefault TTL when unset: 2073600000L ms (24 days, the shipped designer default).static final longMaximum permitted default TTL: 2419200000L ms (28 days, the RFC 8030 maximum).static final longMinimum permitted default TTL: 60000L ms (one minute).Method Summary
Modifier and TypeMethodDescriptionGets the server-default delivery mode applied to a send that does not name its own.Gets the server-default residency policy applied to a send that does not name its own.longGets the default time-to-live applied to a notification that does not carry its own TTL, in milliseconds.intGets the hard ceiling on the number of push notifications that may be "floating through the channels" at any single moment.intGets this server's outbound push throughput roof, in sends per second.Gets the directory in which the write-ahead spool holds notifications that could not be delivered immediately — because no recipient was reachable, or because a target region's server was down.
Field Details
MAX_PARALLEL
Property key for the maximum number of concurrently in-flight push sends.- See Also:
PARALLEL_MIN
PARALLEL_DEFAULT
PARALLEL_MAX
DEFAULT_TTL
Property key for the default notification time-to-live, in milliseconds.- See Also:
TTL_MIN
static final long TTL_MINMinimum permitted default TTL: 60000L ms (one minute).- See Also:
TTL_DEFAULT
static final long TTL_DEFAULTDefault TTL when unset: 2073600000L ms (24 days, the shipped designer default).- See Also:
TTL_MAX
static final long TTL_MAXMaximum permitted default TTL: 2419200000L ms (28 days, the RFC 8030 maximum).- See Also:
PUSH_ROOF
Property key for this server's outbound push throughput roof, in sends per second.- See Also:
PUSH_ROOF_MIN
static final int PUSH_ROOF_MINMinimum permitted push throughput roof: 10 sends/second.- See Also:
PUSH_ROOF_DEFAULT
static final int PUSH_ROOF_DEFAULTDefault push throughput roof when unset: 500 sends/second.- See Also:
PUSH_ROOF_MAX
static final int PUSH_ROOF_MAXMaximum permitted push throughput roof: 50000 sends/second.- See Also:
DEFAULT_RESIDENCY_POLICY
Property key for the server-defaultResidencyPolicy, stored as itsordinal().- See Also:
DEFAULT_DELIVERY_MODE
Property key for the server-defaultDeliveryMode, stored as itsordinal().- See Also:
SPOOL_DIRECTORY
Property key for the spool directory path. An empty value selects the server default.- See Also:
Method Details
getMaxParallelPush
int getMaxParallelPush()Gets the hard ceiling on the number of push notifications that may be "floating through the channels" at any single moment.This is enforced by the engine as an admission gate: a send acquires one permit before it is dispatched to a transport and releases it on completion (delivered, failed, or spooled). When all permits are held, further sends queue rather than launch, so the outbound concurrency never exceeds this value regardless of how many sends are requested. It bounds the virtual-thread executor, which is otherwise unbounded by construction.
The value is clamped into the range [100, 100000]; the default is 1000. A larger value increases throughput at the cost of memory and downstream (FCM/VAPID) rate-limit pressure; a smaller value is gentler on the network but slows bulk delivery.
getDefaultTTL
long getDefaultTTL()Gets the default time-to-live applied to a notification that does not carry its own TTL, in milliseconds.The stored and configured unit is milliseconds throughout the IIZI push classes and the designer; the conversion to the seconds required by the RFC 8030
TTLheader (or the FCM equivalent) happens only at the transport boundary, nowhere else. A spooled message checks its remaining TTL before replay so an expired message is dropped rather than resent.The value is clamped into [60000L, 2419200000L] ms; the default is 2073600000L ms.
- Returns:
- The default notification TTL in milliseconds, in [60000L, 2419200000L].
getPushRoof
int getPushRoof()Gets this server's outbound push throughput roof, in sends per second.This is the push capacity roof, deliberately separate from the session capacity roof that governs how many live WebSocket sessions a server may hold. A server full of sessions may still have push headroom, and a server used heavily for push may hold few sessions; the two resources are independent and are routed against independently. The router will not dispatch a slice to a server over this roof; it spreads to a sibling in the same region or spools briefly, so delivery latency stays bounded. A
DeliveryUrgency.FASTsend may be permitted to burst past this soft roof; aDeliveryUrgency.DONT_CAREsend respects it strictly.getDefaultResidencyPolicy
ResidencyPolicy getDefaultResidencyPolicy()Gets the server-default residency policy applied to a send that does not name its own.Governs only the handling of subscriptions whose region cannot be resolved; a subscription with a known region is always routed to its home region regardless of this setting (that is the residency invariant, not a policy).
Stored as an ordinal per the enum-storage idiom in the type documentation; an out-of-range stored index resolves to
ResidencyPolicy.DEFAULT(ResidencyPolicy.MUST) rather than throwing, because failing closed on unresolved residency is never a compliance violation whereas failing open can be.- Returns:
- The default
ResidencyPolicy; nevernull.
getDefaultDeliveryMode
DeliveryMode getDefaultDeliveryMode()Gets the server-default delivery mode applied to a send that does not name its own.Stored as an ordinal per the enum-storage idiom in the type documentation; an out-of-range stored index resolves to
DeliveryMode.DEFAULT(DeliveryMode.PREFER_IN_SESSION), which uses the fastest and cheapest tier whenever the recipient is live and falls back to a device push otherwise.- Returns:
- The default
DeliveryMode; nevernull.
getSpoolDirectory
String getSpoolDirectory()Gets the directory in which the write-ahead spool holds notifications that could not be delivered immediately — because no recipient was reachable, or because a target region's server was down.The spool provides two durability guarantees with one mechanism: a sudden server shutdown does not lose an accepted-but-unsent notification, and a transient regional outage does not drop notifications destined for that region. On restart, or when a region returns, the spool replays whatever remains, dropping any entry whose TTL has since elapsed. An empty configured value selects a server-determined default location.
- Returns:
- The spool directory path, or an empty string to use the server default; never
null.