Package org.teamapps.uisession
Class TeamAppsSessionManager
- java.lang.Object
-
- org.teamapps.uisession.TeamAppsSessionManager
-
- All Implemented Interfaces:
jakarta.servlet.http.HttpSessionListener,java.util.EventListener
public class TeamAppsSessionManager extends java.lang.Object implements jakarta.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 SessionContextcreateSessionContext(UiSession uiSession, org.teamapps.dto.UiClientInfo uiClientInfo, jakarta.servlet.http.HttpSession httpSession, java.lang.String navigationPathPrefix)voiddestroy()java.util.List<SessionPair>getAllSessions()intgetBufferedCommandsCount()java.util.List<UiSessionStats>getClosedSessionsStatistics()intgetNumberOfAvailableClosedSessionStatistics()intgetNumberOfSessions()intgetNumberOfSessionsByState(UiSessionState state)SessionContextgetSessionContextById(java.lang.String sessionId)UiSessiongetUiSessionById(java.lang.String sessionId)intgetUnconsumedCommandsCount()voidinitSession(java.lang.String sessionId, org.teamapps.dto.UiClientInfo clientInfo, jakarta.servlet.http.HttpSession httpSession, int maxRequestedCommandId, MessageSender messageSender)voidsessionCreated(jakarta.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(java.lang.String sessionId)
-
getSessionContextById
public SessionContext getSessionContextById(java.lang.String sessionId)
-
getNumberOfSessions
public int getNumberOfSessions()
-
getNumberOfSessionsByState
public int getNumberOfSessionsByState(UiSessionState state)
-
getAllSessions
public java.util.List<SessionPair> getAllSessions()
-
getBufferedCommandsCount
public int getBufferedCommandsCount()
-
getUnconsumedCommandsCount
public int getUnconsumedCommandsCount()
-
getNumberOfAvailableClosedSessionStatistics
public int getNumberOfAvailableClosedSessionStatistics()
-
getClosedSessionsStatistics
public java.util.List<UiSessionStats> getClosedSessionsStatistics()
-
initSession
public void initSession(java.lang.String sessionId, org.teamapps.dto.UiClientInfo clientInfo, jakarta.servlet.http.HttpSession httpSession, int maxRequestedCommandId, MessageSender messageSender)
-
sessionCreated
public void sessionCreated(jakarta.servlet.http.HttpSessionEvent se)
- Specified by:
sessionCreatedin interfacejakarta.servlet.http.HttpSessionListener
-
updateSessionStates
public void updateSessionStates()
-
destroy
public void destroy()
-
createSessionContext
public SessionContext createSessionContext(UiSession uiSession, org.teamapps.dto.UiClientInfo uiClientInfo, jakarta.servlet.http.HttpSession httpSession, java.lang.String navigationPathPrefix)
-
-