# com.bea.p13n.entitlements.resource
P13nResource Class

public abstract class P13nResource
extends `ResourceBase`

Hierarchy
  `Object`
  `ResourceBase`
  `P13nResource`

All Implemented Interfaces
  `Resource`, `SelfDescribingResource`, `Serializable`

Direct Known Subclasses
  `EnterpriseRoleResource`, `GlobalRoleResource`, `HierarchyRoleResource`, `LeafRoleResource`, `P13nLibraryResource`, `P13nSecurityResource`, `PortalAdminEntitlementResource`, `WebappRoleResource`

## Field Summary

`public static final `String`` | `empty` Empty string

Fields from weblogic.security.service`.`ResourceBase``
`id, length, NO_PARENT, parent, resStr, SCOPE_RESOURCE_ACTION, values`

Fields from interface weblogic.security.spi`.`SelfDescribingResource``
`LIST_FIELD_TYPE, NORMAL_FIELD_TYPE, PATH_FIELD_TYPE, UNDEFINED_FIELD_TYPE`

## Constructor Summary

P13nResource() No Args constructor
P13nResource(`SecurityResource` securityResource, `String` libraryResourceId, `String` initialCapability) Construct fields for security and library resources.

## Method Summary

`public `String`` | `getCapabilityName`()
`public `String`` | `getEntAppName`() Gets the application name associated with this resource
`public `String`[]` | `getKeys`() Gets keys for this resource.
`public `String`` | `getResourceName`()
`public abstract int` | `getResourceScope`() Implemented by P13nResource subclasses
`public `SecurityResource`` | `getSecurityResource`() Returns the resource object used to look for security policies.
`public `String`` | `getType`() Gets the type of this resource (`ApplicationResource`).
`public `String`` | `getWebAppName`()
`public `Resource`` | `makeParent`() Gets a `Resource` object that represents the parent of the current resource.
`public void` | `setInitialValues`(`String` theInitialCapability, `String` theLibRsrcId, `String` theScope)
`public void` | `setSecurityResource`(`SecurityResource` theSecurityResource) Sets the resource object used to look for security policies.
`public `String`` | `toString`()

Methods from `weblogic.security.service.`ResourceBase``
`appendArrayValue, appendValue, equals, getFieldType, getID, getParentResource, getRepeatingFieldIndex, getRepeatingFieldTerminatingIndex, getValues, hashCode, init, init, reset, writeResourceString`

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

Methods from interface `weblogic.security.spi.`Resource``
`equals, getID, getKeys, getParentResource, getType, getValues, hashCode, toString`

Methods from interface `weblogic.security.spi.`SelfDescribingResource``
`getFieldType, getRepeatingFieldIndex, getRepeatingFieldTerminatingIndex`

## Field Detail

### empty

    public static final String empty

  Empty string

## Constructor Detail

### P13nResource

    public P13nResource()

  No Args constructor

### P13nResource

    public P13nResource(SecurityResource securityResource,
                        String libraryResourceId,
                        String initialCapability)

  Construct fields for security and library resources.

## Method Detail

### getCapabilityName() Method

    public String getCapabilityName()

### getEntAppName() Method

    public String getEntAppName()

Gets the application name associated with this resource

#### Returns

a String indicating the name of the application in which the resource is deployed

### getKeys() Method

    public String[] getKeys()

Gets keys for this resource.

Overrides
  `ResourceBase.getKeys()`

#### Returns

an array of Strings containing this resource's keys.

### getResourceName() Method

    public String getResourceName()

### getResourceScope() Method

    public abstract int getResourceScope()

Implemented by P13nResource subclasses

### getSecurityResource() Method

    public SecurityResource getSecurityResource()

Returns the resource object used to look for security policies. The scoping/search for security policies always begins at the resource leaf node.

### getType() Method

    public String getType()

Gets the type of this resource (`ApplicationResource`).

#### Returns

the String type of this resource.

### getWebAppName() Method

    public String getWebAppName()

### makeParent() Method

    public Resource makeParent()

Gets a `Resource` object that represents the parent of the current resource. If the resource does not have a parent, the value of `null` must be returned.

This method is sensitive to the role scoping of this class instance. The following process is used to determine what should be returned as the parent Resource:

GlobalRoleResource => null parent

EnterpriseRoleResource => GlobalRoleResource parent

WebappRoleResource => EnterpriseRoleResource parent

HierarchyRoleResource => HierarchyRoleResource parent until appResourceId has been traversed, then => WebappRoleResource parent

LeafRoleResource => GlobalRoleResource parent

Overrides
  `ResourceBase.makeParent()`

#### Returns

the `Resource` object of the parent resource.

### setInitialValues(String, String, String) Method

    public void setInitialValues(String theInitialCapability,
                                 String theLibRsrcId,
                                 String theScope)

### setSecurityResource(SecurityResource) Method

    public void setSecurityResource(SecurityResource theSecurityResource)

Sets the resource object used to look for security policies. The scoping/search for security policies always begins at the resource leaf node.

### toString() Method

    public String toString()

Overrides
  `ResourceBase.toString()`