net.sf.ooweb.sessions
Class SessionManager

java.lang.Object
  extended by net.sf.ooweb.sessions.SessionManager

public class SessionManager
extends java.lang.Object

SessionManager holds a static map of sessions, keyed by session id. Singleton

Since:
0.7
Author:
Darren Davison

Nested Class Summary
static class SessionManager.Strategy
           
 
Field Summary
static java.lang.String COOKIE_NAME
           
protected  java.util.logging.Logger logger
           
 
Method Summary
 java.lang.String createSession()
          create a new Session and return the sessionId
static SessionManager getInstance()
           
 java.util.Map getSession(java.lang.String sessionId)
          Get the current Session
 SessionManager.Strategy getStrategy()
           
 long getTimeout()
           
 void invalidateSession(java.lang.String id)
           
 void setStrategy(SessionManager.Strategy strategy)
           
 void setTimeout(long timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COOKIE_NAME

public static final java.lang.String COOKIE_NAME
See Also:
Constant Field Values

logger

protected final java.util.logging.Logger logger
Method Detail

getInstance

public static SessionManager getInstance()
Returns:
the singleton

createSession

public java.lang.String createSession()
create a new Session and return the sessionId

Returns:
the sessionId of the new session that can be used to get the session

getSession

public java.util.Map getSession(java.lang.String sessionId)
Get the current Session

Parameters:
sessionId - the key
Returns:
the session for this request, based on the session cookie in the request headers

invalidateSession

public void invalidateSession(java.lang.String id)

getStrategy

public SessionManager.Strategy getStrategy()

getTimeout

public long getTimeout()

setStrategy

public void setStrategy(SessionManager.Strategy strategy)

setTimeout

public void setTimeout(long timeout)


Copyright (C) 2005-2007 OOWeb Authors.