org.jwall.web.audit.session
Interface SessionTracker

All Superinterfaces:
AuditEventListener, EventListener<AuditEvent>
All Known Implementing Classes:
AbstractSessionTracker, CookieSessionTracker, HeuristicSessionTracker

public interface SessionTracker
extends AuditEventListener

This interface defines the basic function of a session tracker.

Author:
Christian Bockermann <chris@jwall.org>

Method Summary
 void eventArrived(AuditEvent event)
          This method simply associates the give event with a session or creates a new session if this event is not related to a previous one.
 Session getSession(String sessionId)
          This method is meant to return the session that is associated with the given ID.
 Collection<Session> getSessions()
          Returns a list (collection) of the sessions that have been created/observed by this tracker.
 long getSessionTimeOut()
          This method simply returns the session timeout of the tracker implementation.
 void reset()
          This method resets the tracker to a clean state, forgetting about all sessions.
 void setSessionTimeOut(long s)
          This method sets the session timeout.
 void setStrictSessions(boolean b)
          Enables strict-mode for tracking/creating new sessions.
 boolean usesStrictSessions()
          Returns true, if the tracker only produces strict sessions.
 
Methods inherited from interface org.jwall.web.audit.AuditEventListener
eventsArrived
 

Method Detail

setStrictSessions

void setStrictSessions(boolean b)
Enables strict-mode for tracking/creating new sessions. When settings this to true, new sessions are only created by session-identifiers sent from the server-side (Set-Cookie, href,...).

Parameters:
b -

setSessionTimeOut

void setSessionTimeOut(long s)
This method sets the session timeout. After this amount of time without any requests by the client the session is simply timed out.

Parameters:
s - The session timeout in milliseconds!

getSessionTimeOut

long getSessionTimeOut()
This method simply returns the session timeout of the tracker implementation. The value returned is the amount of milliseconds after which the session is declared to have timed out.

Returns:
The session timeout in milliseconds!

usesStrictSessions

boolean usesStrictSessions()
Returns true, if the tracker only produces strict sessions.

Returns:
true, if this tracker creates only strict sessions.

eventArrived

void eventArrived(AuditEvent event)
This method simply associates the give event with a session or creates a new session if this event is not related to a previous one.

Specified by:
eventArrived in interface AuditEventListener
Specified by:
eventArrived in interface EventListener<AuditEvent>
Parameters:
event -

reset

void reset()
This method resets the tracker to a clean state, forgetting about all sessions.


getSessions

Collection<Session> getSessions()
Returns a list (collection) of the sessions that have been created/observed by this tracker. This collections contains all active and inactive sessions.

Returns:
A collection of the sessions created by this tracker.

getSession

Session getSession(String sessionId)
This method is meant to return the session that is associated with the given ID. The session id is expected to be unique among all sessions.

Parameters:
sessionId - The id of the session that is to be returned.
Returns:
The session that is assiciated with the given id.


Copyright © 2012 jwall.org. All Rights Reserved.