Class NuxeoHttpSessionMonitor
- java.lang.Object
-
- org.nuxeo.ecm.platform.web.common.session.NuxeoHttpSessionMonitor
-
public class NuxeoHttpSessionMonitor extends Object
Singleton used to keep track of all HttpSessions. This Singleton is populated/updated either via the HttpSessionListener or via directedly via the Authentication filter- Since:
- 5.4.2
- Author:
- Tiry ([email protected])
-
-
Field Summary
Fields Modifier and Type Field Description protected longglobalRequestCounterprotected static NuxeoHttpSessionMonitorinstanceprotected static Loglogstatic StringREQUEST_COUNTERstatic longREQUEST_COUNTER_STEPstatic StringSESSION_COUNTERprotected Map<String,SessionInfo>sessionTracker
-
Constructor Summary
Constructors Constructor Description NuxeoHttpSessionMonitor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SessionInfoaddEntry(javax.servlet.http.HttpSession session)SessionInfoassociatedUser(javax.servlet.http.HttpServletRequest request)SessionInfoassociatedUser(javax.servlet.http.HttpSession session, String userName)longgetGlobalRequestCounter()List<SessionInfo>getSortedSessions()List<SessionInfo>getSortedSessions(long maxInactivity)Collection<SessionInfo>getTrackedSessions()protected voidincreaseRequestCounter()static NuxeoHttpSessionMonitorinstance()voidremoveEntry(String sid)voidremoveEntry(String sid, boolean invalidate)Remove the associated session.SessionInfoupdateEntry(javax.servlet.http.HttpServletRequest request)
-
-
-
Field Detail
-
REQUEST_COUNTER
public static final String REQUEST_COUNTER
- See Also:
- Constant Field Values
-
SESSION_COUNTER
public static final String SESSION_COUNTER
- See Also:
- Constant Field Values
-
REQUEST_COUNTER_STEP
public static final long REQUEST_COUNTER_STEP
- See Also:
- Constant Field Values
-
log
protected static final Log log
-
instance
protected static NuxeoHttpSessionMonitor instance
-
globalRequestCounter
protected long globalRequestCounter
-
sessionTracker
protected Map<String,SessionInfo> sessionTracker
-
-
Method Detail
-
instance
public static NuxeoHttpSessionMonitor instance()
-
increaseRequestCounter
protected void increaseRequestCounter()
-
addEntry
public SessionInfo addEntry(javax.servlet.http.HttpSession session)
-
associatedUser
public SessionInfo associatedUser(javax.servlet.http.HttpServletRequest request)
-
associatedUser
public SessionInfo associatedUser(javax.servlet.http.HttpSession session, String userName)
-
updateEntry
public SessionInfo updateEntry(javax.servlet.http.HttpServletRequest request)
-
removeEntry
public void removeEntry(String sid)
-
removeEntry
public void removeEntry(String sid, boolean invalidate)
Remove the associated session.- Parameters:
sid- the session idinvalidate- should the session be invalidated- Since:
- 2023.3
-
getTrackedSessions
public Collection<SessionInfo> getTrackedSessions()
-
getSortedSessions
public List<SessionInfo> getSortedSessions()
-
getSortedSessions
public List<SessionInfo> getSortedSessions(long maxInactivity)
-
getGlobalRequestCounter
public long getGlobalRequestCounter()
-
-