javax.tv.service.selection
Class SelectPermission

java.lang.Object
  extended by java.security.Permission
      extended by javax.tv.service.selection.SelectPermission
All Implemented Interfaces:
Serializable, Guard

public final class SelectPermission
extends Permission
implements Serializable

SelectPermission represents permission to perform a select() operation on a ServiceContext. A caller might have permission to select some content but not others.

The actions string is either "own" or "*". The string "own" means the permission applies to your own service context, acquired via ServiceContextFactory.createServiceContext() or ServiceContextFactory.getServiceContext(javax.tv.xlet.XletContext). The string "*" implies permission to these, plus permission for service contexts obtained from all other sources.

Note that undefined actions strings may be provided to the constructors of this class, but subsequent calls to SecurityManager.checkPermission() with the resulting SelectPermission object will fail.

Version:
1.20, 10/09/00
Author:
Bill Foote
See Also:
Serialized Form

Constructor Summary
SelectPermission(Locator locator, String actions)
          Creates a new SelectPermission object for the specified locator.
SelectPermission(String locator, String actions)
          Creates a new SelectPermission object for a locator with the given external form.
 
Method Summary
 boolean equals(Object other)
          Checks two SelectPermission objects for equality.
 String getActions()
          Returns the canonical string representation of the actions.
 int hashCode()
          Returns the hash code value for this object.
 boolean implies(Permission p)
          Checks if this SelectPermission object "implies" the specified permission.
 
Methods inherited from class java.security.Permission
checkGuard, getName, newPermissionCollection, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelectPermission

public SelectPermission(Locator locator,
                        String actions)
Creates a new SelectPermission object for the specified locator.

Parameters:
locator - The locator. A value of null indicates permission for all locators.
actions - The actions string, as detailed in the class description.

SelectPermission

public SelectPermission(String locator,
                        String actions)
Creates a new SelectPermission object for a locator with the given external form. This constructor exists for use by the Policy object to instantiate new Permission objects.

Parameters:
locator - The external form of the locator. The string "*" indicates all locators.
actions - The actions string, as detailed in the class description.
Method Detail

implies

public boolean implies(Permission p)
Checks if this SelectPermission object "implies" the specified permission. More specifically, this method returns true if:

Specified by:
implies in class Permission
Parameters:
p - The permission against which to check.
Returns:
true if the specified permission is implied by this object, false if not.

equals

public boolean equals(Object other)
Checks two SelectPermission objects for equality. Tests that the given object is a SelectPermission and has the same Locator and actions string as this object.

Specified by:
equals in class Permission
Parameters:
other - The object to test for equality.
Returns:
true if other is a SelectPermission and has the same locator and actions string as this SelectPermission object; false otherwise.
See Also:
Object.hashCode(), Hashtable

hashCode

public int hashCode()
Returns the hash code value for this object.

Specified by:
hashCode in class Permission
Returns:
A hash code value for this object.
See Also:
Object.equals(java.lang.Object), Hashtable

getActions

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

Specified by:
getActions in class Permission
Returns:
The canonical string representation of the actions.