edu.vt.middleware.ldap.servlets.session
Class SessionManager

java.lang.Object
  extended by edu.vt.middleware.ldap.servlets.session.SessionManager
Direct Known Subclasses:
DefaultSessionManager

public abstract class SessionManager
extends Object

SessionManager provides a parent class for initializing a HttpSession after a successful authentication and destroying a HttpSession after logout.

Version:
$Revision: 1330 $ $Date: 2010-05-23 18:10:53 -0400 (Sun, 23 May 2010) $
Author:
Middleware Services

Field Summary
protected  boolean invalidateSession
          Whether to invalidate session on logout.
protected  org.apache.commons.logging.Log logger
          Log for this class.
protected  String sessionId
          Identifier to set in the session after valid authentication.
 
Constructor Summary
SessionManager()
           
 
Method Summary
abstract  void login(javax.servlet.http.HttpSession session, String user)
          This performs any actions necessary to login the suppled user.
abstract  void logout(javax.servlet.http.HttpSession session)
          This performs any actions necessary to logout the suppled session.
 void setInvalidateSession(boolean invalidate)
          This sets whether to invalidate a session on logout.
 void setSessionId(String id)
          This sets a session id that can be used in login(javax.servlet.http.HttpSession, java.lang.String) or logout(javax.servlet.http.HttpSession).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Log for this class.


sessionId

protected String sessionId
Identifier to set in the session after valid authentication.


invalidateSession

protected boolean invalidateSession
Whether to invalidate session on logout.

Constructor Detail

SessionManager

public SessionManager()
Method Detail

setSessionId

public void setSessionId(String id)
This sets a session id that can be used in login(javax.servlet.http.HttpSession, java.lang.String) or logout(javax.servlet.http.HttpSession).

Parameters:
id - String

setInvalidateSession

public void setInvalidateSession(boolean invalidate)
This sets whether to invalidate a session on logout. Default value is true.

Parameters:
invalidate - boolean

login

public abstract void login(javax.servlet.http.HttpSession session,
                           String user)
                    throws javax.servlet.ServletException
This performs any actions necessary to login the suppled user.

Parameters:
session - HttpSession
user - String
Throws:
javax.servlet.ServletException - if an error occurs initializing the session

logout

public abstract void logout(javax.servlet.http.HttpSession session)
                     throws javax.servlet.ServletException
This performs any actions necessary to logout the suppled session.

Parameters:
session - HttpSession
Throws:
javax.servlet.ServletException - if an error occurs cleaning up the session


Copyright © 2003-2010 Virginia Tech. All Rights Reserved.