© 2002 BEA Systems, Inc.


com.bea.p13n.usermgmt
Class SessionHelper

java.lang.Object
  |
  +--com.bea.p13n.usermgmt.SessionHelper

public class SessionHelper
extends java.lang.Object


Field Summary
static java.lang.String PROFILE_WRAPPER
          constant to look up the current profile wrapper
 
Constructor Summary
SessionHelper()
           
 
Method Summary
static ProfileWrapper getProfile(javax.servlet.http.HttpServletRequest req)
          Get the current profile from either the session or the request.
static ProfileWrapper getProfile(javax.servlet.http.HttpSession session)
          Get the current profile from the session
static java.lang.String getUserId(javax.servlet.http.HttpServletRequest req)
          Get the logged in user's id from the request.
static void putProfileInRequest(javax.servlet.http.HttpServletRequest req, ProfileWrapper profile)
          Put a profile in the request.
static void putProfileInSession(javax.servlet.http.HttpServletRequest req, ProfileWrapper profile)
          Put a profile in the session.
static void putProfileInSession(javax.servlet.http.HttpSession session, ProfileWrapper profile)
          Put a profile in the session.
static void removeProfile(javax.servlet.http.HttpServletRequest req)
          Removes profile wrapper references from both the request and the session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROFILE_WRAPPER

public static final java.lang.String PROFILE_WRAPPER
constant to look up the current profile wrapper
Constructor Detail

SessionHelper

public SessionHelper()
Method Detail

getProfile

public static ProfileWrapper getProfile(javax.servlet.http.HttpServletRequest req)
Get the current profile from either the session or the request. Looks in the session first, then the request.

getProfile

public static ProfileWrapper getProfile(javax.servlet.http.HttpSession session)
Get the current profile from the session

removeProfile

public static void removeProfile(javax.servlet.http.HttpServletRequest req)
Removes profile wrapper references from both the request and the session.

putProfileInSession

public static void putProfileInSession(javax.servlet.http.HttpServletRequest req,
                                       ProfileWrapper profile)
Put a profile in the session.

putProfileInSession

public static void putProfileInSession(javax.servlet.http.HttpSession session,
                                       ProfileWrapper profile)
Put a profile in the session.

putProfileInRequest

public static void putProfileInRequest(javax.servlet.http.HttpServletRequest req,
                                       ProfileWrapper profile)
Put a profile in the request.

getUserId

public static java.lang.String getUserId(javax.servlet.http.HttpServletRequest req)
Get the logged in user's id from the request.

This checks for the user principal on the request.

Parameters:
req - the servlet request.
Returns:
the user id, null if not authenticated.

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved