public final class DatagramProtocolPermission extends GCFPermission
DatagramProtocolPermission
consists of a
URI string but no actions list.
The URI string specifies a connection for sending and receiving datagrams. It takes the following form:
datagram://[{host}][:{portrange}]If the
{host}
string is a DNS name, an asterisk may
appear in the leftmost position to indicate a wildcard match
(e.g., "*.sun.com"). The URI string "datagram://*" matches all
"client mode" connections; the string "datagram://" specifies a
"server mode" connection.
The {portrange}
string takes the following form:
portnumber | -portnumber | portnumber-[portnumber]A
{portrange}
specification of the form "N-"
(where N is a port number)
signifies all ports numbered N and above, while a specification of the
form "-N" indicates all ports numbered N and below.DatagramConnection
,
Connector.open(java.lang.String)
,
"javax.microedition.io.UDPDatagramConnection" in MIDP 3.0 SpecificationConstructor and Description |
---|
DatagramProtocolPermission(String uri)
Creates a new
DatagramProtocolPermission with the
specified URI as its name. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Checks two
DatagramProtocolPermission objects for equality. |
String |
getActions()
Returns the canonical string representation of the actions, which
currently is the empty string "", since there are no actions defined
for
DatagramProtocolPermission . |
int |
hashCode()
Returns the hash code value for this object.
|
boolean |
implies(Permission p)
Checks if this
DatagramProtocolPermission object "implies"
the specified permission. |
PermissionCollection |
newPermissionCollection()
Returns a new
PermissionCollection for storing
DatagramProtocolPermission objects. |
getProtocol, getURI
getName, toString
public DatagramProtocolPermission(String uri)
DatagramProtocolPermission
with the
specified URI as its name. The URI string must conform to the
specification given above.uri
- the URI string.IllegalArgumentException
- if uri
is malformed.NullPointerException
- if uri
is null
.Permission.getName()
public boolean implies(Permission p)
DatagramProtocolPermission
object "implies"
the specified permission.
More specifically, this method first ensures that all of the following are true (and returns false if any of them are not):
Then implies
checks each of the following, in order,
and for each returns true if the stated condition is true:
If none of the above are true, implies
returns false.
implies
in class Permission
p
- the permission to check against.public boolean equals(Object obj)
DatagramProtocolPermission
objects for equality.equals
in class Permission
obj
- the object we are testing for equality with this object.true
if obj
is a
DatagramProtocolPermission
and has the same URI string as
this DatagramProtocolPermission
object.Boolean.hashCode()
,
Hashtable
public int hashCode()
hashCode
in class Permission
Object.equals(java.lang.Object)
,
Hashtable
public String getActions()
DatagramProtocolPermission
.getActions
in class Permission
public PermissionCollection newPermissionCollection()
PermissionCollection
for storing
DatagramProtocolPermission
objects.
DatagramProtocolPermission
objects must be stored in a
manner that allows
them to be inserted into the collection in any order, but that also
enables the PermissionCollection
implies method to be
implemented in an efficient (and consistent) manner.
newPermissionCollection
in class Permission
PermissionCollection
suitable for storing
DatagramProtocolPermission
objects.