org.mortbay.jetty.servlet

Interface SessionManager

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

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 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.
boolean
getHttpOnly()
HttpSession
getHttpSession(String id)
int
getMaxInactiveInterval()
boolean
getSecureCookies()
Cookie
getSessionCookie(HttpSession session, boolean requestIsSecure)
Get a Cookie for a session.
void
initialize(ServletHandler handler)
HttpSession
newHttpSession(HttpServletRequest request)
void
removeEventListener(EventListener listener)
void
setMaxInactiveInterval(int seconds)

Methods inherited from interface org.mortbay.util.LifeCycle

isStarted, start, stop

Field Details

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

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

__SessionUrlPrefix

public static final String __SessionUrlPrefix

Method Details

addEventListener

public void addEventListener(EventListener listener)
            throws IllegalArgumentException
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

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.