org.osgi.service.permissionadmin.PermissionInfo Class Reference

List of all members.


Detailed Description

Permission representation used by the Permission Admin service.

This class encapsulates three pieces of information: a Permission type (class name), which must be a subclass of java.security.Permission, and the name and actions arguments passed to its constructor.

In order for a permission represented by a PermissionInfo to be instantiated and considered during a permission check, its Permission class must be available from the system classpath or an exported package. This means that the instantiation of a permission represented by a PermissionInfo may be delayed until the package containing its Permission class has been exported by a bundle.

Version:
Revision
1.16

Definition at line 40 of file PermissionInfo.java.


Public Member Functions

 PermissionInfo (String type, String name, String actions)
 Constructs a PermissionInfo from the specified type, name, and actions.
 PermissionInfo (String encodedPermission)
 Constructs a PermissionInfo object from the specified encoded PermissionInfo string.
final String getEncoded ()
 Returns the string encoding of this PermissionInfo in a form suitable for restoring this PermissionInfo.
String toString ()
 Returns the string representation of this PermissionInfo.
final String getType ()
 Returns the fully qualified class name of the permission represented by this PermissionInfo.
final String getName ()
 Returns the name of the permission represented by this PermissionInfo.
final String getActions ()
 Returns the actions of the permission represented by this PermissionInfo.
boolean equals (Object obj)
 Determines the equality of two PermissionInfo objects.
int hashCode ()
 Returns the hash code value for this object.

Constructor & Destructor Documentation

org.osgi.service.permissionadmin.PermissionInfo.PermissionInfo ( String  type,
String  name,
String  actions 
)

Constructs a PermissionInfo from the specified type, name, and actions.

Parameters:
type The fully qualified class name of the permission represented by this PermissionInfo. The class must be a subclass of java.security.Permission and must define a 2-argument constructor that takes a name string and an actions string.
name The permission name that will be passed as the first argument to the constructor of the Permission class identified by type.
actions The permission actions that will be passed as the second argument to the constructor of the Permission class identified by type.
Exceptions:
java.lang.NullPointerException if type is null.
java.lang.IllegalArgumentException if action is not null and name is null.

Definition at line 68 of file PermissionInfo.java.

org.osgi.service.permissionadmin.PermissionInfo.PermissionInfo ( String  encodedPermission  ) 

Constructs a PermissionInfo object from the specified encoded PermissionInfo string.

White space in the encoded PermissionInfo string is ignored.

Parameters:
encodedPermission The encoded PermissionInfo.
See also:
getEncoded
Exceptions:
java.lang.IllegalArgumentException If the encodedPermission is not properly formatted.

Definition at line 91 of file PermissionInfo.java.


Member Function Documentation

final String org.osgi.service.permissionadmin.PermissionInfo.getEncoded (  ) 

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

The encoded format is:

 (type)
 

or

 (type "name")
 

or

 (type "name" "actions")
 

where name and actions are strings that are encoded for proper parsing. Specifically, the ",</code>, carriage return, and linefeed characters are escaped using \", \,, and
, respectively.

The encoded string contains no leading or trailing whitespace characters. A single space character is used between type and "name" and between "name" and "actions".

Returns:
The string encoding of this PermissionInfo.

Definition at line 225 of file PermissionInfo.java.

Referenced by org.osgi.service.permissionadmin.PermissionInfo.toString().

String org.osgi.service.permissionadmin.PermissionInfo.toString (  ) 

Returns the string representation of this PermissionInfo.

The string is created by calling the getEncoded method on this PermissionInfo.

Returns:
The string representation of this PermissionInfo.

Definition at line 253 of file PermissionInfo.java.

References org.osgi.service.permissionadmin.PermissionInfo.getEncoded().

final String org.osgi.service.permissionadmin.PermissionInfo.getType (  ) 

Returns the fully qualified class name of the permission represented by this PermissionInfo.

Returns:
The fully qualified class name of the permission represented by this PermissionInfo.

Definition at line 264 of file PermissionInfo.java.

final String org.osgi.service.permissionadmin.PermissionInfo.getName (  ) 

Returns the name of the permission represented by this PermissionInfo.

Returns:
The name of the permission represented by this PermissionInfo, or null if the permission does not have a name.

Definition at line 276 of file PermissionInfo.java.

final String org.osgi.service.permissionadmin.PermissionInfo.getActions (  ) 

Returns the actions of the permission represented by this PermissionInfo.

Returns:
The actions of the permission represented by this PermissionInfo, or null if the permission does not have any actions associated with it.

Definition at line 288 of file PermissionInfo.java.

boolean org.osgi.service.permissionadmin.PermissionInfo.equals ( Object  obj  ) 

Determines the equality of two PermissionInfo objects.

This method checks that specified object has the same type, name and actions as this PermissionInfo object.

Parameters:
obj The object to test for equality with this PermissionInfo object.
Returns:
true if obj is a PermissionInfo, and has the same type, name and actions as this PermissionInfo object; false otherwise.

Definition at line 304 of file PermissionInfo.java.

References org.osgi.service.permissionadmin.PermissionInfo.actions, org.osgi.service.permissionadmin.PermissionInfo.name, and org.osgi.service.permissionadmin.PermissionInfo.type.

int org.osgi.service.permissionadmin.PermissionInfo.hashCode (  ) 

Returns the hash code value for this object.

Returns:
A hash code value for this object.

Definition at line 335 of file PermissionInfo.java.


The documentation for this class was generated from the following file:
Generated on Mon Jan 11 21:19:24 2010 for OpenMobileIS by  doxygen 1.5.4