public class ApplicationAdminPermission
extends java.security.Permission
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
.
Modifier and Type | Class and Description |
---|---|
private static class |
ApplicationAdminPermission.SignerWrapper |
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
actions |
private static java.util.Vector |
ACTIONS |
private java.util.Vector |
actionsVector |
private ApplicationDescriptor |
applicationDescriptor |
private java.lang.String |
applicationID |
private org.osgi.framework.Filter |
appliedFilter |
private java.lang.String |
filter |
static java.lang.String |
LIFECYCLE_ACTION
Allows the lifecycle management of the target applications.
|
static java.lang.String |
LOCK_ACTION
Allows setting/unsetting the locking state of the target applications.
|
static java.lang.String |
SCHEDULE_ACTION
Allows scheduling of the target applications.
|
private static long |
serialVersionUID |
Constructor and Description |
---|
ApplicationAdminPermission(ApplicationDescriptor application,
java.lang.String actions)
This contructor should be used when creating
ApplicationAdminPermission
instance for checkPermission call. |
ApplicationAdminPermission(java.lang.String filter,
java.lang.String actions)
Constructs an ApplicationAdminPermission.
|
Modifier and Type | Method and Description |
---|---|
private static java.util.Vector |
actionsVector(java.lang.String actions) |
private static boolean |
equal(java.lang.Object a,
java.lang.Object b)
Compares parameters for equality.
|
boolean |
equals(java.lang.Object with) |
java.lang.String |
getActions()
Returns the actions of this permission.
|
private org.osgi.framework.Filter |
getFilter() |
int |
hashCode() |
boolean |
implies(java.security.Permission otherPermission)
Checks if the specified
permission is implied by this permission. |
private void |
init() |
ApplicationAdminPermission |
setCurrentApplicationId(java.lang.String applicationId)
This method can be used in the
ProtectionDomain
implementation in the implies method to insert the
application ID of the current application into the permission being
checked. |
private static final long serialVersionUID
public static final java.lang.String LIFECYCLE_ACTION
public static final java.lang.String SCHEDULE_ACTION
schedule
implies lifecycle
public static final java.lang.String LOCK_ACTION
private ApplicationDescriptor applicationDescriptor
private java.lang.String applicationID
private static final java.util.Vector ACTIONS
private java.util.Vector actionsVector
private final java.lang.String filter
private final java.lang.String actions
private org.osgi.framework.Filter appliedFilter
public ApplicationAdminPermission(java.lang.String filter, java.lang.String actions) throws org.osgi.framework.InvalidSyntaxException
filter
specifies the target application. The filter
is an
LDAP-style filter, the recognized properties are signer
and pid
. The pattern specified in the signer
is 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 attribute
pid
is matched with the PID of the application according to
the filter string rules.
If the filter
is null
then it matches
"*"
. If
actions
is "*"
then it identifies all the
possible actions.
filter
- filter to identify application. The value null
is 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 be
null
. The order of the actions in the list is
not significant.org.osgi.framework.InvalidSyntaxException
- is thrown if the specified filter
is not syntactically
correct.java.lang.NullPointerException
- is thrown if the actions parameter is null
ApplicationDescriptor
,
AdminPermission
public ApplicationAdminPermission(ApplicationDescriptor application, java.lang.String actions)
ApplicationAdminPermission
instance for checkPermission
call.application
- the tareget of the operation, it must not be null
actions
- the required operation. it must not be null
java.lang.NullPointerException
- if any of the arguments is null.public ApplicationAdminPermission setCurrentApplicationId(java.lang.String applicationId)
ProtectionDomain
implementation in the implies
method to insert the
application ID of the current application into the permission being
checked. This enables the evaluation of the
<<SELF>>
pseudo targets.applicationId
- the ID of the current application.public boolean implies(java.security.Permission otherPermission)
permission
is implied by this permission.
The method returns true under the following conditions:
ApplicationAdminPermission(String, String)
)
otherPermission
was created for a particular ApplicationDescriptor
(see ApplicationAdminPermission(ApplicationDescriptor, String)
)
filter
of this permission mathes the ApplicationDescriptor
specified
in the otherPermission
. If the filter in this permission is the
<<SELF>>
pseudo target, then the currentApplicationId set in the
otherPermission
is compared to the application Id of the target
ApplicationDescriptor
.
otherPermission
implies
in class java.security.Permission
otherPermission
- the implied permissionotherPermission
, false otherwise.public boolean equals(java.lang.Object with)
equals
in class java.security.Permission
private static boolean equal(java.lang.Object a, java.lang.Object b)
a
- object to compareb
- other object to comparepublic int hashCode()
hashCode
in class java.security.Permission
public java.lang.String getActions()
getActions
in class java.security.Permission
private static java.util.Vector actionsVector(java.lang.String actions)
private void init()
private org.osgi.framework.Filter getFilter()