|
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.net.NetworkDevicePermission
public final class NetworkDevicePermission
This class is used for various permissions related to the network device
scarce resources. A NetworkDevicePermission
contains a name
(also referred to as a "target name") and a list of actions.
Supported target name by this specification is
"networkdevice.any
" and allows to define actions on all
types of network devices. The target names defined here are in line with
those used for ScarceResourcePermission
to define actions
on network devices represented by NetworkDevice
.
Consequently, the NetworkDevicePermission
target name domain
starting with "networkdevice.
" is reserved by this
specification for future purposes.
The naming rules also follow those defined in
BasicPermission
from which this class inherits, in particular
the rules concerning the "*
" wildcard.
The actions to be granted are passed to the constructor in a string
containing a list of zero or more comma-separated keywords or filters
(i.e. field and value pairs). The possible filter is "dial
"
and has the following format and meaning:
dial=numberFilter
NetworkDevice.connect()
. This action and filter
value only makes sense for network devices that uses dial ups.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.
numberFilter
is defined to be a
string representing a full or partial phone number that
may include any characters. In addition, an
asterisk may appear by itself, or at the end
of a number, to signify a wildcard match. Please note that although
DTMF-*
is a valid digit for a dial up number, it cannot
be used within this filter mechanism.
During the matching process between numberFilter
and the number requested to be dialed at connection time, the
implementation must ignore any non-digit
characters possibly after having replaced the international access code
"+
" with the corresponding digits and compare the two
resulting string values. Numbers do match and the dial up is granted if
the string values matches.
dial=*
*
dial=0123*
0123*
0123
" to be
dialed.dial=+1-234-*
+1234*
+
" or
the equivalent digits (for example "00
") followed by
"1234
" to be dialed. Note the prefix for international
country code as well as the -
visual separation
character.dial=001234567890
001234567890*
+1234567890
" in countries where "+
" is
equivalent to "00
".dial=+1-234-567-890p12*
+123456789012*
DTMF-1
and
DTMF-2
, then any other digit. This allows accessing specific
services that are behind AVR and are DTMF menu driven.dial=123*,dial=456*
123*
and 456*
123
" or "456
".dial=123*4
dial=12+34
+
" is only allowed as a first character of
a phone number.The canonical representation of dial permission is defined to be the minimal string representation:
The following table lists different examples and their standardized canonical representation:
Permission | Canonical | Description |
"dial=123* " |
"dial=123* " |
Is already minimal. |
"dial=123*,dial=456* " |
"dial=123*,dial=456* " |
Is already minimal. |
"dial=12345*,dial=123* " |
"dial=123* " |
Numbers that comply to the first filter also pass the second filter therefore the canonical representation is actually the second filter. |
The same rule as previously applies also to the imply rule. That is,
given two numberFilters, if one is naturally
included in the second, then the second implies the one. For
example, "123*
" implies "123456789
".
NetworkDevicePermission("networkdevice.any", "dial=+1234*");
Constructor Summary | |
---|---|
NetworkDevicePermission(String name,
String actions)
Creates a new NetworkDevicePermission object with the
specified name and actions. |
Method Summary | |
---|---|
String |
getActions()
Returns the "Canonical string representation" of the actions. |
boolean |
implies(Permission p)
Checks if the NetworkDevicePermission object "implies" the
specified permission. |
Methods inherited from class java.security.BasicPermission |
---|
equals, hashCode, 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 NetworkDevicePermission(String name, String actions)
NetworkDevicePermission
object with the
specified name and actions. A NetworkDevicePermission
contains a name (also referred to as a "target name") and
may require an action list depending
on the target name.
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
public boolean implies(Permission p)
NetworkDevicePermission
object "implies" the
specified permission.
More specifically, this method returns true
if:
p
is an instance of
NetworkDevicePermission
,p
's actions are a proper subset of this object's
actions (refer to the Imply Rules section),
andp
's name is implied by this object's name. For
example, "network.*
" implies
"network.any
".
implies
in class BasicPermission
p
- The permission to check against.
true
if the specified permission is implied by this
object, false
if not.
|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |