# com.bea.p13n.entitlements.policy
RolePolicyItem Class

public class RolePolicyItem
extends `PolicyItem`

This class encapsulates the information comprising a single Role Policy. It is used to collect and hold role policy attributes during the process of building and managing role policies.

The RolePolicyManager is used for persistence related operations upon RolePolicyItems.

Hierarchy
  `Object`
  `PolicyItem`
  `RolePolicyItem`

All Implemented Interfaces
  `Cloneable`, `Serializable`

## Constructor Summary

RolePolicyItem() This no-args constructor allows a RolePolicyItem to be created and initialized piecemeal by an application.
RolePolicyItem(`String` aEntAppName, `String` aWebAppName, `String` aRoleName, int aResourceScope, `List` aUserList, `List` aGroupList, `String` aRoleSegmentDoc, `P13nContextHandler` aContextHandler) Initialize a new role policy item for a pooled resource.

## Method Summary

`public `Object`` | `clone`()
`public `String`` | `getPolicyName`() Returns the role policy namespace of this role policy.
`public `String`` | `getPolicyNamespace`() Returns the role policy namespace of this role policy.
`public int` | `getResourceScope`() Returns the resource scope used within this role policy.
`public `String`` | `getRoleSegmentDoc`() Returns the role segment, rules-node based document, if this role policy uses a custom predicate.
`public boolean` | `getRoleSegmentLogicalAnd`() Returns the value of the custom predicate binding;
`public `String`` | `getRoleSegmentName`() Returns the role segment name used within a role policy.
`public void` | `setPolicyName`(`String` aPolicyName) Sets the role policy name of this role policy.
`public void` | `setPolicyNamespace`(`String` aPolicyNamespace) Sets the role policy namespace for this role policy.
`public void` | `setResourceScope`(int aResourceScope) Sets the resource scope used within this role policy.
`public void` | `setRoleSegmentDoc`(`String` aRoleSegmentDoc) Sets the role segment, rules-node based document, if this role policy uses a custom predicate.
`public void` | `setRoleSegmentLogicalAnd`(boolean isLogicalAnd) Sets the value of the custom predicate binding;
`public void` | `setRoleSegmentName`(`String` aRoleSegmentName) Update the value of the role segment name in this object.

Methods from `com.bea.p13n.entitlements.policy.`PolicyItem``
``getContextHandler`, `getEntAppName`, `getGroupList`, `getPolicyUser`, `getResourceId`, `getUserList`, `getWebAppName`, `setContextHandler`, `setEntAppName`, `setGroupList`, `setPolicyUser`, `setResourceId`, `setUserList`, `setWebAppName``

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Detail

### RolePolicyItem

    public RolePolicyItem()

  This no-args constructor allows a RolePolicyItem to be created and initialized piecemeal by an application.

### RolePolicyItem

    public RolePolicyItem(String aEntAppName,
                          String aWebAppName,
                          String aRoleName,
                          int aResourceScope,
                          List aUserList,
                          List aGroupList,
                          String aRoleSegmentDoc,
                          P13nContextHandler aContextHandler)

  Initialize a new role policy item for a pooled resource. Note that none of the parameters are required to construct this class, however certain operations will not succeed unless the required parameters for that operation are valid. Also, for example, if this object is used to persist a policy without aUserList being initialized, it is assumed there are no user predicates required in the policy.

## Method Detail

### clone() Method

    public Object clone()
         throws CloneNotSupportedException

Overrides
  `PolicyItem.clone()`

#### Returns

clone of RolePolicyItem

#### Exceptions

``CloneNotSupportedException``

### getPolicyName() Method

    public String getPolicyName()

Returns the role policy namespace of this role policy.

#### Returns

policy name of null, if not set

### getPolicyNamespace() Method

    public String getPolicyNamespace()

Returns the role policy namespace of this role policy.

#### Returns

policy name of null, if not set

### getResourceScope() Method

    public int getResourceScope()

Returns the resource scope used within this role policy.

#### Returns

resource scope constant, as defined in EntitlementConstants

### getRoleSegmentDoc() Method

    public String getRoleSegmentDoc()

Returns the role segment, rules-node based document, if this role policy uses a custom predicate.

#### Returns

Xml rules-node document, if it exists.

### getRoleSegmentLogicalAnd() Method

    public boolean getRoleSegmentLogicalAnd()

Returns the value of the custom predicate binding;

#### Returns

True, if role segment custom predicate is logically AND'd to entitlement, otherwise false.

### getRoleSegmentName() Method

    public String getRoleSegmentName()

Returns the role segment name used within a role policy.

#### Returns

SUCCESS or other status code

### setPolicyName(String) Method

    public void setPolicyName(String aPolicyName)

Sets the role policy name of this role policy.

### setPolicyNamespace(String) Method

    public void setPolicyNamespace(String aPolicyNamespace)

Sets the role policy namespace for this role policy. The default value is EntitlementConstants.P13N_ROLE_POLICY_POOL.

### setResourceScope(int) Method

    public void setResourceScope(int aResourceScope)

Sets the resource scope used within this role policy.

### setRoleSegmentDoc(String) Method

    public void setRoleSegmentDoc(String aRoleSegmentDoc)

Sets the role segment, rules-node based document, if this role policy uses a custom predicate.

### setRoleSegmentLogicalAnd(boolean) Method

    public void setRoleSegmentLogicalAnd(boolean isLogicalAnd)

Sets the value of the custom predicate binding;

### setRoleSegmentName(String) Method

    public void setRoleSegmentName(String aRoleSegmentName)

Update the value of the role segment name in this object. Subsequently, the persisted role policy may be updated using the RolePolicyManager, allowing the ExpressionPredicate in the entitlement expression to be rewritten.

#### Parameters

aRoleSegmentName
  The name of the role segment that was created with the RolePolicyManager