com.bea.p13n.entitlements.common
Class EntitlementHelper

java.lang.Object
  extended by com.bea.p13n.entitlements.common.EntitlementHelper

public class EntitlementHelper
extends Object

Provides helper methods for constructing entitlements.


Field Summary
static String CTXT_HNDLR
           
static String ENT_REQUEST
           
 
Constructor Summary
EntitlementHelper()
           
 
Method Summary
static com.bea.p13n.entitlements.common.EntitlementRequest createEntitlementRequest(HttpServletRequest anHttpRequest)
          Creates an EntitlementRequest and caches it on the HttpRequest, or returns the currently cached EntitlementRequest.
static P13nContextHandler createP13nContextHandler(com.bea.p13n.entitlements.common.EntitlementRequest entRequest)
          Returns a P13nContextHandler for the current user.
static P13nContextHandler createP13nContextHandler(String aWebAppName)
          Returns a P13nContextHandler for the current user, based on a ProfileWrapper, only.
static com.bea.p13n.entitlements.common.EntitlementRequest getEntitlementRequest(HttpServletRequest anHttpRequest)
          Returns the current EntitlementRequest associated with an HttpServletRequest.
static P13nContextHandler getP13nContextHandler(HttpServletRequest anHttpRequest)
          Returns the current P13nContextHandler associated with an HttpServletRequest.
static Request getP13nRequest(HttpServletRequest anHttpRequest)
          Returns the P13n Request associated with an HttpServletRequest
static void setContextAttribute(HttpServletRequest request, int scope, String attrName, Object attrValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENT_REQUEST

public static String ENT_REQUEST

CTXT_HNDLR

public static String CTXT_HNDLR
Constructor Detail

EntitlementHelper

public EntitlementHelper()
Method Detail

createEntitlementRequest

public static com.bea.p13n.entitlements.common.EntitlementRequest createEntitlementRequest(HttpServletRequest anHttpRequest)
                                                                                    throws com.bea.p13n.entitlements.common.EntitlementsException
Creates an EntitlementRequest and caches it on the HttpRequest, or returns the currently cached EntitlementRequest. The EntitlementRequest contains the set of objects that expression-based role evaluation uses as input.

Parameters
anHttpRequest - The current Http request
Returns
a new EntitlementRequest instance.
Throws
EntitlementsException - if an error occurrs during creation of an EntitlementRequest.

createP13nContextHandler

public static P13nContextHandler createP13nContextHandler(com.bea.p13n.entitlements.common.EntitlementRequest entRequest)
Returns a P13nContextHandler for the current user.

Returns
a P13nContextHandler for the current user.

createP13nContextHandler

public static P13nContextHandler createP13nContextHandler(String aWebAppName)
Returns a P13nContextHandler for the current user, based on a ProfileWrapper, only. This method allows creation of the context handler without an HttpRequest. However, the evaluation of expression-based roles based on such a context can only include profile-based attributes. That is, no time/date, request, or session-based attributes can exist in the role expression. If the current user is not authenticated, an anonymous profile will be used.

Parameters
aWebAppName - The webapp name of the caller. If no webapp-scoped roles are in-scope for the calling application, this field may be null.
Returns
a P13nContextHandler for the current user.

getP13nContextHandler

public static P13nContextHandler getP13nContextHandler(HttpServletRequest anHttpRequest)
                                                throws com.bea.p13n.entitlements.common.EntitlementsException
Returns the current P13nContextHandler associated with an HttpServletRequest.

Parameters
anHttpRequest - The Http request
Returns
An existing P13nContextHandler, else creates a new one..
Throws
com.bea.p13n.entitlements.common.EntitlementsException

getEntitlementRequest

public static com.bea.p13n.entitlements.common.EntitlementRequest getEntitlementRequest(HttpServletRequest anHttpRequest)
Returns the current EntitlementRequest associated with an HttpServletRequest.

Parameters
anHttpRequest - The Http request
Returns
An existing EntitlementRequest, else creates a new one.

getP13nRequest

public static Request getP13nRequest(HttpServletRequest anHttpRequest)
Returns the P13n Request associated with an HttpServletRequest

Parameters
anHttpRequest - The Http request
Returns
The associated Request

setContextAttribute

public static void setContextAttribute(HttpServletRequest request,
                                       int scope,
                                       String attrName,
                                       Object attrValue)


Copyright © 2006 BEA Systems, Inc. All Rights Reserved