Java DTV API 1.3
18-Nov-2009

com.sun.dtv.resources
Class ScarceResourcePermission

java.lang.Object
  extended by java.security.Permission
      extended by java.security.BasicPermission
          extended by com.sun.dtv.resources.ScarceResourcePermission
All Implemented Interfaces:
Serializable, Guard

public final class ScarceResourcePermission
extends BasicPermission

This class is used for various permissions related to scarce resources. A ScarceResourcePermission contains a name that corresponds to the name specific to a given scarce resource and a list of permitted actions.

Name

The naming rules follow those defined in BasicPermission from which this class inherits. Please note the possibility to address all scarce resources at once by using the asterisk by itself.

Every class representing a scarce resource and implementing the ScarceResource interface should, where applicable, define the corresponding permission name. The default rule for permission name is defined to be that of the corresponding java class in lowercase.

Actions

The actions to be granted are passed to the constructor in a string containing a list of zero or more comma-separated list of actions. This specification defines the following keywords and meanings to be supported for every type of scarce resources:

force
Permits the given application to force the reservation of the named resource. Allows ResourceClass.reserve(true, ...) to be called (i.e. with the force argument set to true).
reserve
Permits the given application to reserve the named resource. Allows ResourceClass.reserve to be called.

The actions string is converted to lowercase before processing. Canonical representation of the list of granted actions is defined to be the list of present actions in the alphabetic order.

ResourceClass is defined to be an object of the type represented by the name of the permission (e.g. if name is "networkdevice", then ResourceClass is a class of type NetworkDevice).

Please note that the action force does not imply the action reserve even if the former does not make sense without the later.

See Also:
Serialized Form

Constructor Summary
ScarceResourcePermission(String name, String actions)
          Creates a new ScarceResourcePermission object with the specified name and actions.
 
Method Summary
 String getActions()
          Returns the "Canonical string representation" of the actions.
 
Methods inherited from class java.security.BasicPermission
equals, hashCode, implies, 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
 

Constructor Detail

ScarceResourcePermission

public ScarceResourcePermission(String name,
                                String actions)
Creates a new ScarceResourcePermission object with the specified name and actions. The name is the name of the specialized scarce resource (e.g. "networkdevice" ...) and the actions contains a comma-separated list of the desired actions granted for that scarce resource.

Parameters:
name - The name of the ScarceResourcePermission.
actions - The actions string.
Method Detail

getActions

public String getActions()
Returns the "Canonical string representation" of the actions. That is, this method always returns present actions in the alphabetic order: force, reserve. For example, if this ScarceResourcePermission object allows both reserve, force actions, a call to getActions will return the string "force,reserve".

Overrides:
getActions in class BasicPermission
Returns:
The canonical string representation of the actions.

Java DTV API 1.3
18-Nov-2009

Copyright © 2008-2009 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.

U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited.

DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

Use of this document is subject to license terms.