Class AdminPermission
- All Implemented Interfaces:
Serializable,Guard
Action Methods
class Bundle.loadClass
execute Bundle.start
Bundle.stop
BundleStartLevel.setStartLevel
extensionLifecycle BundleContext.installBundle for extension bundles
Bundle.update for extension bundles
Bundle.uninstall for extension bundles
lifecycle BundleContext.installBundle
Bundle.update
Bundle.uninstall
listener BundleContext.addBundleListener for
SynchronousBundleListener
BundleContext.removeBundleListener for
SynchronousBundleListener
metadata Bundle.getHeaders
Bundle.getLocation
resolve FrameworkWiring.refreshBundles
FrameworkWiring.resolveBundles
resource Bundle.getResource
Bundle.getResources
Bundle.getEntry
Bundle.getEntryPaths
Bundle.findEntries
Bundle resource/entry URL creation
startlevel FrameworkStartLevel.setStartLevel
FrameworkStartLevel.setInitialBundleStartLevel
context Bundle.getBundleContext
weave WovenClass.getBytes
WovenClass.setBytes
WovenClass.getDynamicImports for modification
The special action "*" will represent all actions. The
resolve action is implied by the class, execute and
resource actions.
The name of this permission is a filter expression. The filter gives access to the following attributes:
- signer - A Distinguished Name chain used to sign a bundle. Wildcards in a DN are not matched according to the filter string rules, but according to the rules defined for a DN chain.
- location - The location of a bundle.
- id - The bundle ID of the designated bundle.
- name - The symbolic name of a bundle.
- Author:
- $Id: 2a803b07dcdc9af47ca0cb208d96fcd9c0bcfb0c $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe action stringclass.static final StringThe action stringcontext.static final StringThe action stringexecute.static final StringThe action stringextensionLifecycle.static final StringThe action stringlifecycle.static final StringThe action stringlistener.static final StringThe action stringmetadata.static final StringThe action stringresolve.static final StringThe action stringresource.static final StringThe action stringstartlevel.static final StringThe action stringweave. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newAdminPermissionobject that matches all bundles and has all actions.AdminPermission(String filter, String actions) Create a new AdminPermission.AdminPermission(Bundle bundle, String actions) Creates a new requestedAdminPermissionobject to be used by the code that must performcheckPermission. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines the equality of twoAdminPermissionobjects.Returns the canonical string representation of theAdminPermissionactions.inthashCode()Returns the hash code value for this object.booleanDetermines if the specified permission is implied by this object.Returns a newPermissionCollectionobject suitable for storingAdminPermissions.Methods inherited from class java.security.Permission
checkGuard, getName, toString
-
Field Details
-
CLASS
The action stringclass. Theclassaction implies theresolveaction.- Since:
- 1.3
- See Also:
-
EXECUTE
The action stringexecute. Theexecuteaction implies theresolveaction.- Since:
- 1.3
- See Also:
-
EXTENSIONLIFECYCLE
The action stringextensionLifecycle.- Since:
- 1.3
- See Also:
-
LIFECYCLE
The action stringlifecycle.- Since:
- 1.3
- See Also:
-
LISTENER
The action stringlistener.- Since:
- 1.3
- See Also:
-
METADATA
The action stringmetadata.- Since:
- 1.3
- See Also:
-
RESOLVE
The action stringresolve. Theresolveaction is implied by theclass,executeandresourceactions.- Since:
- 1.3
- See Also:
-
RESOURCE
The action stringresource. Theresourceaction implies theresolveaction.- Since:
- 1.3
- See Also:
-
STARTLEVEL
The action stringstartlevel.- Since:
- 1.3
- See Also:
-
CONTEXT
The action stringcontext.- Since:
- 1.4
- See Also:
-
WEAVE
The action stringweave.- Since:
- 1.6
- See Also:
-
-
Constructor Details
-
AdminPermission
public AdminPermission()Creates a newAdminPermissionobject that matches all bundles and has all actions. Equivalent to AdminPermission("*","*"); -
AdminPermission
Create a new AdminPermission. This constructor must only be used to create a permission that is going to be checked.Examples:
(signer=\*,o=ACME,c=US) (&(signer=\*,o=ACME,c=US)(name=com.acme.*) (location=http://www.acme.com/bundles/*)) (id>=1)
When a signer key is used within the filter expression the signer value must escape the special filter chars ('*', '(', ')').
Null arguments are equivalent to "*".
- Parameters:
filter- A filter expression that can use signer, location, id, and name keys. A value of "*" ornullmatches all bundle. Filter attribute names are processed in a case sensitive manner.actions-class,execute,extensionLifecycle,lifecycle,listener,metadata,resolve,resource,startlevel,contextorweave. A value of "*" ornullindicates all actions.- Throws:
IllegalArgumentException- If the filter has an invalid syntax.
-
AdminPermission
Creates a new requestedAdminPermissionobject to be used by the code that must performcheckPermission.AdminPermissionobjects created with this constructor cannot be added to anAdminPermissionpermission collection.- Parameters:
bundle- A bundle.actions-class,execute,extensionLifecycle,lifecycle,listener,metadata,resolve,resource,startlevel,context,weave. A value of "*" ornullindicates all actions.- Since:
- 1.3
-
-
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 bundle.This method returns
trueif the specified permission is an AdminPermission AND- this object's filter matches the specified permission's bundle ID, bundle symbolic name, bundle location and bundle signer distinguished name chain OR
- this object's filter is "*"
Special case: if the specified permission was constructed with "*" filter, then this method returns
trueif this object's filter is "*" and this object's actions include all of the specified permission's actions- Overrides:
impliesin classBasicPermission- Parameters:
p- The requested permission.- Returns:
trueif the specified permission is implied by this object;falseotherwise.
-
getActions
Returns the canonical string representation of theAdminPermissionactions.Always returns present
AdminPermissionactions in the following order:class,execute,extensionLifecycle,lifecycle,listener,metadata,resolve,resource,startlevel,context,weave.- Overrides:
getActionsin classBasicPermission- Returns:
- Canonical string representation of the
AdminPermissionactions.
-
newPermissionCollection
Returns a newPermissionCollectionobject suitable for storingAdminPermissions.- Overrides:
newPermissionCollectionin classBasicPermission- Returns:
- A new
PermissionCollectionobject.
-
equals
Determines the equality of twoAdminPermissionobjects.- Overrides:
equalsin classBasicPermission- Parameters:
obj- The object being compared for equality with this object.- Returns:
trueifobjis equivalent to thisAdminPermission;falseotherwise.
-
hashCode
public int hashCode()Returns the hash code value for this object.- Overrides:
hashCodein classBasicPermission- Returns:
- Hash code value for this object.
-