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.| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
SessionManager() |
| Modifier and Type | Method and Description |
|---|---|
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). |
protected final org.apache.commons.logging.Log logger
protected String sessionId
protected boolean invalidateSession
public void setSessionId(String id)
login(javax.servlet.http.HttpSession, java.lang.String) or logout(javax.servlet.http.HttpSession).id - Stringpublic void setInvalidateSession(boolean invalidate)
invalidate - booleanpublic abstract void login(javax.servlet.http.HttpSession session,
String user)
throws javax.servlet.ServletException
session - HttpSessionuser - Stringjavax.servlet.ServletException - if an error occurs initializing the sessionpublic abstract void logout(javax.servlet.http.HttpSession session)
throws javax.servlet.ServletException
session - HttpSessionjavax.servlet.ServletException - if an error occurs cleaning up the sessionCopyright © 2014. All rights reserved.