org.mortbay.jetty.servlet

Interface SessionManager

public interface SessionManager extends LifeCycle, Serializable

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

Version: $Id: SessionManager.java,v 1.18 2005/03/15 10:03:58 gregwilkins Exp $

Author: Greg Wilkins

Nested Class Summary
static interfaceSessionManager.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__SessionUrlPrefix
static String__SessionURL
Session URL parameter name.
Method Summary
voidaddEventListener(EventListener listener)
Add an event listener.
booleangetHttpOnly()
HttpSessiongetHttpSession(String id)
intgetMaxInactiveInterval()
booleangetSecureCookies()
CookiegetSessionCookie(HttpSession session, boolean requestIsSecure)
Get a Cookie for a session.
voidinitialize(ServletHandler handler)
HttpSessionnewHttpSession(HttpServletRequest request)
voidremoveEventListener(EventListener listener)
voidsetMaxInactiveInterval(int seconds)

Field Detail

__MaxAge

public 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.

__SessionCookie

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

__SessionDomain

public 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.

__SessionPath

public 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.

__SessionUrlPrefix

public static final String __SessionUrlPrefix

__SessionURL

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

Method Detail

addEventListener

public 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

Throws: IllegalArgumentException If an unsupported listener is passed.

getHttpOnly

public boolean getHttpOnly()

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

getHttpSession

public HttpSession getHttpSession(String id)

getMaxInactiveInterval

public int getMaxInactiveInterval()

getSecureCookies

public boolean getSecureCookies()

Returns: true if session cookies should be secure

getSessionCookie

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

Parameters: session

Returns:

initialize

public void initialize(ServletHandler handler)

newHttpSession

public HttpSession newHttpSession(HttpServletRequest request)

removeEventListener

public void removeEventListener(EventListener listener)

setMaxInactiveInterval

public void setMaxInactiveInterval(int seconds)
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.