org.ocap.service
Class ServiceTypePermission

java.lang.Object
  extended by java.security.Permission
      extended by java.security.BasicPermission
          extended by org.ocap.service.ServiceTypePermission
All Implemented Interfaces:
java.io.Serializable, java.security.Guard

public final class ServiceTypePermission
extends java.security.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 java.lang.String BROADCAST
          Indicates an inband broadcast service provided by a content provider.
static java.lang.String MFR
          Indicates an abstract service provided by the Host device manufacturer.
static java.lang.String MSO
          Indicates an abstract service provided by the HFC network provider (i.e., MSO).
 
Constructor Summary
ServiceTypePermission(java.lang.String type, java.lang.String actions)
          Creates a new ServiceTypePermission object with the specified service type name.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Tests two ServiceTypePermission objects for equality.
 java.lang.String getActions()
          Returns the canonical representation of the actions string.
 int hashCode()
          Provides the hash code value of this object.
 boolean implies(java.security.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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MFR

public static final java.lang.String MFR
Indicates an abstract service provided by the Host device manufacturer.

See Also:
Constant Field Values

MSO

public static final java.lang.String MSO
Indicates an abstract service provided by the HFC network provider (i.e., MSO).

See Also:
Constant Field Values

BROADCAST

public static final java.lang.String BROADCAST
Indicates an inband broadcast service provided by a content provider.

See Also:
Constant Field Values
Constructor Detail

ServiceTypePermission

public ServiceTypePermission(java.lang.String type,
                             java.lang.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(java.security.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 java.security.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(java.lang.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 java.security.BasicPermission
    Parameters:
    obj - The object to test for equality.
    Returns:
    true if the two permissions are equal; false otherwise.

    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 java.security.BasicPermission
    Returns:
    The hash code value of this object.

    getActions

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

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