Class StateSerialization
java.lang.Object
com.kingsrook.qqq.backend.core.state.StateSerialization
Turns state values into the text a shared state provider stores, and back:
Java serialization, gzip, then (with a key) AES-256-GCM bound to the state
key, then base64. Reading goes through an ObjectInputFilter that allows only
java.*, javax.*, com.kingsrook.* and the configured class prefixes, with
depth and size limits.
Formats: "g1:" + base64(gzip) without a key; "e1:" + base64(nonce +
ciphertext) with one. A value written in the other format reads as an error
(callers treat it as absent).
-
Constructor Summary
ConstructorsConstructorDescriptionStateSerialization(StateProviderMetaData metaData) Build from meta data (null meta data: no key, the default allow list). -
Method Summary
Modifier and TypeMethodDescriptionfromBytes(byte[] bytes) Un-gzip and deserialize, through the allow-list filter.booleanWhether stored values are encrypted.Read a stored value back.static byte[]toBytes(Serializable value) Java-serialize and gzip a value.write(String stateKey, Serializable value) Serialize a value (bound to its state key when encrypting).
-
Constructor Details
-
StateSerialization
Build from meta data (null meta data: no key, the default allow list).- Throws:
QException
-
-
Method Details
-
isEncrypted
public boolean isEncrypted()Whether stored values are encrypted. -
write
Serialize a value (bound to its state key when encrypting).- Throws:
QException
-
read
Read a stored value back.- Throws:
QException
-
toBytes
Java-serialize and gzip a value.- Throws:
QException
-
fromBytes
Un-gzip and deserialize, through the allow-list filter.- Throws:
QException
-