|
CLDC 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.security.Permission
javax.microedition.io.GCFPermission
javax.microedition.io.HttpsProtocolPermission
This class represents access rights to connections via the "https"
protocol. A HttpsProtocolPermission
consists of a
URI string but no actions list.
The URI string specifies a data resource accessible via secure http. It takes the following general form:
https://{host}[:{portspec}][{pathname}][?{query}][#{fragment}](See RFCs 2818 and 3986 for more information.) The value of the
{host}
field must be a symbolic hostname,
a literal IPv4 address or a literal IPv6 address,
as specified by
RFC 3986.
If the {host}
string is a DNS name, an asterisk may
appear in the leftmost position to indicate a match of 1 or more
entire domain labels.
Partial domain label matches are not permitted, therefore
"*.sun.com" is valid, but "*sun.com" is not.
An asterisk by itself matches all hosts.
The {portspec}
string takes the following form:
portnumber | -portnumber | portnumber-[portnumber] | "*" | emtpy stringA
{portspec}
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.
A single asterisk in the place of the {portspec}
field matches all ports;
therefore, the URI "https://*:*"
matches
https connections to all hosts on all ports. If the
{portspec}
field is omitted, default port 443 is assumed.
Connector.open(java.lang.String)
,
"javax.microedition.io.HttpsConnection" in MIDP 3.0 SpecificationConstructor Summary | |
HttpsProtocolPermission(String uri)
Creates a new HttpsProtocolPermission with the
specified URI as its name. |
Method Summary | |
boolean |
equals(Object obj)
Checks two HttpsProtocolPermission 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 HttpsProtocolPermission . |
int |
hashCode()
Returns the hash code value for this object. |
boolean |
implies(Permission p)
Checks if this HttpsProtocolPermission object "implies"
the specified permission. |
PermissionCollection |
newPermissionCollection()
Returns a new PermissionCollection for storing
HttpsProtocolPermission objects. |
Methods inherited from class javax.microedition.io.GCFPermission |
getProtocol, getURI |
Methods inherited from class java.security.Permission |
getName, toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public HttpsProtocolPermission(String uri)
HttpsProtocolPermission
with the
specified URI as its name. The URI string must conform to the
specification given above, and is
normalized to facilitate
subsequent comparisons.
uri
- the URI string.
IllegalArgumentException
- if uri
is malformed.
NullPointerException
- if uri
is null
.Permission.getName()
Method Detail |
public boolean implies(Permission p)
HttpsProtocolPermission
object "implies"
the specified permission.
Because the {host}
field of the permission URI may
indicate an individual host by means of either a symbolic hostname
or an IP address,
a thorough evaluation of the implies relation between
two HttpsProtocolPermission
objects requires
the underlying platform to be able to transform symbolic hostnames
into IP addresses (via address lookup) and vice-versa
(via name lookup).
Either service may be unavailable on a given platform.
As a result, the comparison of URI strings from two permissions
can only be best-effort.
For each HttpsProtocolPermission
constructed with
a URI that contains a {host}
field, the implementation
will attempt to determine both the fully-qualified domain name
(the "canonical name") and the IP address(es) of the host.
However, either value may be unknown.
To determine whether this object implies another permission, p, 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:
implies
returns false.
Note that the {pathname}
, {query}
and {fragment}
components are not used when
evaluating the 'implies' relation.
implies
in class Permission
p
- the permission to check against.
public boolean equals(Object obj)
HttpsProtocolPermission
objects for equality.
equals
in class Permission
obj
- the object we are testing for equality with this object.
true
if obj
is a
HttpsProtocolPermission
and has the same URI string as
this HttpsProtocolPermission
object.public int hashCode()
hashCode
in class Permission
public String getActions()
HttpsProtocolPermission
.
getActions
in class Permission
public PermissionCollection newPermissionCollection()
PermissionCollection
for storing
HttpsProtocolPermission
objects.
HttpsProtocolPermission
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
HttpsProtocolPermission
objects.
|
CLDC 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |