ServiceTypePermission

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ocap.service
Class ServiceTypePermission

    java.lang.Object
      java.security.Permission
          java.security.BasicPermission
              org.ocap.service.ServiceTypePermission

All Implemented Interfaces:
  Serializable, Guard

    public final class ServiceTypePermission

extends BasicPermission

`ServiceTypePermission` represents application permission to select a specific service type using a `ServiceContext` accessible by the application.

When this permission is evaluated, the `SecurityManager.checkPermission` method must not fail when checking for `SelectPermission` on the accessed `ServiceContext`. Otherwise, the security manager check for this permission will also fail.

Note that undefined service type strings may be provided to the constructor of this class, but subsequent calls to `SecurityManager.checkPermission()` with the resulting `ServiceTypePermission` object will fail.

See Also:
  Serialized Form

Field Summary
`static String` | `BROADCAST` Indicates an inband broadcast service provided by a content provider.
`static String` | `MFR` Indicates an abstract service provided by the Host device manufacturer.
`static String` | `MSO` Indicates an abstract service provided by the HFC network provider (i.e., MSO).

Constructor Summary
`ServiceTypePermission(String type, String actions)` Creates a new ServiceTypePermission object with the specified service type name.

Method Summary
`boolean` | `equals(Object obj)` Tests two `ServiceTypePermission` objects for equality.
`String` | `getActions()` Returns the canonical representation of the actions string.
`int` | `hashCode()` Provides the hash code value of this object.
`boolean` | `implies(Permission p)` Checks if the specified permission is "implied" by this object.

Methods inherited from class java.security.BasicPermission
`newPermissionCollection`

Methods inherited from class java.security.Permission
`checkGuard, getName, toString`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### MFR

    public static final String MFR

  Indicates an abstract service provided by the Host device manufacturer.

  See Also:
    Constant Field Values

### MSO

    public static final String MSO

  Indicates an abstract service provided by the HFC network provider (i.e., MSO).

  See Also:
    Constant Field Values

### BROADCAST

    public static final String BROADCAST

  Indicates an inband broadcast service provided by a content provider.

  See Also:
    Constant Field Values

Constructor Detail

### ServiceTypePermission

    public ServiceTypePermission(String type,
                                 String actions)

  Creates a new ServiceTypePermission object with the specified service type name.

  Parameters:
    `type` - The name of the service type that can be selected. Supported service types include "abstract.manufacturer", "abstract.mso", and "broadcast". An asterisk may be used to signify a wildcard match.
    `actions` - The actions String is either "own" or "*". The string "own" means the permission applies to your own service context, acquired via the `ServiceContextFactory.createServiceContext` or `ServiceContextFactory.getServiceContext` methods. The string "*" implies permission to these, plus permission for service contexts obtained from all other sources.

Method Detail

### implies

    public boolean implies(Permission p)

  Checks if the specified permission is "implied" by this object.

  Specifically, implies(Permission p) returns true if:

  - p is an instance of ServiceTypePermission and
  - p's action string matches this object's, or this object or p has "*" as an action string, and
  - p's type string matches this object's, or this object has "*" as a type string.

    In addition, implies(Permission p) returns true if:

  - p is an instance of SelectPermission and,
  - p's locator contains an actual or implied source_id value which corresponds to the type string in this object where [26] ISO/IEC 13818-1 defines broadcast source_id values that correspond to a broadcast type string and table 11-4 defines abstract service values that correspond to abstract MSO and abstract manufacturer type strings.
  - p’s action string matches this object’s, or this object has "*" as an action string.

  Overrides:
    `implies` in class `BasicPermission`
  Parameters:
    `p` - The permission against which to test.
  Returns:
    `true` if the specified permission is equal to or implied by this permission; `false` otherwise.

### equals

    public boolean equals(Object obj)

  Tests two `ServiceTypePermission` objects for equality. Returns `true` if and only if `obj`'s class is the same as the class of this object, and `obj` has the same name and actions string as this object.

  Overrides:
    `equals` in class `BasicPermission`
  Parameters:
    `obj` - The object to test for equality.
  Returns:
    `true` if the two permissions are equal; `false` otherwise.
  See Also:
    `Object.hashCode()`, `Hashtable`

### hashCode

    public int hashCode()

  Provides the hash code value of this object. Two `ServiceTypePermission` objects that are equal will return the same hash code.

  Overrides:
    `hashCode` in class `BasicPermission`
  Returns:
    The hash code value of this object.
  See Also:
    `Object.equals(java.lang.Object)`, `Hashtable`

### getActions

    public String getActions()

  Returns the canonical representation of the actions string.

  Overrides:
    `getActions` in class `BasicPermission`
  Returns:
    The actions string of this permission.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD