Top Description Fields Methods
org.osgi.service.condpermadmin

public Interface ConditionalPermissionInfo

Annotations
@ProviderType
Imports
org.osgi.annotation.versioning.ProviderType, org.osgi.service.permissionadmin.PermissionInfo

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.
Author
$Id: 1630bc4c55d27a5f5df313fa427e9b07c7d8ce90 $

Field Summary

Modifier and TypeField and Description
public static final String
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.

public static final String
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.

Method Summary

Modifier and TypeMethod and Description
public void
delete()
Deprecated Since 1.1.

Removes this Conditional Permission Info from the Conditional Permission Table.

public boolean

Returns:

true if obj is a ConditionalPermissionInfo, and has the same access decision, conditions, permissions and name as this ConditionalPermissionInfo object; false otherwise.
equals
(Object
The object to test for equality with this ConditionalPermissionInfo object.
obj
)

Determines the equality of two ConditionalPermissionInfo objects.

public String

Returns:

One of the following values:
  • allow - The access decision is "allow".
  • deny - The access decision is "deny".
getAccessDecision
()

Returns the access decision for this Conditional Permission Info.

public ConditionInfo[]

Returns:

The Condition Infos for the Conditions in this Conditional Permission Info.
getConditionInfos
()

Returns the Condition Infos for the Conditions that must be satisfied to enable the Permissions.

public String

Returns:

The string encoding of this ConditionalPermissionInfo.
getEncoded
()

Returns the string encoding of this ConditionalPermissionInfo in a form suitable for restoring this ConditionalPermissionInfo.

public String

Returns:

The name of this Conditional Permission Info. This can be null if this Conditional Permission Info was created without a name.
getName
()

Returns the name of this Conditional Permission Info.

public PermissionInfo[]

Returns:

The Permission Infos for the Permissions in this Conditional Permission Info.
getPermissionInfos
()

Returns the Permission Infos for the Permissions in this Conditional Permission Info.

public int

Returns:

A hash code value for this object.
hashCode
()

Returns the hash code value for this object.

public String

Returns:

The string representation of this ConditionalPermissionInfo.
toString
()

Returns the string representation of this ConditionalPermissionInfo.

Field Detail

ALLOWback to summary
public static final String 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
DENYback to summary
public static final String 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

Method Detail

deleteback to summary
public void delete()

Deprecated

Since 1.1. Use ConditionalPermissionAdmin#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 ConditionalPermissionUpdates that were created prior to calling this method can no longer be committed.

Exceptions
UnsupportedOperationException:
If this object was created by ConditionalPermissionAdmin#newConditionalPermissionInfo(String) or ConditionalPermissionAdmin#newConditionalPermissionInfo(String, ConditionInfo[] , PermissionInfo[] , String) or obtained from a ConditionalPermissionUpdate. This method only functions if this object was obtained from one of the ConditionalPermissionAdmin methods deprecated in version 1.1.
SecurityException:
If the caller does not have AllPermission.
equalsback to summary
public boolean equals(Object obj)

Determines the equality of two ConditionalPermissionInfo objects. This method checks that specified object has the same access decision, conditions, permissions and name as this ConditionalPermissionInfo object.

Parameters
obj:Object

The object to test for equality with this ConditionalPermissionInfo object.

Returns:boolean

true if obj is a ConditionalPermissionInfo, and has the same access decision, conditions, permissions and name as this ConditionalPermissionInfo object; false otherwise.

Since
1.1
getAccessDecisionback to summary
public String getAccessDecision()

Returns the access decision for this Conditional Permission Info.

Returns:String

One of the following values:

  • allow - The access decision is "allow".
  • deny - The access decision is "deny".
Since
1.1
getConditionInfosback to summary
public ConditionInfo[] getConditionInfos()

Returns the Condition Infos for the Conditions that must be satisfied to enable the Permissions.

Returns:ConditionInfo[]

The Condition Infos for the Conditions in this Conditional Permission Info.

getEncodedback to summary
public String getEncoded()

Returns the string encoding of this ConditionalPermissionInfo in a form suitable for restoring this ConditionalPermissionInfo.

The encoded format is:

  access {conditions permissions} name
where access is the access decision, conditions is zero or more encoded conditions, permissions is one or more encoded permissions and name is the name of the ConditionalPermissionInfo.

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:String

The string encoding of this ConditionalPermissionInfo.

Since
1.1
getNameback to summary
public String getName()

Returns the name of this Conditional Permission Info.

Returns:String

The name of this Conditional Permission Info. This can be null if this Conditional Permission Info was created without a name.

getPermissionInfosback to summary
public PermissionInfo[] getPermissionInfos()

Returns the Permission Infos for the Permissions in this Conditional Permission Info.

Returns:PermissionInfo[]

The Permission Infos for the Permissions in this Conditional Permission Info.

hashCodeback to summary
public int hashCode()

Returns the hash code value for this object.

Returns:int

A hash code value for this object.

Since
1.1
toStringback to summary
public String toString()

Returns the string representation of this ConditionalPermissionInfo. The string is created by calling the getEncoded method on this ConditionalPermissionInfo.

Returns:String

The string representation of this ConditionalPermissionInfo.

Since
1.1