Package org.osgi.service.condpermadmin
Interface ConditionalPermissionInfo
@ProviderType
public interface ConditionalPermissionInfo
A list of Permissions guarded by a list of conditions with an access
decision. Instances of this interface are obtained from the Conditional
Permission Admin service.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
This string is used to indicate that a row in the Conditional Permission Table should return an access decision of "allow" if the conditions are all satisfied and at least one of the permissions is implied.static final String
This string is used to indicate that a row in the Conditional Permission Table should return an access decision of "deny" if the conditions are all satisfied and at least one of the permissions is implied. -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
Deprecated.As of 1.1.boolean
Determines the equality of twoConditionalPermissionInfo
objects.Returns the access decision for this Conditional Permission Info.Returns the Condition Infos for the Conditions that must be satisfied to enable the Permissions.Returns the string encoding of thisConditionalPermissionInfo
in a form suitable for restoring thisConditionalPermissionInfo
.getName()
Returns the name of this Conditional Permission Info.Returns the Permission Infos for the Permissions in this Conditional Permission Info.int
hashCode()
Returns the hash code value for this object.toString()
Returns the string representation of thisConditionalPermissionInfo
.
-
Field Details
-
ALLOW
This string is used to indicate that a row in the Conditional Permission Table should return an access decision of "allow" if the conditions are all satisfied and at least one of the permissions is implied.- Since:
- 1.1
- See Also:
-
DENY
This string is used to indicate that a row in the Conditional Permission Table should return an access decision of "deny" if the conditions are all satisfied and at least one of the permissions is implied.- Since:
- 1.1
- See Also:
-
-
Method Details
-
getConditionInfos
ConditionInfo[] getConditionInfos()Returns the Condition Infos for the Conditions that must be satisfied to enable the Permissions.- Returns:
- The Condition Infos for the Conditions in this Conditional Permission Info.
-
getPermissionInfos
PermissionInfo[] getPermissionInfos()Returns the Permission Infos for the Permissions in this Conditional Permission Info.- Returns:
- The Permission Infos for the Permissions in this Conditional Permission Info.
-
delete
void delete()Deprecated.As of 1.1. UseConditionalPermissionAdmin.newConditionalPermissionUpdate()
instead to manage the Conditional Permissions.Removes this Conditional Permission Info from the Conditional Permission Table.Since this method changes the underlying permission table, any
ConditionalPermissionUpdate
s that were created prior to calling this method can no longer be committed.- Throws:
UnsupportedOperationException
- If this object was created byConditionalPermissionAdmin.newConditionalPermissionInfo(String)
orConditionalPermissionAdmin.newConditionalPermissionInfo(String, ConditionInfo[], PermissionInfo[], String)
or obtained from aConditionalPermissionUpdate
. This method only functions if this object was obtained from one of theConditionalPermissionAdmin
methods deprecated in version 1.1.SecurityException
- If the caller does not haveAllPermission
.
-
getName
String getName()Returns the name of this Conditional Permission Info.- Returns:
- The name of this Conditional Permission Info. This can be
null
if this Conditional Permission Info was created without a name.
-
getAccessDecision
String getAccessDecision()Returns the access decision for this Conditional Permission Info. -
getEncoded
String getEncoded()Returns the string encoding of thisConditionalPermissionInfo
in a form suitable for restoring thisConditionalPermissionInfo
.The encoded format is:
access {conditions permissions} name
where access is the access decision, conditions is zero or moreencoded conditions
, permissions is one or moreencoded permissions
and name is the name of theConditionalPermissionInfo
.name is optional. If name is present in the encoded string, it must quoted, beginning and ending with
"
. The name value must be encoded for proper parsing. Specifically, the"
,\
, carriage return, and line feed characters must be escaped using\"
,\\
,\r
, and\n
, respectively.The encoded string contains no leading or trailing whitespace characters. A single space character is used between access and
{
and between}
and name, if name is present. All encoded conditions and permissions are separated by a single space character.- Returns:
- The string encoding of this
ConditionalPermissionInfo
. - Since:
- 1.1
-
toString
String toString()Returns the string representation of thisConditionalPermissionInfo
. The string is created by calling thegetEncoded
method on thisConditionalPermissionInfo
. -
equals
Determines the equality of twoConditionalPermissionInfo
objects. This method checks that specified object has the same access decision, conditions, permissions and name as thisConditionalPermissionInfo
object.- Overrides:
equals
in classObject
- Parameters:
obj
- The object to test for equality with thisConditionalPermissionInfo
object.- Returns:
true
ifobj
is aConditionalPermissionInfo
, and has the same access decision, conditions, permissions and name as thisConditionalPermissionInfo
object;false
otherwise.- Since:
- 1.1
-
hashCode
int hashCode()Returns the hash code value for this object.
-