|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectsky.common.session.BaseTracker
This class keeps track of various user sessions that are initiated. Besides monitoring all the session information, the Tracker also provides an API that can be used to access information on each of the sessions that are being tracked. The tracker can also persist sessions to a database or a file.
$RCSfile: BaseTracker.java,v $
$Revision: 1.2 $, $Date: 2005/04/24 03:14:00 $
| Field Summary | |
protected boolean |
_active
true if tracker is running; otherwise, false. |
protected int |
_max
Maximum limit on number of sessions that are being tracked. |
protected java.util.Hashtable |
_sessions
Sessions being tracked currently. |
protected long |
_timeout
Time interval after which an idling session is dropped and not tracked any more. |
| Constructor Summary | |
BaseTracker(int max,
long timeout)
Constructor |
|
| Method Summary | |
void |
activate()
Starts the tracker. |
void |
deactivate()
Stops the tracker. |
int |
getSessionCount()
Gets number of sessions that are currently being tracked. |
java.util.Enumeration |
getSessionIds()
Gets the ids of all sessions that are being tracked. |
java.util.Enumeration |
getSessionObj()
Gets all the sessions that are being tracked. |
Session |
getSessionObj(java.lang.String id)
Gets a session object with given id. |
boolean |
isActive()
Checks if tracker is active. |
void |
reset()
Resets the tracker and clears all state information. |
void |
track(java.lang.String id,
java.lang.String ip,
Event event)
Add an event to a perticular session. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int _max
protected long _timeout
protected boolean _active
protected java.util.Hashtable _sessions
| Constructor Detail |
public BaseTracker(int max,
long timeout)
max - maximum number of sessions that will be tracked at any given time.timeout - time interval after which an idling session will no longer be tracked.| Method Detail |
public void activate()
activate in interface Trackerpublic void deactivate()
deactivate in interface Trackerpublic boolean isActive()
isActive in interface Trackerpublic void reset()
reset in interface Trackerpublic java.util.Enumeration getSessionIds()
getSessionIds in interface Trackerpublic java.util.Enumeration getSessionObj()
getSessionObj in interface Trackerpublic Session getSessionObj(java.lang.String id)
getSessionObj in interface Trackerpublic int getSessionCount()
getSessionCount in interface Tracker
public void track(java.lang.String id,
java.lang.String ip,
Event event)
track in interface Trackerid - unique id of a new or existing session.ip - ip address where this session originted from.event - Event that occured.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||