Java TV(tm) API 1.0

javax.tv.service.selection
Class SelectPermission

java.lang.Object
  |
  +--java.security.Permission
        |
        +--javax.tv.service.selection.SelectPermission
All Implemented Interfaces:
java.security.Guard, java.io.Serializable

public final class SelectPermission
extends java.security.Permission
implements java.io.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.

See Also:
Serialized Form

Constructor Summary
SelectPermission(Locator locator, java.lang.String actions)
          Creates a new SelectPermission object for the specified locator.
SelectPermission(java.lang.String locator, java.lang.String actions)
          Creates a new SelectPermission object for a locator with the given external form.
 
Method Summary
 boolean equals(java.lang.Object other)
          Checks two SelectPermission objects for equality.
 java.lang.String getActions()
          Returns the canonical string representation of the actions.
 int hashCode()
          Returns the hash code value for this object.
 boolean implies(java.security.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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelectPermission

public SelectPermission(Locator locator,
                        java.lang.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(java.lang.String locator,
                        java.lang.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(java.security.Permission p)
Checks if this SelectPermission object "implies" the specified permission. More specifically, this method returns true if:
Overrides:
implies in class java.security.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(java.lang.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.
Overrides:
equals in class java.security.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.

hashCode

public int hashCode()
Returns the hash code value for this object.
Overrides:
hashCode in class java.security.Permission
Returns:
A hash code value for this object.

getActions

public java.lang.String getActions()
Returns the canonical string representation of the actions.
Overrides:
getActions in class java.security.Permission
Returns:
The canonical string representation of the actions.

Java TV(tm) API 1.0

Copyright © 1998 - 2000 Sun Microsystems, Inc.