org.mortbay.jetty
Interface SessionManager

All Superinterfaces:
LifeCycle, Serializable
All Known Implementing Classes:
AbstractSessionManager, HashSessionManager

public interface SessionManager
extends LifeCycle, Serializable

Session Manager. The API required to manage sessions for a servlet context.

Author:
Greg Wilkins

Nested Class Summary
static interface SessionManager.MetaManager
          MetaManager.
static interface SessionManager.Session
           
 
Field Summary
static String __MaxAge
          Session Max Age.
static String __SessionCookie
          Session cookie name.
static String __SessionDomain
          Session Domain.
static String __SessionPath
          Session Path.
static String __SessionURL
          Session URL parameter name.
static String __SessionUrlPrefix
           
 
Method Summary
 void addEventListener(EventListener listener)
          Add an event listener.
 void clearEventListeners()
           
 boolean getHttpOnly()
           
 HttpSession getHttpSession(String id)
           
 int getMaxInactiveInterval()
           
 SessionManager.MetaManager getMetaManager()
           
 boolean getSecureCookies()
           
 Cookie getSessionCookie(HttpSession session, String contextPath, boolean requestIsSecure)
          Get a Cookie for a session.
 HttpSession newHttpSession(HttpServletRequest request)
           
 void removeEventListener(EventListener listener)
           
 void setMaxInactiveInterval(int seconds)
           
 void setMetaManager(SessionManager.MetaManager meta)
           
 
Methods inherited from interface org.mortbay.component.LifeCycle
isFailed, isRunning, isStarted, isStarting, isStopping, start, stop
 

Field Detail

__SessionCookie

static final String __SessionCookie
Session cookie name. Defaults to JSESSIONID, but can be set with the org.mortbay.jetty.servlet.SessionCookie system property.


__SessionURL

static final String __SessionURL
Session URL parameter name. Defaults to jsessionid, but can be set with the org.mortbay.jetty.servlet.SessionURL system property.


__SessionUrlPrefix

static final String __SessionUrlPrefix

__SessionDomain

static final String __SessionDomain
Session Domain. If this property is set as a ServletContext InitParam, then it is used as the domain for session cookies. If it is not set, then no domain is specified for the session cookie.

See Also:
Constant Field Values

__SessionPath

static final String __SessionPath
Session Path. If this property is set as a ServletContext InitParam, then it is used as the path for the session cookie. If it is not set, then the context path is used as the path for the cookie.

See Also:
Constant Field Values

__MaxAge

static final String __MaxAge
Session Max Age. If this property is set as a ServletContext InitParam, then it is used as the max age for the session cookie. If it is not set, then a max age of -1 is used.

See Also:
Constant Field Values
Method Detail

getHttpSession

HttpSession getHttpSession(String id)

newHttpSession

HttpSession newHttpSession(HttpServletRequest request)

getSecureCookies

boolean getSecureCookies()
Returns:
true if session cookies should be secure

getHttpOnly

boolean getHttpOnly()
Returns:
true if session cookies should be httponly (microsoft extension)

getMaxInactiveInterval

int getMaxInactiveInterval()

setMaxInactiveInterval

void setMaxInactiveInterval(int seconds)

addEventListener

void addEventListener(EventListener listener)
Add an event listener.

Parameters:
listener - An Event Listener. Individual SessionManagers implemetations may accept arbitrary listener types, but they are expected to at least handle HttpSessionActivationListener, HttpSessionAttributeListener, HttpSessionBindingListener, HttpSessionListener

removeEventListener

void removeEventListener(EventListener listener)

clearEventListeners

void clearEventListeners()

getSessionCookie

Cookie getSessionCookie(HttpSession session,
                        String contextPath,
                        boolean requestIsSecure)
Get a Cookie for a session.

Parameters:
session -
contextPath - TODO
Returns:

getMetaManager

SessionManager.MetaManager getMetaManager()
Returns:
the cross context session meta manager.

setMetaManager

void setMetaManager(SessionManager.MetaManager meta)
Parameters:
meta - the cross context session meta manager.