Interface McpSessionStore


@ThreadSafe public interface McpSessionStore
Compare-and-set persistence contract for MCP sessions.
Author:
Mark Allen
  • Method Details

    • create

      Persists a newly-created session.
      Parameters:
      session - the session to create
    • findBySessionId

      Loads a session by ID.
      Parameters:
      sessionId - the session ID
      Returns:
      the stored session, if it exists and has not expired
    • replace

      Replaces a session using compare-and-set semantics.
      Parameters:
      expected - the currently-stored session snapshot
      updated - the replacement session snapshot
      Returns:
      true if the replacement succeeded
    • deleteBySessionId

      Deletes a session by ID.
      Parameters:
      sessionId - the session ID to delete
    • fromInMemory

      Acquires the default in-memory session store using Soklet's default idle timeout.

      Expired sessions are reclaimed opportunistically during subsequent write activity; exact deletion timing is therefore best-effort rather than timer-driven.

      Returns:
      a new in-memory session store
    • fromInMemory

      Acquires the default in-memory session store using a caller-supplied idle timeout.

      Expired sessions are reclaimed opportunistically during subsequent write activity; exact deletion timing is therefore best-effort rather than timer-driven.

      Parameters:
      idleTimeout - the idle timeout, or Duration.ZERO to disable idle expiry
      Returns:
      a new in-memory session store