Package org.osgi.service.application
Class ApplicationAdminPermission
java.lang.Object
java.security.Permission
org.osgi.service.application.ApplicationAdminPermission
- All Implemented Interfaces:
Serializable,Guard
This class implements permissions for manipulating applications and their
instances.
ApplicationAdminPermission can be targeted to applications that matches the specified filter.
ApplicationAdminPermission may be granted for different actions:
lifecycle, schedule and lock. The
permission schedule implies the permission
lifecycle.
- Version:
- $Id: 5fe9fdd7f70e6f506ef46fc19d55eecf59029687 $
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionApplicationAdminPermission(String filter, String actions) Constructs an ApplicationAdminPermission.ApplicationAdminPermission(ApplicationDescriptor application, String actions) This contructor should be used when creatingApplicationAdminPermissioninstance forcheckPermissioncall. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the actions of this permission.inthashCode()booleanimplies(Permission otherPermission) Checks if the specifiedpermissionis implied by this permission.setCurrentApplicationId(String applicationId) This method can be used in theProtectionDomainimplementation in theimpliesmethod to insert the application ID of the current application into the permission being checked.Methods inherited from class java.security.Permission
checkGuard, getName, newPermissionCollection, toString
-
Field Details
-
LIFECYCLE_ACTION
Allows the lifecycle management of the target applications.- See Also:
-
SCHEDULE_ACTION
Allows scheduling of the target applications. The permission to schedule an application implies that the scheduler can also manage the lifecycle of that application i.e.scheduleimplieslifecycle- See Also:
-
LOCK_ACTION
Allows setting/unsetting the locking state of the target applications.- See Also:
-
-
Constructor Details
-
ApplicationAdminPermission
Constructs an ApplicationAdminPermission. Thefilterspecifies the target application. Thefilteris an LDAP-style filter, the recognized properties aresignerandpid. The pattern specified in thesigneris matched with the Distinguished Name chain used to sign the application. Wildcards in a DN are not matched according to the filter string rules, but according to the rules defined for a DN chain. The attributepidis matched with the PID of the application according to the filter string rules.If the
filterisnullthen it matches"*". Ifactionsis"*"then it identifies all the possible actions.- Parameters:
filter- filter to identify application. The valuenullis equivalent to"*"and it indicates "all application".actions- comma-separated list of the desired actions granted on the applications or "*" means all the actions. It must not benull. The order of the actions in the list is not significant.- Throws:
InvalidSyntaxException- is thrown if the specifiedfilteris not syntactically correct.NullPointerException- is thrown if the actions parameter isnull- See Also:
-
ApplicationAdminPermission
This contructor should be used when creatingApplicationAdminPermissioninstance forcheckPermissioncall.- Parameters:
application- the tareget of the operation, it must not benullactions- the required operation. it must not benull- Throws:
NullPointerException- if any of the arguments is null.
-
-
Method Details
-
setCurrentApplicationId
This method can be used in theProtectionDomainimplementation in theimpliesmethod to insert the application ID of the current application into the permission being checked. This enables the evaluation of the<<SELF>>pseudo targets.- Parameters:
applicationId- the ID of the current application.- Returns:
- the permission updated with the ID of the current application
-
implies
Checks if the specifiedpermissionis implied by this permission. The method returns true under the following conditions:- This permission was created by specifying a filter (see
ApplicationAdminPermission(String, String)) - The implied
otherPermissionwas created for a particularApplicationDescriptor(seeApplicationAdminPermission(ApplicationDescriptor, String)) - The
filterof this permission mathes theApplicationDescriptorspecified in theotherPermission. If the filter in this permission is the<<SELF>>pseudo target, then the currentApplicationId set in theotherPermissionis compared to the application Id of the targetApplicationDescriptor. - The list of permitted actions in this permission contains all actions required in the
otherPermission
- Specified by:
impliesin classPermission- Parameters:
otherPermission- the implied permission- Returns:
- true if this permission implies the
otherPermission, false otherwise.
- This permission was created by specifying a filter (see
-
equals
- Specified by:
equalsin classPermission
-
hashCode
public int hashCode()- Specified by:
hashCodein classPermission
-
getActions
Returns the actions of this permission.- Specified by:
getActionsin classPermission- Returns:
- the actions specified when this permission was created
-