Package com.tnsai.memory.advanced
Class SessionRestorer
java.lang.Object
com.tnsai.memory.advanced.SessionRestorer
Restores
TieredMemoryStore state from a JSON session file.
Reads the JSON file written by SessionSerializer and
reconstructs the tiered memory store with all entries, provenance,
and versioning metadata.
-
Constructor Summary
ConstructorsConstructorDescriptionSessionRestorer(Path directory) Creates a restorer that reads from the given directory. -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasSession(String agentId) Checks whether a session file exists for the given agent.Restores the tiered memory store for the given agent.
-
Constructor Details
-
SessionRestorer
Creates a restorer that reads from the given directory.- Parameters:
directory- the directory containing session files
-
-
Method Details
-
restore
Restores the tiered memory store for the given agent.- Parameters:
agentId- the agent ID- Returns:
- a populated TieredMemoryStore, or an empty store if no file exists
- Throws:
IOException- if the file exists but cannot be read
-
hasSession
Checks whether a session file exists for the given agent.
-