Top Description Fields Constructors Methods
org.osgi.service.cm

public final Class ConfigurationPermission

Additional top-level class in compilation unit: ConfigurationPermissionCollection.

extends BasicPermission
Class Inheritance
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .ObjectStreamField, java.security.BasicPermission, .Permission, .PermissionCollection, java.util.ArrayList, .Collection, .Collections, .Enumeration, .HashMap, .List, .Map, org.osgi.framework.Filter

Indicates a bundle's authority to configure bundles or be updated by Configuration Admin.
Author
$Id: 739845127a6f4a8155aa56e5a0e67e04cf9cfe92 $
Since
1.2

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int
pack-priv transient int
action_mask

The actions mask.

pack-priv static final int
private static final int
private volatile String
actions

The actions in canonical form.

public static final String
ATTRIBUTE

Provides permission to set or remove an attribute on the configuration.

public static final String
CONFIGURE

Provides permission to create new configurations for other bundles as well as manipulate them.

private static final long
private transient List<String>
substrings

Parsed name if it includes wildcards: "*"

public static final String
TARGET

The permission to be updated, that is, act as a Managed Service or Managed Service Factory.

Constructor Summary

AccessConstructor and Description
public
ConfigurationPermission(String
Name of the permission. Wildcards ('*') are allowed in the name. During implies(Permission), the name is matched to the requested permission using the substring matching rules used by Filters.
name
,
String
Comma separated list of CONFIGURE, TARGET, ATTRIBUTE (case insensitive).
actions
)

Create a new ConfigurationPermission.

pack-priv
ConfigurationPermission(String
location string
name
,
int
action mask
mask
)

Package private constructor used by ConfigurationPermissionCollection.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if obj is equivalent to this ConfigurationPermission; false otherwise.
equals
(Object
The object being compared for equality with this object.
obj
)

Overrides java.security.BasicPermission.equals.

Determines the equality of two ConfigurationPermission objects.

public String

Returns:

Canonical string representation of the ConfigurationPermission actions.
getActions
()

Overrides java.security.BasicPermission.getActions.

Returns the canonical string representation of the ConfigurationPermission actions.

public int

Returns:

Hash code value for this object.
hashCode
()

Overrides java.security.BasicPermission.hashCode.

Returns the hash code value for this object.

public boolean

Returns:

true if the specified permission is implied by this object; false otherwise.
implies
(Permission
The target permission to check.
p
)

Overrides java.security.BasicPermission.implies.

Determines if a ConfigurationPermission object "implies" the specified permission.

pack-priv boolean

Returns:

true if the specified permission is implied by this object; false otherwise.
implies0
(ConfigurationPermission
The requested ConfigurationPermission which has already be validated as a proper argument.
requested
,
int
The effective actions with which to start.
effective
)

Internal implies method.

public PermissionCollection

Returns:

A new PermissionCollection object.
newPermissionCollection
()

Overrides java.security.BasicPermission.newPermissionCollection.

Returns a new PermissionCollection object suitable for storing ConfigurationPermissions.

private static int

Returns:

action mask.
parseActions
(String
Action string.
actions
)

Parse action string into action mask.

private static List<String>

Returns:

null is the name has no wildcards or a List<String> where element is a substring to match or null for '*'.
parseSubstring
(String
The name of the permission.
name
)

Parse the name for wildcard processing.

private synchronized void
readObject(ObjectInputStream
the ObjectInputStream from which data is read
s
)

Hides java.security.BasicPermission.readObject.

readObject is called to restore the state of this permission from a stream.

private void
setTransients(int
action mask
mask
)

Called by constructors and when deserialized.

private synchronized void
writeObject(ObjectOutputStream s)

WriteObject is called to save the state of this permission object to a stream.

Field Detail

ACTION_ALLback to summary
private static final int ACTION_ALL
ACTION_ATTRIBUTEback to summary
private static final int ACTION_ATTRIBUTE
ACTION_CONFIGUREback to summary
private static final int ACTION_CONFIGURE
action_maskback to summary
pack-priv transient int action_mask

The actions mask.

ACTION_NONEback to summary
pack-priv static final int ACTION_NONE
ACTION_TARGETback to summary
private static final int ACTION_TARGET
actionsback to summary
private volatile String actions

