Package org.osgi.service.cm
Class ConfigurationPermission
java.lang.Object
java.security.Permission
java.security.BasicPermission
org.osgi.service.cm.ConfigurationPermission
- All Implemented Interfaces:
Serializable,Guard
Indicates a bundle's authority to configure bundles or be updated by
Configuration Admin.
- Since:
- 1.2
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final int(package private) intThe actions mask.(package private) static final intprivate static final intprivate StringThe actions in canonical form.static final StringProvides permission to set or remove an attribute on the configuration.static final StringProvides permission to create new configurations for other bundles as well as manipulate them.private static final longParsed name if it includes wildcards: "*"static final StringThe permission to be updated, that is, act as a Managed Service or Managed Service Factory. -
Constructor Summary
ConstructorsConstructorDescriptionConfigurationPermission(String name, int mask) Package private constructor used by ConfigurationPermissionCollection.ConfigurationPermission(String name, String actions) Create a new ConfigurationPermission. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines the equality of twoConfigurationPermissionobjects.Returns the canonical string representation of theConfigurationPermissionactions.inthashCode()Returns the hash code value for this object.booleanDetermines if aConfigurationPermissionobject "implies" the specified permission.(package private) booleanimplies0(ConfigurationPermission requested, int effective) Internal implies method.Returns a newPermissionCollectionobject suitable for storingConfigurationPermissions.private static intparseActions(String actions) Parse action string into action mask.parseSubstring(String name) Parse the name for wildcard processing.private voidreadObject is called to restore the state of this permission from a stream.private voidsetTransients(int mask) Called by constructors and when deserialized.private voidWriteObject is called to save the state of this permission object to a stream.Methods inherited from class java.security.Permission
checkGuard, getName, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
CONFIGURE
Provides permission to create new configurations for other bundles as well as manipulate them. The action string "configure".- See Also:
-
TARGET
The permission to be updated, that is, act as a Managed Service or Managed Service Factory. The action string "target".- Since:
- 1.4
- See Also:
-
ATTRIBUTE
Provides permission to set or remove an attribute on the configuration. The action string "attribute".- Since:
- 1.6
- See Also:
-
ACTION_CONFIGURE
private static final int ACTION_CONFIGURE- See Also:
-
ACTION_TARGET
private static final int ACTION_TARGET- See Also:
-
ACTION_ATTRIBUTE
private static final int ACTION_ATTRIBUTE- See Also:
-
ACTION_ALL
private static final int ACTION_ALL- See Also:
-
ACTION_NONE
static final int ACTION_NONE- See Also:
-
action_mask
transient int action_maskThe actions mask. -
actions
The actions in canonical form. -
substrings
Parsed name if it includes wildcards: "*"
-
-
Constructor Details
-
ConfigurationPermission
Create a new ConfigurationPermission.- Parameters:
name- Name of the permission. Wildcards ('*') are allowed in the name. Duringimplies(Permission), the name is matched to the requested permission using the substring matching rules used byFilters.actions- Comma separated list ofCONFIGURE,TARGET,ATTRIBUTE(case insensitive).
-
ConfigurationPermission
ConfigurationPermission(String name, int mask) Package private constructor used by ConfigurationPermissionCollection.- Parameters:
name- location stringmask- action mask
-
-
Method Details
-
setTransients
private void setTransients(int mask) Called by constructors and when deserialized.- Parameters:
mask- action mask
-
parseActions
Parse action string into action mask.- Parameters:
actions- Action string.- Returns:
- action mask.
-
parseSubstring
Parse the name for wildcard processing.- Parameters:
name- The name of the permission.- Returns:
nullis the name has no wildcards or aList<String>where element is a substring to match or null for'*'.
-
implies
Determines if aConfigurationPermissionobject "implies" the specified permission.- Overrides:
impliesin classBasicPermission- Parameters:
p- The target permission to check.- Returns:
trueif the specified permission is implied by this object;falseotherwise.
-
implies0
Internal implies method. Used by the implies and the permission collection implies methods.- Parameters:
requested- The requested ConfigurationPermission which has already be validated as a proper argument.effective- The effective actions with which to start.- Returns:
trueif the specified permission is implied by this object;falseotherwise.
-
equals
Determines the equality of twoConfigurationPermissionobjects.Two
ConfigurationPermissionobjects are equal.- Overrides:
equalsin classBasicPermission- Parameters:
obj- The object being compared for equality with this object.- Returns:
trueifobjis equivalent to thisConfigurationPermission;falseotherwise.
-
hashCode
public int hashCode()Returns the hash code value for this object.- Overrides:
hashCodein classBasicPermission- Returns:
- Hash code value for this object.
-
getActions
Returns the canonical string representation of theConfigurationPermissionactions.Always returns present
ConfigurationPermissionactions in the following order: "configure", "target", "attribute".- Overrides:
getActionsin classBasicPermission- Returns:
- Canonical string representation of the
ConfigurationPermissionactions.
-
newPermissionCollection
Returns a newPermissionCollectionobject suitable for storingConfigurationPermissions.- Overrides:
newPermissionCollectionin classBasicPermission- Returns:
- A new
PermissionCollectionobject.
-
writeObject
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.- Throws:
IOException
-
readObject
readObject is called to restore the state of this permission from a stream.- Throws:
IOExceptionClassNotFoundException
-