|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.security.Permission
java.security.BasicPermission
com.sun.dtv.resources.ScarceResourcePermission
public final class ScarceResourcePermission
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.
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.
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
ResourceClass.reserve(true, ...)
to be
called (i.e. with the force
argument set to
true
).reserve
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.
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 |
---|
public ScarceResourcePermission(String name, String actions)
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.
name
- The name of the ScarceResourcePermission
.actions
- The actions string.Method Detail |
---|
public String getActions()
force
, reserve
.
For example, if this ScarceResourcePermission
object allows
both reserve
, force
actions, a call to
getActions
will return the string
"force,reserve
".
getActions
in class BasicPermission
|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |