public final class CapabilityPermission
extends java.security.BasicPermission
provide action allows a bundle to provide a capability
matching the specified filter.require action allows a bundle to require a capability
matching the specified filter.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROVIDE
The action string
provide. |
static java.lang.String |
REQUIRE
The action string
require. |
| Constructor and Description |
|---|
CapabilityPermission(java.lang.String namespace,
java.util.Map<java.lang.String,?> attributes,
Bundle providingBundle,
java.lang.String actions)
Creates a new requested
CapabilityPermission object to be used by
code that must perform checkPermission for the require
action. |
CapabilityPermission(java.lang.String name,
java.lang.String actions)
Create a new CapabilityPermission.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Determines the equality of two CapabilityPermission objects.
|
java.lang.String |
getActions()
Returns the canonical string representation of the actions.
|
int |
hashCode()
Returns the hash code value for this object.
|
boolean |
implies(java.security.Permission p)
Determines if a
CapabilityPermission object "implies" the
specified permission. |
java.security.PermissionCollection |
newPermissionCollection()
Returns a new
PermissionCollection object for storing
CapabilityPermission objects. |
public static final java.lang.String REQUIRE
require.public static final java.lang.String PROVIDE
provide.public CapabilityPermission(java.lang.String name,
java.lang.String actions)
The name is specified as a dot-separated string. Wildcards may be used.
name ::= <namespace> | <namespace ending in ".*"> | *Examples:
com.acme.capability.* org.foo.capability *For the
require action, the name can also be a filter expression.
The filter gives access to the capability attributes as well as the
following attributes:
There are two possible actions: require and provide. The
require permission allows the owner of this permission to require
a capability matching the attributes. The provide permission
allows the bundle to provide a capability in the specified capability
namespace.
name - The capability namespace or a filter over the attributes.actions - require,provide (canonical order)java.lang.IllegalArgumentException - If the specified name is a filter
expression and either the specified action is not require
or the filter has an invalid syntax.public CapabilityPermission(java.lang.String namespace,
java.util.Map<java.lang.String,?> attributes,
Bundle providingBundle,
java.lang.String actions)
CapabilityPermission object to be used by
code that must perform checkPermission for the require
action. CapabilityPermission objects created with this
constructor cannot be added to a CapabilityPermission permission
collection.namespace - The requested capability namespace.attributes - The requested capability attributes.providingBundle - The bundle providing the requested capability.actions - The action require.java.lang.IllegalArgumentException - If the specified action is not
require or attributes or providingBundle are null
.public boolean implies(java.security.Permission p)
CapabilityPermission object "implies" the
specified permission.implies in class java.security.BasicPermissionp - The target permission to check.true if the specified permission is implied by this
object; false otherwise.public java.lang.String getActions()
require,
provide.getActions in class java.security.BasicPermissionpublic java.security.PermissionCollection newPermissionCollection()
PermissionCollection object for storing
CapabilityPermission objects.newPermissionCollection in class java.security.BasicPermissionPermissionCollection object suitable for storing
CapabilityPermission objects.public boolean equals(java.lang.Object obj)
CapabilityPermission.equals in class java.security.BasicPermissionobj - The object to test for equality.CapabilityPermission, and has the same
name and actions as this CapabilityPermission object;
false otherwise.public int hashCode()
hashCode in class java.security.BasicPermission