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 Details

    • recoverSession

      Optional<MuleServerSession> recoverSession(String sessionId)
      Parameters:
      sessionId - the session id
      Returns:
      Optionally recover the session of the given sessionId
    • upsert

      void upsert(MuleServerSession session)
      Registers or updates the given session
    • unregisterAndClose

      boolean unregisterAndClose(String sessionId)
      Unregisters the session associated to the sessionId and calls McpSessionDecorator.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