|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.abstracthorizon.danube.http.session.SimpleCookieSessionManager
org.abstracthorizon.danube.http.session.SimpleSessionManager
public class SimpleSessionManager
Simple session manager implementation that checks for expired sessions
on invocation of HTTPSessionManager methods. If method is invoked sooner then
minScanInterval then scan won't happen.
| Field Summary | |
|---|---|
static int |
DEFAULT_MIN_SCAN_INTERVAL
Default minimum interval between scans for expired sessions |
static int |
DEFAULT_SESSION_TIMEOUT
Default session timeout as 30 minutes |
protected long |
lastScan
When was last scan performed |
protected int |
minScanInterval
Minimum interval between two scans for expired sessions |
protected int |
sessionTimeout
Current session timeout |
| Fields inherited from class org.abstracthorizon.danube.http.session.SimpleCookieSessionManager |
|---|
random, SESSION_ATTRIBUTE, SESSION_COOKIE_NAME, sessionCookieName, sessions |
| Constructor Summary | |
|---|---|
SimpleSessionManager()
|
|
| Method Summary | |
|---|---|
protected void |
checkForExpiredSessions()
Checks if there are expired sessions. |
Object |
findSession(HTTPConnection connection,
boolean create)
Finds a session for supplied connection |
Object |
findSession(Object sessionId,
boolean create)
Searches for the session using givne session id |
int |
getMinScanInterval()
Returns minimum interval between scans for expired sessions |
int |
getSessionTimeout()
Returns session timeout |
void |
removeSession(HTTPConnection connection)
Removes session from connection |
void |
removeSession(Object session)
This object removes existing session |
String |
rewriteURL(HTTPConnection connection,
String url)
Rewrites URL for given connection |
protected void |
scanForExpiredSessions()
Scans all defined sessions for expired ones |
void |
setMinScanInterval(int minScanInterval)
Sets minimum interval between scans for expired sessions |
void |
setSessionTimeout(int sessionTimeout)
Sets session timeout |
| Methods inherited from class org.abstracthorizon.danube.http.session.SimpleCookieSessionManager |
|---|
createSession, createSessionId, getSessionCookieName, setSessionCookieName, validateSessionId |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_SESSION_TIMEOUT
public static final int DEFAULT_MIN_SCAN_INTERVAL
protected int sessionTimeout
protected long lastScan
protected int minScanInterval
| Constructor Detail |
|---|
public SimpleSessionManager()
| Method Detail |
|---|
public Object findSession(HTTPConnection connection,
boolean create)
findSession in interface HTTPSessionManagerfindSession in class SimpleCookieSessionManagerconnection - connectioncreate - flag defining should session be created it doesn't exist already
true or null otherwise.
public Object findSession(Object sessionId,
boolean create)
findSession in interface SessionManagerfindSession in class SimpleCookieSessionManagersessionId - session id objectcreate - flag defining should session be created it doesn't exist already
true or null otherwise.public void removeSession(HTTPConnection connection)
removeSession in interface HTTPSessionManagerremoveSession in class SimpleCookieSessionManagerconnection - connectionpublic void removeSession(Object session)
removeSession in interface SessionManagerremoveSession in class SimpleCookieSessionManagersession - session to be removed
public String rewriteURL(HTTPConnection connection,
String url)
rewriteURL in interface HTTPSessionManagerrewriteURL in class SimpleCookieSessionManagerurl - URL to be rewrittenconnection - http connection object
protected void checkForExpiredSessions()
minScanInterval time.
protected void scanForExpiredSessions()
public int getSessionTimeout()
public void setSessionTimeout(int sessionTimeout)
sessionTimeout - session timeoutpublic int getMinScanInterval()
public void setMinScanInterval(int minScanInterval)
minScanInterval - minimum interval between scans for expired sessions
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||