Package org.osgi.service.subsystem
Class SubsystemPermission
java.lang.Object
java.security.Permission
java.security.BasicPermission
org.osgi.service.subsystem.SubsystemPermission
- All Implemented Interfaces:
Serializable
,Guard
A bundle's authority to perform specific privileged administrative operations
on or to get sensitive information about a subsystem. The actions for this
permission are:
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:
- location - The location of a subsystem.
- id - The subsystem ID of the designated subsystem.
- name - The symbolic name of a subsystem.
- Author:
- $Id: 5c71d73cc6a3e8b2c2a7a3f188ebcf79b5ef7888 $
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSubsystemPermission
(String filter, String actions) Create a new SubsystemPermission.SubsystemPermission
(Subsystem subsystem, String actions) Creates a new requestedSubsystemPermission
object to be used by the code that must performcheckPermission
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines the equality of twoSubsystemPermission
objects.Returns the canonical string representation of theSubsystemPermission
actions.int
hashCode()
Returns the hash code value for this object.boolean
Determines if the specified permission is implied by this object.Returns a newPermissionCollection
object suitable for storingSubsystemPermission
s.Methods inherited from class java.security.Permission
checkGuard, getName, toString
-
Field Details
-
EXECUTE
The action stringexecute
.- See Also:
-
LIFECYCLE
The action stringlifecycle
.- See Also:
-
METADATA
The action stringmetadata
.- See Also:
-
CONTEXT
The action stringcontext
.- See Also:
-
-
Constructor Details
-
SubsystemPermission
Create a new SubsystemPermission. This constructor must only be used to create a permission that is going to be checked.Examples:
(name=com.acme.*)(location=http://www.acme.com/subsystems/*)) (id>=1)
- Parameters:
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
, orcontext
.- Throws:
IllegalArgumentException
- If the filter has an invalid syntax.
-
SubsystemPermission
Creates a new requestedSubsystemPermission
object to be used by the code that must performcheckPermission
.SubsystemPermission
objects created with this constructor cannot be added to anSubsystemPermission
permission collection.- Parameters:
subsystem
- A subsystem.actions
-execute
,lifecycle
,metadata
, orcontext
.
-
-
Method Details
-
implies
Determines if the specified permission is implied by this object. This method throws an exception if the specified permission was not constructed with a subsystem.This method returns
true
if the specified permission is a SubsystemPermission AND- this object's filter matches the specified permission's subsystem ID, subsystem symbolic name, and subsystem location OR
- this object's filter is "*"
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- Overrides:
implies
in classBasicPermission
- Parameters:
p
- The requested permission.- Returns:
true
if the specified permission is implied by this object;false
otherwise.
-
getActions
Returns the canonical string representation of theSubsystemPermission
actions.Always returns present
SubsystemPermission
actions in the following order:execute
,lifecycle
,metadata
,context
.- Overrides:
getActions
in classBasicPermission
- Returns:
- Canonical string representation of the
SubsystemPermission
actions.
-
newPermissionCollection
Returns a newPermissionCollection
object suitable for storingSubsystemPermission
s.- Overrides:
newPermissionCollection
in classBasicPermission
- Returns:
- A new
PermissionCollection
object.
-
equals
Determines the equality of twoSubsystemPermission
objects.- Overrides:
equals
in classBasicPermission
- Parameters:
obj
- The object being compared for equality with this object.- Returns:
true
ifobj
is equivalent to thisSubsystemPermission
;false
otherwise.
-
hashCode
public int hashCode()Returns the hash code value for this object.- Overrides:
hashCode
in classBasicPermission
- Returns:
- Hash code value for this object.
-