org.mortbay.jetty.servlet
Interface SessionManager

All Superinterfaces:
LifeCycle, java.io.Serializable
All Known Implementing Classes:
AbstractSessionManager, HashSessionManager

public interface SessionManager
extends LifeCycle, java.io.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 java.lang.String __MaxAge
          Session Max Age.
static java.lang.String __SessionCookie
          Session cookie name.
static java.lang.String __SessionDomain
          Session Domain.
static java.lang.String __SessionPath
          Session Path.
static java.lang.String __SessionURL
          Session URL parameter name.
static java.lang.String __SessionUrlPrefix
           
 
Method Summary
 void addEventListener(java.util.EventListener listener)
          Add an event listener.
 boolean getHttpOnly()
           
 HttpSession getHttpSession(java.lang.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(java.util.EventListener listener)
           
 void setMaxInactiveInterval(int seconds)
           
 
Methods inherited from interface org.mortbay.util.LifeCycle
isStarted, start, stop
 

Field Detail

__SessionCookie

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


__SessionURL

static final java.lang.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 java.lang.String __SessionUrlPrefix

__SessionDomain

static final java.lang.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 java.lang.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 java.lang.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

initialize

void initialize(ServletHandler handler)

getHttpSession

HttpSession getHttpSession(java.lang.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(java.util.EventListener listener)
                      throws java.lang.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
Throws:
java.lang.IllegalArgumentException - If an unsupported listener is passed.

removeEventListener

void removeEventListener(java.util.EventListener listener)

getSessionCookie

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

Parameters:
session -
Returns:


Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.