Class InMemorySessionManager
java.lang.Object
com.mulesoft.connectors.mcp.internal.server.session.InMemorySessionManager
- All Implemented Interfaces:
SessionManager
Simple implementation of
SessionManager backed by a ConcurrentHashMap- Since:
- 0.2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this instanceFor distributed implementations, it returns the sessions that were created in this particular Mule instances.recoverSession(String sessionId) booleanunregisterAndClose(String sessionId) Unregisters the session associated to thesessionIdand callsMcpSessionDecorator.close()on itvoidupsert(MuleServerSession session) Registers or updates the givensession
-
Constructor Details
-
InMemorySessionManager
public InMemorySessionManager()
-
-
Method Details
-
unregisterAndClose
Description copied from interface:SessionManagerUnregisters the session associated to thesessionIdand callsMcpSessionDecorator.close()on it- Specified by:
unregisterAndClosein interfaceSessionManager- Parameters:
sessionId- the session id- Returns:
- whether a matching session existed or not
-
getLocalSessions
Description copied from interface:SessionManagerFor distributed implementations, it returns the sessions that were created in this particular Mule instances. For non distributed implementations, it just returns all sessions.- Specified by:
getLocalSessionsin interfaceSessionManager- Returns:
- a collection of sessions
-
close
public void close()Description copied from interface:SessionManagerCloses this instance- Specified by:
closein interfaceSessionManager
-
upsert
Description copied from interface:SessionManagerRegisters or updates the givensession- Specified by:
upsertin interfaceSessionManager
-
recoverSession
- Specified by:
recoverSessionin interfaceSessionManager- Parameters:
sessionId- the session id- Returns:
- Optionally recover the session of the given
sessionId
-