public class JcmsSessionTracker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
IGNORE_SESSION
It is possible to specify the session must not be registered, by setting the request
attribute with this key and Boolean.TRUE as value.
|
static java.lang.String |
REVISION |
Modifier and Type | Method and Description |
---|---|
static void |
addTrace(javax.servlet.http.HttpSession session,
java.util.HashMap<java.lang.String,java.lang.Object> trace)
Add a new trace to the given HttpSession.
|
static int |
getAllSessionCount()
Returns the count of sessions, that is, getLoggedMemberSet().size()
+ getUnauthenticatedCount()
|
static java.util.Set<Member> |
getLoggedMemberSet()
Returns the set of member who have a valid session where there
are logged.
|
static int |
getLoggedSessionCount()
Returns the number of logged session
|
static int |
getMaxTraceNbr() |
static int |
getMemberSessionCount(Member member)
Returns the number of logged session for a given member.
|
static java.util.HashMap<java.lang.String,java.util.LinkedList<java.util.HashMap<java.lang.String,java.lang.Object>>> |
getMemberSessionIdTraceMap(Member mbr)
Retrieve all traces associated with a given member.
|
static java.util.LinkedList<java.util.HashMap<java.lang.String,java.lang.Object>> |
getTraceList(javax.servlet.http.HttpSession session)
Return a LinkedList (a copy) of the traces (HashMap) of the given HttpSession.
|
static java.util.LinkedList<java.util.HashMap<java.lang.String,java.lang.Object>> |
getTraceList(java.lang.String sessionId)
Return a ArrayList (a copy) of the traces (HashMap) of the HttpSession corresponding
to the given session id.
|
static int |
getUnauthenticatedCount()
Returns the count of unauthenticated session (including normal clients and robots).
|
static int |
getUnauthenticatedNonRobotCount()
Returns the count of unauthenticated session which are not from robots.
|
static int |
getUnauthenticatedRobotCount()
Returns the count of unauthenticated session which are from robots.
|
static boolean |
isLogged(Member member)
Returns true if the given member has a valid logged session
|
static void |
logDebugInformation() |
static boolean |
removeMemberFromSessionTracker(Member mbr)
Remove the given member from the session tracker.
|
static void |
removeSession(javax.servlet.http.HttpSession session)
Remove the given session from the JCMS session tracker.
|
static void |
setMaxTraceNbr(int maxTraceNbr)
Set the maximum number of trace to keep per session, default value is 0.
|
static void |
trackSession(javax.servlet.http.HttpSession session,
Member loggedMember)
Enable tracking for this session.
|
static void |
update(javax.servlet.http.HttpSession session,
Member member)
Associate a member to a given session (using its ID) in the JCMS session tracker.
|
public static final java.lang.String REVISION
public static final java.lang.String IGNORE_SESSION
public static void logDebugInformation()
public static void trackSession(javax.servlet.http.HttpSession session, Member loggedMember)
session
- the HttpSession to trackloggedMember
- the Member logged for this sessionpublic static void removeSession(javax.servlet.http.HttpSession session)
session
- the session to remove from the session tracker.public static void update(javax.servlet.http.HttpSession session, Member member)
session
- the member's HttpSessionmember
- the logged member in the given session (null if no authenticated member)public static int getMaxTraceNbr()
public static void setMaxTraceNbr(int maxTraceNbr)
maxTraceNbr
- specify the maximum number as follow
public static void addTrace(javax.servlet.http.HttpSession session, java.util.HashMap<java.lang.String,java.lang.Object> trace)
session
- the HttpSession in which to add a tracetrace
- a HashMap containing anypublic static java.util.LinkedList<java.util.HashMap<java.lang.String,java.lang.Object>> getTraceList(javax.servlet.http.HttpSession session)
session
- the HttpSession of which you want to get tracepublic static java.util.LinkedList<java.util.HashMap<java.lang.String,java.lang.Object>> getTraceList(java.lang.String sessionId)
sessionId
- the session id of the HttpSession of which you want to get tracepublic static java.util.HashMap<java.lang.String,java.util.LinkedList<java.util.HashMap<java.lang.String,java.lang.Object>>> getMemberSessionIdTraceMap(Member mbr)
mbr
- the member whom to find traces.public static boolean removeMemberFromSessionTracker(Member mbr)
mbr
- the member to removetrue
if member was removed, false if it was not in session trackerpublic static java.util.Set<Member> getLoggedMemberSet()
public static int getUnauthenticatedCount()
public static int getUnauthenticatedNonRobotCount()
public static int getUnauthenticatedRobotCount()
public static int getAllSessionCount()
public static int getLoggedSessionCount()
public static boolean isLogged(Member member)
member
- the member to checkpublic static int getMemberSessionCount(Member member)
member
- the member to checkCopyright © 2001-2010 Jalios SA. All Rights Reserved.