public final class SubsystemPermission extends BasicPermission
Action Methods context Subsystem.getBundleContext execute Subsystem.start Subsystem.stop lifecycle Subsystem.install Subsystem.uninstall metadata Subsystem.getSubsystemHeaders Subsystem.getLocation
The name of this permission is a filter expression. The filter gives access to the following attributes:
Modifier and Type | Field and Description |
---|---|
static String |
CONTEXT
The action string
context . |
static String |
EXECUTE
The action string
execute . |
static String |
LIFECYCLE
The action string
lifecycle . |
static String |
METADATA
The action string
metadata . |
Constructor and Description |
---|
SubsystemPermission(String filter,
String actions)
Create a new SubsystemPermission.
|
SubsystemPermission(Subsystem subsystem,
String actions)
Creates a new requested
SubsystemPermission object to be used by
the code that must perform checkPermission . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Determines the equality of two
SubsystemPermission objects. |
String |
getActions()
Returns the canonical string representation of the
SubsystemPermission actions. |
int |
hashCode()
Returns the hash code value for this object.
|
boolean |
implies(Permission p)
Determines if the specified permission is implied by this object.
|
PermissionCollection |
newPermissionCollection()
Returns a new
PermissionCollection object suitable for storing
SubsystemPermission s. |
checkGuard, getName, toString
public static final String EXECUTE
execute
.public static final String LIFECYCLE
lifecycle
.public static final String METADATA
metadata
.public static final String CONTEXT
context
.public SubsystemPermission(String filter, String actions)
Examples:
(name=com.acme.*)(location=http://www.acme.com/subsystems/*)) (id>=1)
filter
- A filter expression that can use, location, id, and name
keys. Filter attribute names are processed in a case sensitive
manner. A special value of "*"
can be used to match all
subsystems.actions
- execute
, lifecycle
, metadata
, or
context
.IllegalArgumentException
- If the filter has an invalid syntax.public SubsystemPermission(Subsystem subsystem, String actions)
SubsystemPermission
object to be used by
the code that must perform checkPermission
.
SubsystemPermission
objects created with this constructor cannot
be added to an SubsystemPermission
permission collection.subsystem
- A subsystem.actions
- execute
, lifecycle
, metadata
, or
context
.public boolean implies(Permission p)
This method returns true
if the specified permission is a
SubsystemPermission AND
Special case: if the specified permission was constructed with "*"
filter, then this method returns true
if this object's filter is
"*" and this object's actions include all of the specified permission's
actions
implies
in class BasicPermission
p
- The requested permission.true
if the specified permission is implied by this
object; false
otherwise.public String getActions()
SubsystemPermission
actions.
Always returns present SubsystemPermission
actions in the
following order: execute
, lifecycle
, metadata
,
context
.
getActions
in class BasicPermission
SubsystemPermission
actions.public PermissionCollection newPermissionCollection()
PermissionCollection
object suitable for storing
SubsystemPermission
s.newPermissionCollection
in class BasicPermission
PermissionCollection
object.public boolean equals(Object obj)
SubsystemPermission
objects.equals
in class BasicPermission
obj
- The object being compared for equality with this object.true
if obj
is equivalent to this
SubsystemPermission
; false
otherwise.public int hashCode()
hashCode
in class BasicPermission
Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0