Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.entitlements.common
Class EntitlementHelper

    java.lang.Object
      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(javax.servlet.http.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(javax.servlet.http.HttpServletRequest httpRequest)` 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(javax.servlet.http.HttpServletRequest anHttpRequest)` Returns the current `EntitlementRequest` associated with an `HttpServletRequest`.
`static P13nContextHandler` | `getP13nContextHandler(javax.servlet.http.HttpServletRequest anHttpRequest)` Returns the current `P13nContextHandler` associated with an `HttpServletRequest`.
`static Request` | `getP13nRequest(javax.servlet.http.HttpServletRequest anHttpRequest)` Returns the P13n `Request` associated with an `HttpServletRequest`
`static void` | `setContextAttribute(com.bea.p13n.entitlements.common.EntitlementRequest entRequest, int scope, String attrName, Object attrValue)`
`static void` | `setContextAttribute(javax.servlet.http.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 final String ENT_REQUEST

See Also
  Constants Summary

### CTXT_HNDLR

    public static final String CTXT_HNDLR

See Also
  Constants Summary

Constructor Detail

### EntitlementHelper

    public EntitlementHelper()

Method Detail

### createEntitlementRequest

    public static com.bea.p13n.entitlements.common.EntitlementRequest createEntitlementRequest(javax.servlet.http.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(javax.servlet.http.HttpServletRequest httpRequest)
                                                       throws com.bea.p13n.entitlements.common.EntitlementsException

  Returns a `P13nContextHandler` for the current user.

  Returns
    a P13nContextHandler for the current user.
  Throws
    `com.bea.p13n.entitlements.common.EntitlementsException`

### 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(javax.servlet.http.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(javax.servlet.http.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(javax.servlet.http.HttpServletRequest anHttpRequest)

  Returns the P13n `Request` associated with an `HttpServletRequest`

  Parameters
    `anHttpRequest` - The Http request
  Returns
    The associated `Request`

### setContextAttribute

    public static void setContextAttribute(javax.servlet.http.HttpServletRequest request,
                                           int scope,
                                           String attrName,
                                           Object attrValue)

### setContextAttribute

    public static void setContextAttribute(com.bea.p13n.entitlements.common.EntitlementRequest entRequest,
                                           int scope,
                                           String attrName,
                                           Object attrValue)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.