The actions in canonical form.

ATTRIBUTEback to summary
public static final String ATTRIBUTE

Provides permission to set or remove an attribute on the configuration. The action string attribute.

Since
1.6
CONFIGUREback to summary
public static final String CONFIGURE

Provides permission to create new configurations for other bundles as well as manipulate them. The action string configure.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.security.BasicPermission.serialVersionUID.

substringsback to summary
private transient List<String> substrings

Parsed name if it includes wildcards: "*"

TARGETback to summary
public static final String TARGET

The permission to be updated, that is, act as a Managed Service or Managed Service Factory. The action string target.

Since
1.4

Constructor Detail

ConfigurationPermissionback to summary
public ConfigurationPermission(String name, String actions)

Create a new ConfigurationPermission.

Parameters
name:String

Name of the permission. Wildcards ('*') are allowed in the name. During implies(Permission), the name is matched to the requested permission using the substring matching rules used by Filters.

actions:String

Comma separated list of CONFIGURE, TARGET, ATTRIBUTE (case insensitive).

ConfigurationPermissionback to summary
pack-priv ConfigurationPermission(String name, int mask)

Package private constructor used by ConfigurationPermissionCollection.

Parameters
name:String

location string

mask:int

action mask

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.security.BasicPermission.equals.

Determines the equality of two ConfigurationPermission objects.

Two ConfigurationPermission objects are equal.

Parameters
obj:Object

The object being compared for equality with this object.

Returns:boolean

true if obj is equivalent to this ConfigurationPermission; false otherwise.

Annotations
@Override
getActionsback to summary
public String getActions()

Overrides java.security.BasicPermission.getActions.

Returns the canonical string representation of the ConfigurationPermission actions.

Always returns present ConfigurationPermission actions in the following order: configure, target, attribute.

Returns:String

Canonical string representation of the ConfigurationPermission actions.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.security.BasicPermission.hashCode.

Returns the hash code value for this object.

Returns:int

Hash code value for this object.

Annotations
@Override
impliesback to summary
public boolean implies(Permission p)

Overrides java.security.BasicPermission.implies.

Determines if a ConfigurationPermission object "implies" the specified permission.

Parameters
p:Permission

The target permission to check.

Returns:boolean

true if the specified permission is implied by this object; false otherwise.

Annotations
@Override
implies0back to summary
pack-priv boolean implies0(ConfigurationPermission requested, int effective)

Internal implies method. Used by the implies and the permission collection implies methods.

Parameters
requested:ConfigurationPermission

The requested ConfigurationPermission which has already be validated as a proper argument.

effective:int

The effective actions with which to start.

Returns:boolean

true if the specified permission is implied by this object; false otherwise.

newPermissionCollectionback to summary
public PermissionCollection newPermissionCollection()

Overrides java.security.BasicPermission.newPermissionCollection.

Returns a new PermissionCollection object suitable for storing ConfigurationPermissions.

Returns:PermissionCollection

A new PermissionCollection object.

Annotations
@Override
parseActionsback to summary
private static int parseActions(String actions)

Parse action string into action mask.

Parameters
actions:String

Action string.

Returns:int

action mask.

parseSubstringback to summary
private static List<String> parseSubstring(String name)

Parse the name for wildcard processing.

Parameters
name:String

The name of the permission.

Returns:List<String>

null is the name has no wildcards or a List<String> where element is a substring to match or null for '*'.

readObjectback to summary
private synchronized void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException

Hides java.security.BasicPermission.readObject.

readObject is called to restore the state of this permission from a stream.

Parameters
s:ObjectInputStream

Doc from java.security.BasicPermission.readObject.

the ObjectInputStream from which data is read

Exceptions
IOException:

Doc from java.security.BasicPermission.readObject.

if an I/O error occurs

ClassNotFoundException:

Doc from java.security.BasicPermission.readObject.

if a serialized class cannot be loaded

setTransientsback to summary
private void setTransients(int mask)

Called by constructors and when deserialized.

Parameters
mask:int

action mask

writeObjectback to summary
private synchronized void writeObject(ObjectOutputStream s) throws IOException

WriteObject is called to save the state of this permission object to a stream. The actions are serialized, and the superclass takes care of the name.