Class ConfigurationPermission

java.lang.Object
java.security.Permission
java.security.BasicPermission
org.osgi.service.cm.ConfigurationPermission
All Implemented Interfaces:
Serializable, Guard

public final class ConfigurationPermission extends BasicPermission
Indicates a bundle's authority to configure bundles or be updated by Configuration Admin.
Since:
1.2
See Also:
"ThreadSafe"
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Provides permission to set or remove an attribute on the configuration.
    static final String
    Provides permission to create new configurations for other bundles as well as manipulate them.
    static final String
    The permission to be updated, that is, act as a Managed Service or Managed Service Factory.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new ConfigurationPermission.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Determines the equality of two ConfigurationPermission objects.
    Returns the canonical string representation of the ConfigurationPermission actions.
    int
    Returns the hash code value for this object.
    boolean
    Determines if a ConfigurationPermission object "implies" the specified permission.
    Returns a new PermissionCollection object suitable for storing ConfigurationPermissions.

    Methods inherited from class java.security.Permission

    checkGuard, getName, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • CONFIGURE

      public static final String CONFIGURE
      Provides permission to create new configurations for other bundles as well as manipulate them. The action string "configure".
      See Also:
    • TARGET

      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
      See Also:
    • ATTRIBUTE

      public static final String ATTRIBUTE
      Provides permission to set or remove an attribute on the configuration. The action string "attribute".
      Since:
      1.6
      See Also:
  • Constructor Details

    • ConfigurationPermission

      public ConfigurationPermission(String name, String actions)
      Create a new ConfigurationPermission.
      Parameters:
      name - 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 - Comma separated list of CONFIGURE, TARGET, ATTRIBUTE (case insensitive).
  • Method Details

    • implies

      public boolean implies(Permission p)
      Determines if a ConfigurationPermission object "implies" the specified permission.
      Overrides:
      implies in class 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(Object obj)
      Determines the equality of two ConfigurationPermission objects.

      Two ConfigurationPermission objects are equal.

      Overrides:
      equals in class BasicPermission
      Parameters:
      obj - The object being compared for equality with this object.
      Returns:
      true if obj is equivalent to this ConfigurationPermission; false otherwise.
    • hashCode

      public int hashCode()
      Returns the hash code value for this object.
      Overrides:
      hashCode in class BasicPermission
      Returns:
      Hash code value for this object.
    • getActions

      public String getActions()
      Returns the canonical string representation of the ConfigurationPermission actions.

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

      Overrides:
      getActions in class BasicPermission
      Returns:
      Canonical string representation of the ConfigurationPermission actions.
    • newPermissionCollection

      public PermissionCollection newPermissionCollection()
      Returns a new PermissionCollection object suitable for storing ConfigurationPermissions.
      Overrides:
      newPermissionCollection in class BasicPermission
      Returns:
      A new PermissionCollection object.