Package org.teamapps.uisession
Class TeamAppsSessionManager
java.lang.Object
org.teamapps.uisession.TeamAppsSessionManager
- All Implemented Interfaces:
java.util.EventListener,javax.servlet.http.HttpSessionListener
public class TeamAppsSessionManager
extends java.lang.Object
implements javax.servlet.http.HttpSessionListener
Implements a cache for
UiSession instances.
It takes care of the removal of timed-out sessions. The "last used" information is updated every time a session is retrieved.
-
Field Summary
Fields Modifier and Type Field Description Event<SessionStatsUpdatedEventData>onStatsUpdatedstatic java.lang.StringTEAMAPPS_VERSION_REFRESH_PARAMETER -
Constructor Summary
Constructors Constructor Description TeamAppsSessionManager(TeamAppsConfiguration config, com.fasterxml.jackson.databind.ObjectMapper objectMapper, SequentialExecutorFactory sessionExecutorFactory, WebController webController, org.teamapps.icons.IconProvider iconProvider, TeamAppsUploadManager uploadManager) -
Method Summary
Modifier and Type Method Description voidcloseAllSessionsForHttpSession(java.lang.String httpSessionId)SessionContextcreateSessionContext(UiSession uiSession, org.teamapps.dto.UiClientInfo uiClientInfo, javax.servlet.http.HttpSession httpSession)voiddestroy()java.util.List<SessionPair>getAllSessions()java.util.List<UiSessionStats>getClosedSessionsStatistics()intgetNumberOfAvailableClosedSessionStatistics()intgetNumberOfSessions()SessionContextgetSessionContextById(QualifiedUiSessionId sessionId)UiSessiongetUiSessionById(QualifiedUiSessionId sessionId)voidinitSession(QualifiedUiSessionId sessionId, org.teamapps.dto.UiClientInfo clientInfo, javax.servlet.http.HttpSession httpSession, int maxRequestedCommandId, MessageSender messageSender)voidsessionCreated(javax.servlet.http.HttpSessionEvent se)voidsessionDestroyed(javax.servlet.http.HttpSessionEvent se)voidupdateSessionStates()
-
Field Details
-
TEAMAPPS_VERSION_REFRESH_PARAMETER
public static final java.lang.String TEAMAPPS_VERSION_REFRESH_PARAMETER- See Also:
- Constant Field Values
-
onStatsUpdated
-
-
Constructor Details
-
TeamAppsSessionManager
public TeamAppsSessionManager(TeamAppsConfiguration config, com.fasterxml.jackson.databind.ObjectMapper objectMapper, SequentialExecutorFactory sessionExecutorFactory, WebController webController, org.teamapps.icons.IconProvider iconProvider, TeamAppsUploadManager uploadManager)
-
-
Method Details
-
getUiSessionById
-
getSessionContextById
-
getNumberOfSessions
public int getNumberOfSessions() -
getAllSessions
-
getNumberOfAvailableClosedSessionStatistics
public int getNumberOfAvailableClosedSessionStatistics() -
getClosedSessionsStatistics
-
initSession
public void initSession(QualifiedUiSessionId sessionId, org.teamapps.dto.UiClientInfo clientInfo, javax.servlet.http.HttpSession httpSession, int maxRequestedCommandId, MessageSender messageSender) -
sessionCreated
public void sessionCreated(javax.servlet.http.HttpSessionEvent se)- Specified by:
sessionCreatedin interfacejavax.servlet.http.HttpSessionListener
-
sessionDestroyed
public void sessionDestroyed(javax.servlet.http.HttpSessionEvent se)- Specified by:
sessionDestroyedin interfacejavax.servlet.http.HttpSessionListener
-
closeAllSessionsForHttpSession
public void closeAllSessionsForHttpSession(java.lang.String httpSessionId) -
updateSessionStates
public void updateSessionStates() -
destroy
public void destroy() -
createSessionContext
public SessionContext createSessionContext(UiSession uiSession, org.teamapps.dto.UiClientInfo uiClientInfo, javax.servlet.http.HttpSession httpSession)
-