Skip navigation links

Oracle Fusion Middleware Oracle Platform Security Services API Reference
11g Release 1 (11.1.1)

E14650-01


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 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 key or value.

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.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.
 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,
                          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, action is null, or name has syntax error

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 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(name,actions). The target name is constructed with the input resourceType, and resourceName, following the name encoding scheme.

Parameters:
resourceType - the resource type
resourceName - the resource name
actions - the actions that operate against the resource

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

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 Oracle Platform Security Services API Reference
11g Release 1 (11.1.1)

E14650-01


Copyright © 2009, Oracle. All rights reserved.