Class SessionManager
java.lang.Object
dev.tachyonmcp.core.server.session.SessionManager
- All Implemented Interfaces:
AutoCloseable
Manages the lifecycle of MCP sessions.
-
Constructor Summary
ConstructorsConstructorDescriptionSessionManager(SessionStore store) Creates a session manager backed by the given store. -
Method Summary
Modifier and TypeMethodDescriptionReturns all active sessions.voidclose()createSession(String sessionId) Creates a session with no initial connection.createSession(String sessionId, SseConnection connection) Creates a session with the given SSE connection.getSession(@Nullable String sessionId) Returns the session for the given ID, if present.voidremoveSession(String sessionId) Removes and closes the session with the given ID.voidstartJanitor(Duration ttl, Duration interval) Starts the background janitor that closes expired sessions.
-
Constructor Details
-
SessionManager
Creates a session manager backed by the given store.
-
-
Method Details
-
createSession
Creates a session with no initial connection. -
createSession
Creates a session with the given SSE connection. -
getSession
Returns the session for the given ID, if present. -
allSessions
Returns all active sessions. -
removeSession
Removes and closes the session with the given ID. -
startJanitor
Starts the background janitor that closes expired sessions. -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-