@ProviderType
public interface ConditionalPermissionAdmin
Modifier and Type | Method and Description |
---|---|
ConditionalPermissionInfo |
addConditionalPermissionInfo(ConditionInfo[] conditions,
PermissionInfo[] permissions)
Deprecated.
As of 1.1. Use
newConditionalPermissionUpdate()
instead. |
java.security.AccessControlContext |
getAccessControlContext(java.lang.String[] signers)
Returns the Access Control Context that corresponds to the specified
signers.
|
ConditionalPermissionInfo |
getConditionalPermissionInfo(java.lang.String name)
Deprecated.
As of 1.1. Use
newConditionalPermissionUpdate()
instead. |
java.util.Enumeration<ConditionalPermissionInfo> |
getConditionalPermissionInfos()
Deprecated.
As of 1.1. Use
newConditionalPermissionUpdate()
instead. |
ConditionalPermissionInfo |
newConditionalPermissionInfo(java.lang.String encodedConditionalPermissionInfo)
Creates a new
ConditionalPermissionInfo from the specified
encoded ConditionalPermissionInfo string suitable for insertion
into a ConditionalPermissionUpdate . |
ConditionalPermissionInfo |
newConditionalPermissionInfo(java.lang.String name,
ConditionInfo[] conditions,
PermissionInfo[] permissions,
java.lang.String access)
Creates a new ConditionalPermissionInfo with the specified fields
suitable for insertion into a
ConditionalPermissionUpdate . |
ConditionalPermissionUpdate |
newConditionalPermissionUpdate()
Creates a new update for the Conditional Permission Table.
|
ConditionalPermissionInfo |
setConditionalPermissionInfo(java.lang.String name,
ConditionInfo[] conditions,
PermissionInfo[] permissions)
Deprecated.
As of 1.1. Use
newConditionalPermissionUpdate()
instead. |
ConditionalPermissionInfo addConditionalPermissionInfo(ConditionInfo[] conditions, PermissionInfo[] permissions)
newConditionalPermissionUpdate()
instead.
The Conditional Permission Info will be given a unique, never reused
name. This entry will be added at the beginning of the Conditional
Permission Table with an access decision of
ALLOW
.
Since this method changes the Conditional Permission Table any
ConditionalPermissionUpdate
s that were created prior to calling
this method can no longer be committed.
conditions
- The conditions that need to be satisfied to enable the
specified permissions. This argument can be null
or an
empty array indicating the specified permissions are not guarded
by any conditions.permissions
- The permissions that are enabled when the specified
conditions, if any, are satisfied. This argument must not be
null
and must specify at least one permission.java.lang.IllegalArgumentException
- If no permissions are specified.java.lang.SecurityException
- If the caller does not have
AllPermission
.ConditionalPermissionInfo setConditionalPermissionInfo(java.lang.String name, ConditionInfo[] conditions, PermissionInfo[] permissions)
newConditionalPermissionUpdate()
instead.
If the specified name is null
, a new Conditional Permission Info
must be created and will be given a unique, never reused name. If there
is currently no Conditional Permission Info with the specified name, a
new Conditional Permission Info must be created with the specified name.
Otherwise, the Conditional Permission Info with the specified name must
be updated with the specified Conditions and Permissions. If a new entry
was created in the Conditional Permission Table it will be added at the
beginning of the table with an access decision of
ALLOW
.
Since this method changes the underlying permission table any
ConditionalPermissionUpdate
s that were created prior to calling
this method can no longer be committed.
name
- The name of the Conditional Permission Info, or null
.conditions
- The conditions that need to be satisfied to enable the
specified permissions. This argument can be null
or an
empty array indicating the specified permissions are not guarded
by any conditions.permissions
- The permissions that are enabled when the specified
conditions, if any, are satisfied. This argument must not be
null
and must specify at least one permission.java.lang.IllegalArgumentException
- If no permissions are specified.java.lang.SecurityException
- If the caller does not have
AllPermission
.java.util.Enumeration<ConditionalPermissionInfo> getConditionalPermissionInfos()
newConditionalPermissionUpdate()
instead.The returned Enumeration will return elements in the order they are kept in the Conditional Permission Table.
The Enumeration returned is based on a copy of the Conditional Permission Table and therefore will not throw exceptions if the Conditional Permission Table is changed during the course of reading elements from the Enumeration.
ConditionalPermissionInfo getConditionalPermissionInfo(java.lang.String name)
newConditionalPermissionUpdate()
instead.name
- The name of the Conditional Permission Info to be returned.null
if no Conditional Permission Info with the specified
name exists in the Conditional Permission Table.java.security.AccessControlContext getAccessControlContext(java.lang.String[] signers)
IllegalStateException
because the
state is UNINSTALLEDnull
signers
- The signers for which to return an Access Control Context.AccessControlContext
that has the Permissions
associated with the signer.ConditionalPermissionUpdate newConditionalPermissionUpdate()
ConditionalPermissionInfo newConditionalPermissionInfo(java.lang.String name, ConditionInfo[] conditions, PermissionInfo[] permissions, java.lang.String access)
ConditionalPermissionUpdate
. The
delete
method on ConditionalPermissionInfo
objects
created with this method must throw UnsupportedOperationException.name
- The name of the created ConditionalPermissionInfo
or
null
to have a unique name generated when the returned
ConditionalPermissionInfo
is committed in an update to the
Conditional Permission Table.conditions
- The conditions that need to be satisfied to enable the
specified permissions. This argument can be null
or an
empty array indicating the specified permissions are not guarded
by any conditions.permissions
- The permissions that are enabled when the specified
conditions, if any, are satisfied. This argument must not be
null
and must specify at least one permission.access
- Access decision. Must be one of the following values:
The specified access decision value must be evaluated case
insensitively.ConditionalPermissionInfo
object suitable for insertion
into a ConditionalPermissionUpdate
.java.lang.IllegalArgumentException
- If no permissions are specified or if
the specified access decision is not a valid value.ConditionalPermissionInfo newConditionalPermissionInfo(java.lang.String encodedConditionalPermissionInfo)
ConditionalPermissionInfo
from the specified
encoded ConditionalPermissionInfo
string suitable for insertion
into a ConditionalPermissionUpdate
. The delete
method on
ConditionalPermissionInfo
objects created with this method must
throw UnsupportedOperationException.encodedConditionalPermissionInfo
- The encoded
ConditionalPermissionInfo
. White space in the encoded
ConditionalPermissionInfo
is ignored. The access decision
value in the encoded ConditionalPermissionInfo
must be
evaluated case insensitively. If the encoded
ConditionalPermissionInfo
does not contain the optional
name, null
must be used for the name and a unique name
will be generated when the returned
ConditionalPermissionInfo
is committed in an update to the
Conditional Permission Table.ConditionalPermissionInfo
object suitable for insertion
into a ConditionalPermissionUpdate
.java.lang.IllegalArgumentException
- If the specified
encodedConditionalPermissionInfo
is not properly
formatted.ConditionalPermissionInfo.getEncoded()
Copyright © OSGi Alliance (2000, 2020). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0