Interface IAquimaSessionsMap


public interface IAquimaSessionsMap
Session manager class for managing multiple portal sessions.
Since:
8.0
Author:
Danny Roest, Jon van Leuven
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addChildSession(String parentSessionId, IAquimaSession session)
    Adds the Aquima session and sets the unique session id, it will also be registered as a child session of the specified parent session
    void
    addSession(IAquimaSession aquimaSession)
    Adds the Aquima session.
    void
    Closes and removes idle (expired) sessions.
    void
    closeSession(String aquimaSessionId)
    Requests that an aquima session be closed and removed, including all its child sessions.
    void
    When sessions are stored in an external session store, flushing the session manager causes all sessions that may have locally been cached to be written in the external session store and the cache to be cleared.
    This method returns all the available session ids.
    Returns the child sessions of the specified parent session
    getChildSessions(String sessionId, String pageName)
    Returns the child sessions of the specified parent session which were created on the specified page.
    This method returns only sessions that are not child sessions
    getRootSession(String currentSessionId)
    Retrieves the root session from the current session id.
    getSession(String aquimaSessionId)
    Returns the session with the specified id.
    getSession(String aquimaSessionId, FlushMode flushMode)
    Returns the session with the specified id.
    long
    Deprecated, for removal: This API element is subject to removal in a future version.
    this method is deprecated since 19.1 and will be removed in 20.0.
    boolean
    hasSession(String aquimaSessionId)
    Returns an indicator whether the session actually exists.
    void
    keepAlive(String aquimaSessionId)
    Sets the timeout of the session with the given id to the specified timeout.
    default void
    terminateSession(String aquimaSessionId)
    Closes and removes an aquima session, including all its child sessions.
    void
    This method updates the session with the same id as the specified session.
  • Method Details

    • getSessionTimeoutMillis

      @Deprecated(forRemoval=true, since="19.1") long getSessionTimeoutMillis()
      Deprecated, for removal: This API element is subject to removal in a future version.
      this method is deprecated since 19.1 and will be removed in 20.0. Get the session timeout from SessionTimeoutProvider Spring bean instead.
      Returns the session timeout in milliseconds used by this session manager. A zero or negative session timeout means sessions managed by this session manager never expire.
      Returns:
      the session timeout in milliseconds.
    • addSession

      void addSession(IAquimaSession aquimaSession)
      Adds the Aquima session. The session must have a unique ID within this session manager.
      Parameters:
      aquimaSession - the Aquima session to be added
      Throws:
      DuplicateSessionException - if a session with the same id as the given session is already registered with this session manager
    • addChildSession

      void addChildSession(String parentSessionId, IAquimaSession session)
      Adds the Aquima session and sets the unique session id, it will also be registered as a child session of the specified parent session
      Parameters:
      parentSessionId - may not be null
      session - session
      Since:
      9.2
    • hasSession

      boolean hasSession(String aquimaSessionId)
      Returns an indicator whether the session actually exists.
      Parameters:
      aquimaSessionId - The sessionId to check.
      Returns:
      Indicator if session exists.
    • getSession

      IAquimaSession getSession(String aquimaSessionId)
      Returns the session with the specified id. This method is equivalent to getSession(String, FlushMode) called with FlushMode.ALWAYS.
      Parameters:
      aquimaSessionId - the id of the requested aquima session
      Returns:
      the session with the specified id
      Throws:
      UnknownSessionException - When no session is available for the provided id.
    • getSession

      IAquimaSession getSession(String aquimaSessionId, FlushMode flushMode)
      Returns the session with the specified id. The flusMode parameter indicates to this session manager how the session is intended to be used. If the intent is to modify the session, FlushMode.ALWAYS should be used. Otherwise, FlushMode.NEVER should be used.

      Implementations which use an external session store will write the sessions back to the session store when their flush() method is called, if the sessions were obtained with intent to modify them.

      In addition to the performance improvement due to not having to write sessions that were not modified, using FlushMode.NEVER also allows one read-only request to run in parallel with multiple other read-only requests or with one read-write request, without the risk of one request overwriting the session state written by another request into the session store (since only the read-write request will write to the session store).

      Implementations should take into account flush mode precedence (see FlushMode for details). More precisely, once a session has been requested with intent to modify it, that session should always be flushed, even if it has previously or subsequently also been requested without intent to modify it.

      Parameters:
      aquimaSessionId - the id of the requested session
      flushMode - the desired flush mode, depending on how the requested session is going to be used
      Returns:
      the session with the specified id
      Throws:
      UnknownSessionException - When no session is available for the provided id.
    • updateSession

      void updateSession(IAquimaSession aquimaSession)
      This method updates the session with the same id as the specified session.
      Parameters:
      aquimaSession - the session to update
    • closeSession

      void closeSession(String aquimaSessionId)
      Requests that an aquima session be closed and removed, including all its child sessions. This request may be vetoed.
      Parameters:
      aquimaSessionId - the ID of the session to be closed
      Throws:
      UnknownSessionException - when no session is available for the provided ID.
    • terminateSession

      default void terminateSession(String aquimaSessionId)
      Closes and removes an aquima session, including all its child sessions.
      Parameters:
      aquimaSessionId - the ID of the session to be closed
      Throws:
      UnknownSessionException - when no session is available for the provided ID.
    • cleanIdleSessions

      void cleanIdleSessions()
      Closes and removes idle (expired) sessions.
    • keepAlive

      void keepAlive(String aquimaSessionId)
      Sets the timeout of the session with the given id to the specified timeout.
      Parameters:
      aquimaSessionId - - the id of the session that should be kept alive
      Throws:
      UnknownSessionException - when no session is available for the given id.
    • getAvailableSessionIds

      List<String> getAvailableSessionIds()
      This method returns all the available session ids.
      Returns:
      The available session ids, never null, but can be an empty list.
    • getMainSessionIds

      List<String> getMainSessionIds()
      This method returns only sessions that are not child sessions
      Returns:
      A list of session ids, never null, but can be an empty list
      Since:
      9.2
    • getChildSessions

      List<IAquimaSession> getChildSessions(String sessionId)
      Returns the child sessions of the specified parent session
      Parameters:
      sessionId - The parents session id
      Returns:
      A list of sessions, never null, but can be an empty list
      Since:
      9.2
    • getChildSessions

      List<IAquimaSession> getChildSessions(String sessionId, String pageName)
      Returns the child sessions of the specified parent session which were created on the specified page. This can be used to display only child sessions relevant for a specific page.
      Parameters:
      sessionId - The parents session id
      pageName - The name of the page where the child session was created.
      Returns:
      A list of sessions, never null, but can be an empty list
      Since:
      9.5.2
    • getRootSession

      IAquimaSession getRootSession(String currentSessionId)
      Retrieves the root session from the current session id.
      Parameters:
      currentSessionId - the current session Id
      Returns:
      The root session
      Since:
      10.0
    • flush

      void flush()
      When sessions are stored in an external session store, flushing the session manager causes all sessions that may have locally been cached to be written in the external session store and the cache to be cleared.