Skip navigation links

Oracle Fusion Middleware Management Java API Reference for Oracle Entitlements Server
11g Release 1 (11.1.1)

E22649-02 ESAPI


oracle.security.jps
Class ResourcePermission

java.lang.Object
  extended by java.security.Permission
      extended by java.security.BasicPermission
          extended by oracle.security.jps.JpsPermission
              extended by oracle.security.jps.ResourcePermission

All Implemented Interfaces:
java.io.Serializable, java.security.Guard

public class ResourcePermission
extends JpsPermission

This permission represents access rights to resources of a particular type.

A ResourcePermission contains the following items of information:

If you have a ResourcePermission, it allows operations only if all four of the items match. see ResourcePermission.implies(Permission)

The target name of this ResourcePermission will encode the information of resourceType, and resourceName in a single string. The name of the permission is returned by Permission.getName(). The format of the string is a comma-delimited list of key-value pair:

resourceType=aType,resourceName=aName

The supported keys are:

In a target name, spaces are allowed before and after each value. However spaces are not allowed after the key values. It must be followed immediately by '='. Permission.getName() will return the target name in the format described above.

In a comma-separated list of actions, spaces are allowed before and after each action.

See Also:
Serialized Form

Constructor Summary
ResourcePermission(java.lang.String name)
          Creates a new instance of this class with the specified target name.
ResourcePermission(java.lang.String name, java.lang.String actions)
          Creates a new instance of this permission with the specified target name and actions.
ResourcePermission(java.lang.String resourceType, java.lang.String resourceName, java.util.Set<java.lang.String> actionsSet)
          Creates a new instance of this class with the specified resource type, name and actions.
ResourcePermission(java.lang.String resourceType, java.lang.String resourceName, java.lang.String actions)
          Creates a new instance of this class with the specified resource type, name and actions.

 

Method Summary
 boolean equals(java.lang.Object obj)
          Checks two ResourcePermission objects for equality.
 java.lang.String getActions()
          Returns the "canonical string representation" of the actions.
 java.lang.String getResourceName()
          Returns the resource name.
 java.lang.String getType()
          Returns the resource type.
 int hashCode()
          
 boolean implies(java.security.Permission perm)
          Checks if this object "implies" the specified permission.
 java.security.PermissionCollection newPermissionCollection()
          Returns a new PermissionCollection object for storing ResourcePermission objects.

 

Methods inherited from class java.security.Permission
checkGuard, getName, toString

 

Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

 

Constructor Detail

ResourcePermission

public ResourcePermission(java.lang.String name)

Creates a new instance of this class with the specified target name.

This constructor is equivalent to ResourcePermission(name,"").

Parameters:
name - the target name

ResourcePermission

public ResourcePermission(java.lang.String name,
                          java.lang.String actions)

Creates a new instance of this permission with the specified target name and actions.

The target name is of the form "resourceType=aType,resourceName=aName" where each part is required. It must not be empty or null.

The actions parameter contains a comma-separated list of the desired actions granted on the target name. It must not be null.

Parameters:
name - the target name
actions - the action list
Throws:
java.lang.NullPointerException - if name is null.
java.lang.IllegalArgumentException - if name is empty or has syntax error

ResourcePermission

public ResourcePermission(java.lang.String resourceType,
                          java.lang.String resourceName,
                          java.lang.String actions)

Creates a new instance of this class with the specified resource type, name and actions.

This constructor is equivalent to ResourcePermission.ResourcePermission(String,String). The target name is constructed with the input resourceType, and resourceName, following the name encoding scheme. resourceType is considered case-insensitive and resourceName case-sensitive.

Parameters:
resourceType - the resource type
resourceName - the resource name
actions - a comma-separated list of the actions that operate against the resource
Throws:
java.lang.IllegalArgumentException - if the resourceName contains the resourceType encoded in the name.

For example, resourceName value of 'resourceType=myType,resourceName=myResource' is an invalid name.


ResourcePermission

public ResourcePermission(java.lang.String resourceType,
                          java.lang.String resourceName,
                          java.util.Set<java.lang.String> actionsSet)

Creates a new instance of this class with the specified resource type, name and actions.

This constructor is similar to ResourcePermission.ResourcePermission(String,String,String), with actions specified as set.

Parameters:
resourceType - the resource type
resourceName - the resource name.
actionsSet - a set of the actions that operate against the resource
Throws:
java.lang.IllegalArgumentException - if the resourceName contains the resourceType encoded in the name.

For example, resourceName value of 'resourceType=myType,resourceName=myResource' is an invalid name.

Method Detail

implies

public boolean implies(java.security.Permission perm)

Checks if this object "implies" the specified permission.

More specifically, this method returns true if:

Overrides:
implies in class java.security.BasicPermission
Parameters:
perm - the permission to check against
Returns:
true if the specified permission is implied by this object, false otherwise

equals

public boolean equals(java.lang.Object obj)

Checks two ResourcePermission objects for equality.

More specifically, this method returns true if:

Overrides:
equals in class java.security.BasicPermission
Parameters:
obj - the object tested for equality with this object
Returns:
true if obj is considered equal, false otherwise

hashCode

public int hashCode()
Overrides:
hashCode in class java.security.BasicPermission

getActions

public java.lang.String getActions()
Returns the "canonical string representation" of the actions. That is, this method always returns present actions in alphabetical order.
Overrides:
getActions in class java.security.BasicPermission
Returns:
the canonical string representation of the actions, empty string "" is returned if no actions specified

getType

public java.lang.String getType()
Returns the resource type.
Returns:
the resource type

getResourceName

public java.lang.String getResourceName()
Returns the resource name.
Returns:
the resource name

newPermissionCollection

public java.security.PermissionCollection newPermissionCollection()
Returns a new PermissionCollection object for storing ResourcePermission objects.
Overrides:
newPermissionCollection in class java.security.BasicPermission
Returns:
a new PermissionCollection object suitable for storing ResourcePermissions

Skip navigation links

Oracle Fusion Middleware Management Java API Reference for Oracle Entitlements Server
11g Release 1 (11.1.1)

E22649-02 ESAPI


Copyright © 2011, Oracle. All rights reserved.