|
© 2004 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.p13n.usermgmt.SessionHelper
Field Summary | |
static String |
LOGIN_UID
Constant to indicate user has logged in with a valid user id |
static String |
PROFILE_WRAPPER
constant to look up the current profile wrapper |
Constructor Summary | |
SessionHelper()
|
Method Summary | |
static String |
getAuthenticatedUserId(HttpServletRequest req)
Get the logged in user's id from the request. |
static boolean |
getFireLoginEvent(HttpSession session)
|
static ProfileWrapper |
getProfile(HttpServletRequest req)
Get the current profile from either the session or the request. |
static ProfileWrapper |
getProfile(HttpServletRequest req,
boolean createNew)
Look for a profile in the request, with the option to create a new Session if there is not a current one in the Request object. |
static ProfileWrapper |
getProfile(HttpSession session)
Get the current profile from the session |
static String |
getUserId(HttpServletRequest req)
Get the (not neccessarily logged in) user's id from the request. |
static void |
postCreateUser(HttpServletRequest request,
String username,
String password,
boolean saveAnonymous,
boolean fireEvent,
boolean login)
Actions to be performed upon user creation (self-registration style). |
static void |
postLogin(HttpServletRequest request)
Option to fire SessionLoginEvent |
static void |
putProfileInRequest(HttpServletRequest req,
ProfileWrapper profile)
Put a profile in the request. |
static void |
putProfileInSession(HttpServletRequest req,
ProfileWrapper profile)
Put a profile in the session. |
static void |
putProfileInSession(HttpSession session,
ProfileWrapper profile)
Put a profile in the session. |
static ProfileWrapper |
removeAndReturnProfile(HttpSession session)
Removes profile wrapper references from the session and returns it. |
static void |
removeProfile(HttpServletRequest req)
Removes profile wrapper references from both the request and the session. |
static void |
removeProfile(HttpSession session)
Removes profile wrapper references from the session. |
static void |
setFireLoginEvent(ServletContext sc,
boolean doFire)
Look in web.xml to see if we're going to fire SessionLoginEvents upon user login. |
static boolean |
userIsRegistered(HttpSession session)
Determine whether user is authenticated by presence of attribute in Session |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String LOGIN_UID
public static final String PROFILE_WRAPPER
Constructor Detail |
public SessionHelper()
Method Detail |
public static String getAuthenticatedUserId(HttpServletRequest req)
This checks for the user principal on the request.
req
- the servlet request.
public static boolean getFireLoginEvent(HttpSession session)
public static ProfileWrapper getProfile(HttpServletRequest req)
public static ProfileWrapper getProfile(HttpServletRequest req, boolean createNew)
public static ProfileWrapper getProfile(HttpSession session)
public static String getUserId(HttpServletRequest req)
This will check the username of a profile in the request/session first (this will handle tracked anonymous users). If there's no profile or it's fully anonymous, this will check the authenticated user id.
req
- the servlet request.
public static void postCreateUser(HttpServletRequest request, String username, String password, boolean saveAnonymous, boolean fireEvent, boolean login) throws LoginException
NOTE that this method always removes the original profile and replaces it with a new one representing the new user, regardless of whether they logged in. That new profile is ProfileType.REGISTERED.
LoginException
public static void postLogin(HttpServletRequest request)
public static void putProfileInRequest(HttpServletRequest req, ProfileWrapper profile)
public static void putProfileInSession(HttpServletRequest req, ProfileWrapper profile)
public static void putProfileInSession(HttpSession session, ProfileWrapper profile)
public static ProfileWrapper removeAndReturnProfile(HttpSession session)
public static void removeProfile(HttpServletRequest req)
public static void removeProfile(HttpSession session)
public static void setFireLoginEvent(ServletContext sc, boolean doFire)
PortalServletFilter
com.bea.p13n.servlets.PortalServletFilter
fireSessionLoginEvent
false
Option to fire SessionLoginEvent , defaults to true if not set
public static boolean userIsRegistered(HttpSession session)
|
© 2004 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |