SignStixAutoPurgePrefs
Overview
Naming rules
false (or behave as not present) without creating/modifying data.false.TTL
Storage quota
false (the previous value is preserved).getPrefsUsageBytes() reports current usage; getPrefsQuotaBytes() reports the maximum allowed.Result semantics
true indicates the operation succeeded; false indicates validation failure, not found, not present,
or refusal (e.g., no-overwrite or quota).getString(String, String) returns null when the key is absent or the dictionary is missing/expired.Typical flow
Note: Implementations may synchronously persist metadata so presence checks reflect changes immediately.
| Modifier and Type | Function and Description |
|---|---|
void |
cleanupExpired()
Remove any dictionaries whose Time To Live (TTL) has expired.
|
boolean |
createDictionary(String dictionaryName,
int ttlDays)
Create a named dictionary that will auto-delete after
ttlDays. |
boolean |
destroyDictionary(String dictionaryName)
Explicitly destroy a named dictionary immediately.
|
long |
getPrefsQuotaBytes()
Get the maximum storage quota (in bytes) available for all dictionaries.
|
long |
getPrefsUsageBytes()
Get the current storage usage (in bytes) across all dictionaries.
|
String |
getString(String dictionaryName,
String key)
Retrieve a string value from the named dictionary.
|
boolean |
isDictionaryPresent(String dictionaryName)
Check whether a named dictionary currently exists and has not expired.
|
boolean |
setString(String dictionaryName,
String key,
String value)
Store a string value into the named dictionary under the given key.
|
boolean createDictionary(String dictionaryName,
int ttlDays)
ttlDays.
Validation & behaviour:
false is returned.dictionaryName - name for the new dictionaryttlDays - number of days before auto-deletion (1–365)true if created; false if the name already existed, the name was invalid, or the TTL was out of rangeboolean destroyDictionary(String dictionaryName)
After a successful destroy, the dictionary is no longer present and reads/writes against it will fail
(e.g., getString(String, String) returns null; setString(String, String, String) returns false).
Destroying a non-existent or already expired dictionary returns false.
dictionaryName - name of the dictionarytrue if found and destroyed; false if not present or the name was invalidboolean isDictionaryPresent(String dictionaryName)
dictionaryName - name of the dictionarytrue if present; false otherwise (including invalid name)boolean setString(String dictionaryName,
String key,
String value)
Behaviour: returns false if the dictionary is missing/expired, the name is invalid,
or the write would exceed the global storage quota (in which case the previous value remains).
dictionaryName - name of the dictionarykey - lookup key (implementation defines valid key format)value - string to store (retrievable via the same key)true if stored; false if the dictionary does not exist/is expired, the name was invalid, or quota prevents the writeString getString(String dictionaryName,
String key)
dictionaryName - name of the dictionarykey - lookup keynull if the key is absent, the dictionary is missing/expired, or the name is invalidvoid cleanupExpired()
Implementations may call this automatically during other operations; this Function triggers an immediate cleanup pass.
long getPrefsUsageBytes()
Usage reflects the total size consumed by dictionary data; implementations may exclude internal metadata.
long getPrefsQuotaBytes()
When usage meets or exceeds this value, subsequent writes are refused and return false.