Interface SessionManager
- All Known Implementing Classes:
DistributedL2SessionManager,InMemorySessionManager
public interface SessionManager
Manages Server sessions through the
MuleServerSession abstraction.
The purpose of using this versus a simple Map (which is perfectly fine in some cases) is supporting cases in which the
session information needs to be distributed across replicas, Hazelcast nodes or requires some custom persistency
- Since:
- 0.2.0
-
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
-
Method Details
-
recoverSession
- Parameters:
sessionId- the session id- Returns:
- Optionally recover the session of the given
sessionId
-
upsert
Registers or updates the givensession -
unregisterAndClose
Unregisters the session associated to thesessionIdand callsMcpSessionDecorator.close()on it- Parameters:
sessionId- the session id- Returns:
- whether a matching session existed or not
-
getLocalSessions
Collection<MuleServerSession> getLocalSessions()For distributed implementations, it returns the sessions that were created in this particular Mule instances. For non distributed implementations, it just returns all sessions.- Returns:
- a collection of sessions
-
close
void close()Closes this instance
-