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.HttpSessionListenerImplements a cache forUiSessioninstances.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
All Methods Instance Methods Concrete Methods 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 Detail
-
TEAMAPPS_VERSION_REFRESH_PARAMETER
public static final java.lang.String TEAMAPPS_VERSION_REFRESH_PARAMETER
- See Also:
- Constant Field Values
-
onStatsUpdated
public final Event<SessionStatsUpdatedEventData> onStatsUpdated
-
-
Constructor Detail
-
TeamAppsSessionManager
public TeamAppsSessionManager(TeamAppsConfiguration config, com.fasterxml.jackson.databind.ObjectMapper objectMapper, SequentialExecutorFactory sessionExecutorFactory, WebController webController, org.teamapps.icons.IconProvider iconProvider, TeamAppsUploadManager uploadManager)
-
-
Method Detail
-
getUiSessionById
public UiSession getUiSessionById(QualifiedUiSessionId sessionId)
-
getSessionContextById
public SessionContext getSessionContextById(QualifiedUiSessionId sessionId)
-
getNumberOfSessions
public int getNumberOfSessions()
-
getAllSessions
public java.util.List<SessionPair> getAllSessions()
-
getNumberOfAvailableClosedSessionStatistics
public int getNumberOfAvailableClosedSessionStatistics()
-
getClosedSessionsStatistics
public java.util.List<UiSessionStats> 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)
-
-