Class SessionRestorer

java.lang.Object
com.tnsai.memory.advanced.SessionRestorer

public final class SessionRestorer extends Object
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 Details

    • SessionRestorer

      public SessionRestorer(Path directory)
      Creates a restorer that reads from the given directory.
      Parameters:
      directory - the directory containing session files
  • Method Details

    • restore

      public TieredMemoryStore restore(String agentId) throws IOException
      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

      public boolean hasSession(String agentId)
      Checks whether a session file exists for the given agent.