|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jwall.web.audit.session.AbstractSessionTracker
public abstract class AbstractSessionTracker
This class is an abstract implementation of a simple session tracker and provides the basis for the tracker HeuristicSessionTracker and CookieSessionTracker.
| Constructor Summary | |
|---|---|
AbstractSessionTracker()
This creates a new instance of this class which is based on the default timeout of 2 hours ( = 7200000 ms ). |
|
AbstractSessionTracker(long timeout)
This initializes the tracker with the given session-timeout. |
|
| Method Summary | |
|---|---|
void |
eventArrived(AuditEvent event)
This method tracks an AuditEvent object and creates a session if none existed yet. |
void |
eventsArrived(Collection<AuditEvent> events)
This method is called for notifying the listener of arrival of several events in a block. |
abstract String |
extractKey(AuditEvent evt)
This method extracts the key-feature from an event which is used to identify the session that this event is related to. |
Session |
getSession(String sessionId)
This method returns the session with the given session-id. |
Collection<Session> |
getSessions()
This method returns all the sessions (active and timed-out) that have been created by the session-tracker. |
long |
getSessionTimeOut()
Returns the session-timeout that is used by this tracker. |
boolean |
isExpired(Session s,
AuditEvent event)
This method is used to check a session for expiration according to the date of the given audit-event. |
void |
reset()
This method simply resets the session-tracker to the initial state which holds no sessions. |
void |
setSessionTimeOut(long s)
This method is used to set the session-timeout. |
void |
setStrictSessions(boolean b)
In a strict session the session-id is presumed to be created by the server-side application. |
String |
toString()
This method returns a string of all events grouped by their session-id. |
boolean |
usesStrictSessions()
Returns true, if the tracker only produces strict sessions. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractSessionTracker()
public AbstractSessionTracker(long timeout)
timeout - The session-timeout in seconds.| Method Detail |
|---|
public void eventArrived(AuditEvent event)
eventArrived in interface EventListener<AuditEvent>eventArrived in interface AuditEventListenereventArrived in interface SessionTrackerevent - The AuditEvent instance that is to be associated with a session.public void eventsArrived(Collection<AuditEvent> events)
AuditEventListenerAuditEventListener.eventArrived(AuditEvent) for each of the given
events, but may be handled in a more efficient way by implementations
capable of processing blocks of events.
eventsArrived in interface AuditEventListenerevents - The block of events arrived.public Session getSession(String sessionId)
getSession in interface SessionTrackersessionId - The id of the session that is to be retrieved.
null if the
session is inactive or does not exist at all.public Collection<Session> getSessions()
getSessions in interface SessionTrackerpublic void reset()
reset in interface SessionTracker
public boolean isExpired(Session s,
AuditEvent event)
s - The session that is to be checked.event - The event which defines the current date.
true if the sessions' last access-time is no longer that
a period of X seconds away from the events date. Here X is the session-timeout
defined for this session-tracker.public void setSessionTimeOut(long s)
setSessionTimeOut in interface SessionTrackers - The number of seconds after which a session is to be timed out.public long getSessionTimeOut()
getSessionTimeOut in interface SessionTrackerpublic void setStrictSessions(boolean b)
setStrictSessions in interface SessionTrackerb - Wether this tracker should only track strict sessions.public boolean usesStrictSessions()
SessionTrackertrue, if the tracker only produces strict sessions.
usesStrictSessions in interface SessionTrackerpublic abstract String extractKey(AuditEvent evt)
evt - The event from which to extract the session-id.
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||