|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jwall.web.audit.session.Session
public class Session
This class implements a data storage of some key-value-pairs, all associated with a unique session-id.
| Field Summary | |
|---|---|
static int |
COOKIE_BASED
|
static int |
HEURISTIC_BASED
|
static int |
PARAMETER_BASED
|
| Constructor Summary | |
|---|---|
Session(int type,
String id,
AuditEvent evt)
Creates a new session with the given session-identifier and the first event of the session being evt. |
|
| Method Summary | |
|---|---|
void |
addEvent(AuditEvent e)
|
int |
compareTo(Session s)
This compares the session to s. |
boolean |
equals(Object o)
|
Date |
firstAccessed()
|
String |
getId()
This method returns an unique identifier that serves as a key to this session. |
InetAddress |
getInetAddress()
|
double |
getScore()
|
int |
getType()
Returns wether this session context is tracked based on a Session-Id in Cookies, Parameters or just heuristically using ip, time and user-agent. |
String |
getVariable(String name)
This method returns the string-value of the variable given by name. |
Set<String> |
getVariableNames()
This method returns a set of variable names (strings) that are set within the session scope and did not expire yet. |
int |
hashCode()
|
void |
increment(String var,
int count)
This method will increment the count of the variable var by the
amount of count. |
Date |
lastAccessed()
|
void |
removeVariable(String name)
This method shall remove the variable with the given name from the session-context. |
void |
setInetAddress(InetAddress addr)
|
void |
setScore(double d)
|
void |
setVariable(String name,
String value,
Date expires)
This method creates a new variable with the given name and initializes it to the value provided by value. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int COOKIE_BASED
public static final int PARAMETER_BASED
public static final int HEURISTIC_BASED
| Constructor Detail |
|---|
public Session(int type,
String id,
AuditEvent evt)
evt. Start time of the session
is the date for evt.
type - The type which denotes the kind of session-tracker by which
the session is created.| Method Detail |
|---|
public int getType()
public void setInetAddress(InetAddress addr)
addr - public InetAddress getInetAddress()
public Date lastAccessed()
public Date firstAccessed()
public String getId()
SessionContext
getId in interface SessionContextpublic boolean equals(Object o)
equals in class Objectpublic void addEvent(AuditEvent e)
e - public int compareTo(Session s)
s. Basically this is just a comparison
of the session-identifiers and results in a lexikographical order of sessions based
on ther session-ids.
compareTo in interface Comparable<Session>s -
s, or +1/-1 if it is ordered before/after s.public String toString()
toString in class Objectpublic double getScore()
public void setScore(double d)
public String getVariable(String name)
SessionContextname. If no such
variable exists within this session, null is returned.
getVariable in interface SessionContextname or null if the
variable does not exist.public Set<String> getVariableNames()
SessionContext
getVariableNames in interface SessionContext
public void increment(String var,
int count)
SessionContextvar by the
amount of count. If the variable is a non-numeric one, calling this
method will have no effect.
increment in interface SessionContext
public void setVariable(String name,
String value,
Date expires)
SessionContextvalue. The variable will expire at the given date or
as the session itself expires.
By providing a null value for the date, the variable will be set to
expire at the sessions end.
setVariable in interface SessionContextpublic void removeVariable(String name)
SessionContext
removeVariable in interface SessionContextpublic int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||