Class PushNotificationsProps
- All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, IPushSettings, Cloneable
IPushSettings configuration contract.Scope. This container is server-wide: it holds the settings that govern this iiziServer installation's push subsystem as a whole. It is deliberately not an extension of com.iizix.prop.PushProps, which is the per-application push container holding the VAPID key pair and the APNs identities of one iiziApp. The two have different lifetimes, different owners and different editors, and merging them would tie a server restart to an application deployment.
Reading a setting never throws and never returns an out-of-range value. Every accessor of IPushSettings is implemented here by reading the stored value with the inherited typed accessor and then clamping it into the documented range, so a value edited out of range - by an administrator, by a transport error, or by a hand-edited file - can never take the subsystem outside its safe envelope. The bounds are part of the contract, not advice.
Two-tier logging on read. A missing value is the normal path and is silent: the default parameter of the inherited accessor supplies the documented default. A value that is present but unreadable - out of range, or an enum ordinal outside the constant set - returns the safe value and logs, because a bad stored value is evidence of a mis-edit, a bad migration or a transport corruption and must leave a trace. Note that this logs on every read of a corrupt value; callers on a hot path are expected to read a setting once and hold it (the engine builds its admission semaphore from getMaxParallelPush() at start-up and does not re-read it per send).
The setters do not clamp into the setting's range. That clamp is a read-side guarantee and lives in exactly one place, the getter. A setter stores what it is given, so that a value written by an administrator, a transport delta or a loaded XML file is preserved as written and is reported by the getter's log when it is out of range, rather than being silently rewritten on the way in and hidden from the operator who typed it.
But a setter does refuse a value the storage cannot hold, and says so. These are two different ranges and only one of them is policy. The setting's range - say [100, 100000] - is policy, and is enforced on read. The storable range is a property of IntProp, which holds only [IntProp.MIN_VALUE, IntProp.MAX_VALUE] = [-0x1FFFFFFF, 0x1FFFFFFF] because that is what its wire encoding carries. Handing IntProp more than that raises an InternalError from inside the property framework - an Error, which the inherited PropCnr.setInt cannot absorb although its own documentation promises to log a warning and return false. An administrator who types a large number into ServerAdmin must not be answered with that. So an int setter here checks the storable range first and, when the value will not fit, stores nothing, logs a WARNING naming the value that was passed, and returns false - which is exactly the behaviour setInt documents and fails to deliver. Nothing the administrator did not type is ever persisted, the previous value stands, and the evidence names the number they actually entered.
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AtomThe atom for the server-wide Push Notification settings container: "$pushNotifications".Fields inherited from class PropCnr
EMPTY, EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_IDFields inherited from class GProp
GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2Fields inherited from interface IGProp
EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_INCLUDE_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATEFields inherited from interface IPushSettings
DEFAULT_DELIVERY_MODE, DEFAULT_RESIDENCY_POLICY, DEFAULT_TTL, MAX_PARALLEL, PARALLEL_DEFAULT, PARALLEL_MAX, PARALLEL_MIN, PUSH_ROOF, PUSH_ROOF_DEFAULT, PUSH_ROOF_MAX, PUSH_ROOF_MIN, SPOOL_DIRECTORY, TTL_DEFAULT, TTL_MAX, TTL_MINConstructor Summary
ConstructorsConstructorDescriptionCreates a Push Notification settings container without name and with a null value.PushNotificationsProps(Atom propertyAtom) Creates a Push Notification settings container with the specified name with a null value.Method Summary
Modifier and TypeMethodDescriptionclone()Creates a clone out of this property.Gets 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, clamped into [60000L, 2419200000L] with the default 2073600000L.intintGets the directory in which the write-ahead spool holds notifications that could not be delivered immediately.booleanSets the server-default delivery mode, stored as the constant'sordinal().booleanSets the server-default residency policy, stored as the constant'sordinal().booleansetDefaultTTL(long value) Sets the default time-to-live applied to a notification that does not carry its own TTL, in milliseconds.booleansetMaxParallelPush(int value) Sets the hard ceiling on the number of push notifications in flight at any single moment.booleansetPushRoof(int value) Sets this server's outbound push throughput roof in sends per second.booleansetSpoolDirectory(String value) Sets the spool directory path.Methods inherited from class PropCnr
__transferChildProps, addPredefinedProps, addProp, addProp, addProp2, addProp2, appendPropValue, canRequestFocus, completeVirtualize, containsProp, containsProp, convertLoadedProp, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, enablePropCommunication, enablePropHashMap, equalsTree, equalsTree, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsContainer, getExtendsError, getExtendsName, getExtendsOverride, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getPredefinedProps, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue0, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasFocus, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, isPropValueTreeLockNeeded, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropDispose, onPropRemoved, onPropTreeInitialized, onReferenceEvent, onVirtualContainerCreated, onVirtualizationCompleted, paramString, prepare, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, replaceProps, requestFocus, requestFocus, requestFocusEx, requestFocusEx, resolveReferences, resolveRuntimeReferences, setBool, setBool, setBool, setBool, setCreateRequiredProp, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, shouldCreateProps, shouldSerializeToXML, toElementString, toNativeValue0, usePropHashMap, usesPropIndex, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verify, verifyInternalUseOnly, verifyTree, virtualizeMethods inherited from class GProp
addPropError, addPropListener, appendProp, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferencePropNameNoAssert, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParentNoAssert, getTreeLock, hasChanged, hasCircularReferencesError, hashCode, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropUSER, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, isSibling, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropValueSet, onRemoteEvent, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warningMethods inherited from interface IGProp
addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, isSibling, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onEventSelf, onRemoteEvent, removePropError, removePropListener, renameProp, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warningMethods inherited from interface IPropCnr
canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized
Field Details
ATOM
The atom for the server-wide Push Notification settings container: "$pushNotifications".
Constructor Details
PushNotificationsProps
public PushNotificationsProps()Creates a Push Notification settings container without name and with a null value.PushNotificationsProps
Creates a Push Notification settings container with the specified name with a null value.- Parameters:
propertyAtom- The property atom.
Method Details
clone
Creates a clone out of this property.getMaxParallelPush
public int getMaxParallelPush()Gets the hard ceiling on the number of push notifications that may be in flight at any single moment, clamped into [100, 100000] with the default 1000.- Specified by:
getMaxParallelPushin interfaceIPushSettings- Returns:
- The maximum number of concurrent in-flight push sends.
setMaxParallelPush
public boolean setMaxParallelPush(int value) Sets the hard ceiling on the number of push notifications in flight at any single moment.The value is stored as given: see the class documentation for why the setter does not clamp into the setting's own range. A value outside [100, 100000] is reported by
getMaxParallelPush(). A value outside what anIntPropcan hold is refused here, logged, and not stored.- Parameters:
value- The maximum number of concurrent in-flight push sends.- Returns:
- true when this property container has been changed, false otherwise - including when the value was refused as unstorable.
getDefaultTTL
public long getDefaultTTL()Gets the default time-to-live applied to a notification that does not carry its own TTL, in milliseconds, clamped into [60000L, 2419200000L] with the default 2073600000L.- Specified by:
getDefaultTTLin interfaceIPushSettings- Returns:
- The default notification TTL in milliseconds.
setDefaultTTL
public boolean setDefaultTTL(long value) Sets the default time-to-live applied to a notification that does not carry its own TTL, in milliseconds. The conversion to the seconds required by the RFC 8030TTLheader happens at the transport boundary, never here.The value is stored as given: see the class documentation for why the setter does not clamp.
- Parameters:
value- The default notification TTL in milliseconds.- Returns:
- true when this property container has been changed, false otherwise.
getPushRoof
public int getPushRoof()Gets this server's outbound push throughput roof in sends per second, clamped into [10, 50000] with the default 500.- Specified by:
getPushRoofin interfaceIPushSettings- Returns:
- The outbound push throughput roof in sends/second.
setPushRoof
public boolean setPushRoof(int value) Sets this server's outbound push throughput roof in sends per second.The value is stored as given: see the class documentation for why the setter does not clamp into the setting's own range. A value outside what an
IntPropcan hold is refused here, logged, and not stored.- Parameters:
value- The outbound push throughput roof in sends/second.- Returns:
- true when this property container has been changed, false otherwise - including when the value was refused as unstorable.
getDefaultResidencyPolicy
Gets the server-default residency policy applied to a send that does not name its own.Stored as the constant's
ordinal(). A stored index outside the constant set resolves toResidencyPolicy.DEFAULTand is logged, because failing closed on unresolved residency is never a compliance violation whereas failing open can be.- Specified by:
getDefaultResidencyPolicyin interfaceIPushSettings- Returns:
- The default
ResidencyPolicy; nevernull.
setDefaultResidencyPolicy
Sets the server-default residency policy, stored as the constant'sordinal().Because the stored value is an ordinal, the order of the
ResidencyPolicyconstants is part of the persisted and wire contract: new constants are appended, never inserted or reordered.- Parameters:
value- The default residency policy.- Returns:
- true when this property container has been changed, false otherwise.
- Throws:
NullPointerException- Ifvalueisnull.
getDefaultDeliveryMode
Gets the server-default delivery mode applied to a send that does not name its own.Stored as the constant's
ordinal(). A stored index outside the constant set resolves toDeliveryMode.DEFAULTand is logged.- Specified by:
getDefaultDeliveryModein interfaceIPushSettings- Returns:
- The default
DeliveryMode; nevernull.
setDefaultDeliveryMode
Sets the server-default delivery mode, stored as the constant'sordinal().Because the stored value is an ordinal, the order of the
DeliveryModeconstants is part of the persisted and wire contract: new constants are appended, never inserted or reordered.- Parameters:
value- The default delivery mode.- Returns:
- true when this property container has been changed, false otherwise.
- Throws:
NullPointerException- Ifvalueisnull.
getSpoolDirectory
Gets the directory in which the write-ahead spool holds notifications that could not be delivered immediately. An empty string selects the server-determined default location.- Specified by:
getSpoolDirectoryin interfaceIPushSettings- Returns:
- The spool directory path, or an empty string for the server default; never
null.
setSpoolDirectory
Sets the spool directory path. An empty value selects the server default location.- Parameters:
value- The spool directory path, or an empty string for the server default.- Returns:
- true when this property container has been changed, false otherwise.