Interface IAquimaSessionsMap
- Since:
- 8.0
- Author:
- Danny Roest, Jon van Leuven
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddChildSession(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 sessionvoidaddSession(IAquimaSession aquimaSession) Adds the Aquima session.voidCloses and removes idle (expired) sessions.voidcloseSession(String aquimaSessionId) Requests that an aquima session be closed and removed, including all its child sessions.voidflush()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.getChildSessions(String sessionId) Returns the child sessions of the specified parent sessiongetChildSessions(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 sessionsgetRootSession(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.longDeprecated, 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.booleanhasSession(String aquimaSessionId) Returns an indicator whether the session actually exists.voidSets the timeout of the session with the given id to the specified timeout.default voidterminateSession(String aquimaSessionId) Closes and removes an aquima session, including all its child sessions.voidupdateSession(IAquimaSession aquimaSession) This method updates the session with the same id as the specified session.
-
Method Details
-
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 fromSessionTimeoutProviderSpring 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
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
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 nullsession- session- Since:
- 9.2
-
hasSession
Returns an indicator whether the session actually exists.- Parameters:
aquimaSessionId- The sessionId to check.- Returns:
- Indicator if session exists.
-
getSession
Returns the session with the specified id. This method is equivalent togetSession(String, FlushMode)called withFlushMode.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
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.ALWAYSshould be used. Otherwise,FlushMode.NEVERshould 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.NEVERalso 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
FlushModefor 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 sessionflushMode- 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
This method updates the session with the same id as the specified session.- Parameters:
aquimaSession- the session to update
-
closeSession
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
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
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
-
getMainSessionIds
-
getChildSessions
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
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 idpageName- 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
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.
-