Package org.osgi.service.cm
Class ConfigurationPermission
- java.lang.Object
-
- java.security.Permission
-
- java.security.BasicPermission
-
- org.osgi.service.cm.ConfigurationPermission
-
- All Implemented Interfaces:
java.io.Serializable
,java.security.Guard
public final class ConfigurationPermission extends java.security.BasicPermission
Indicates a bundle's authority to configure bundles or be updated by Configuration Admin.- Since:
- 1.2
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ATTRIBUTE
Provides permission to set or remove an attribute on the configuration.static java.lang.String
CONFIGURE
Provides permission to create new configurations for other bundles as well as manipulate them.static java.lang.String
TARGET
The permission to be updated, that is, act as a Managed Service or Managed Service Factory.
-
Constructor Summary
Constructors Constructor Description ConfigurationPermission(java.lang.String name, java.lang.String actions)
Create a new ConfigurationPermission.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Determines the equality of twoConfigurationPermission
objects.java.lang.String
getActions()
Returns the canonical string representation of theConfigurationPermission
actions.int
hashCode()
Returns the hash code value for this object.boolean
implies(java.security.Permission p)
Determines if aConfigurationPermission
object "implies" the specified permission.java.security.PermissionCollection
newPermissionCollection()
Returns a newPermissionCollection
object suitable for storingConfigurationPermission
s.
-
-
-
Field Detail
-
CONFIGURE
public static final java.lang.String CONFIGURE
Provides permission to create new configurations for other bundles as well as manipulate them. The action string "configure".- See Also:
- Constant Field Values
-
TARGET
public static final java.lang.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
- See Also:
- Constant Field Values
-
ATTRIBUTE
public static final java.lang.String ATTRIBUTE
Provides permission to set or remove an attribute on the configuration. The action string "attribute".- Since:
- 1.6
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConfigurationPermission
public ConfigurationPermission(java.lang.String name, java.lang.String actions)
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 byFilter
s.actions
- Comma separated list ofCONFIGURE
,TARGET
,ATTRIBUTE
(case insensitive).
-
-
Method Detail
-
implies
public boolean implies(java.security.Permission p)
Determines if aConfigurationPermission
object "implies" the specified permission.- Overrides:
implies
in classjava.security.BasicPermission
- Parameters:
p
- The target permission to check.- Returns:
true
if the specified permission is implied by this object;false
otherwise.
-
equals
public boolean equals(java.lang.Object obj)
Determines the equality of twoConfigurationPermission
objects.Two
ConfigurationPermission
objects are equal.- Overrides:
equals
in classjava.security.BasicPermission
- Parameters:
obj
- The object being compared for equality with this object.- Returns:
true
ifobj
is equivalent to thisConfigurationPermission
;false
otherwise.
-
hashCode
public int hashCode()
Returns the hash code value for this object.- Overrides:
hashCode
in classjava.security.BasicPermission
- Returns:
- Hash code value for this object.
-
getActions
public java.lang.String getActions()
Returns the canonical string representation of theConfigurationPermission
actions.Always returns present
ConfigurationPermission
actions in the following order: "configure", "target", "attribute".- Overrides:
getActions
in classjava.security.BasicPermission
- Returns:
- Canonical string representation of the
ConfigurationPermission
actions.
-
newPermissionCollection
public java.security.PermissionCollection newPermissionCollection()
Returns a newPermissionCollection
object suitable for storingConfigurationPermission
s.- Overrides:
newPermissionCollection
in classjava.security.BasicPermission
- Returns:
- A new
PermissionCollection
object.
-
-