See: Description
Interface | Description |
---|---|
AccessPointListener |
AccessPointListener is notified for AccessPoint state changes.
|
CommConnection |
This interface defines a logical serial port connection.
|
Connection |
This is the most basic type of generic connection.
|
ContentConnection |
This interface defines the stream connection over which
content is passed.
|
Datagram |
This interface defines an abstraction for datagram packets.
|
DatagramConnection |
This interface defines the capabilities that a datagram connection
must have.
|
HttpConnection |
This interface defines the necessary methods and constants
for an HTTP connection.
|
HttpsConnection |
This interface defines the necessary methods
and constants to establish a secure network connection.
|
InputConnection |
This interface defines the capabilities that an input stream
connection must have.
|
ModemConnection |
Abstraction of a modem interface which allows to monitor and control the
signal lines on a serial interface.
|
ModemListener |
Listener that is notified on changes to a control line of a
ModemConnection . |
OutputConnection |
This interface defines the capabilities that an output
stream connection must have.
|
SecureConnection |
This interface defines the secure socket stream connection.
|
SecureDatagramConnection |
This interface defines the secure datagram connection.
|
SecureServerConnection |
This interface defines the secure server socket connection.
|
SecurityInfo |
This interface defines methods
to access information about a secure network connection.
|
ServerSocketConnection |
This interface defines the server socket stream connection.
|
SocketConnection |
This interface defines the socket stream connection.
|
StreamConnection |
This interface defines the capabilities that a stream connection
must have.
|
StreamConnectionNotifier |
This interface defines the capabilities that a connection notifier
must have.
|
UDPDatagramConnection |
This interface defines a datagram connection which knows
it's local end point address.
|
UDPMulticastConnection |
UDPMulticastConnection defines a multicast datagram connection bound to an IP
multicast host group.
|
Class | Description |
---|---|
AccessPoint |
AccessPoint is a configuration of a TCP/IP network interface.
|
AccessPointPermission |
AccessPointPermission allows access to sensitive AccessPoint functions.
|
CommProtocolPermission |
This class represents access rights to connections via the "comm" protocol.
|
ConnectionOption<T> |
This parameterized class holds connection specific configuration settings of arbitrary types.
|
Connector |
This class is a factory for creating new Connection objects.
|
DatagramProtocolPermission |
This class represents access rights to connections via the "datagram"
protocol.
|
DTLSProtocolPermission |
This class represents access rights to connections via the "dtls"
protocol.
|
FileProtocolPermission |
This class represents access rights to connections via the "file"
protocol.
|
GCFPermission |
An abstract class that is the superclass of all permissions used
with the Generic Connection Framework.
|
HttpProtocolPermission |
This class represents access rights to connections via the "http"
protocol.
|
HttpsProtocolPermission |
This class represents access rights to connections via the "https"
protocol.
|
MulticastProtocolPermission |
This class represents access rights to connections via the "multicast"
protocol.
|
NetworkInterface |
NetworkInterface represents the network connection point for AccessPoints.
|
NetworkUtilities |
This class provides utility functions for name lookup,
reverse name lookup and for testing the reachability of a host (ping).
|
SocketProtocolPermission |
This class represents access rights to connections via the "socket"
protocol.
|
SSLProtocolPermission |
This class represents access rights to connections via the "ssl"
protocol.
|
Exception | Description |
---|---|
ConnectionNotFoundException |
This class is used to signal that a connection target
cannot be found, or the protocol type is not supported.
|
{scheme}:[{hier-part}][?{query}][#{fragment}]
.
Please see the Connector
class for more information.
For each protocol scheme implemented the respective
GCF security checks MUST be implemented.
GCF defines a set of protocols, which can be included by a Configuration or Profile. Each of these protocols is optional, unless otherwise specified. Implementations may define additional proprietary protocol schemes to offer additional protocols.
In general these protocol schemes are independent from each other and they can be implemented separately. The following exception to this rule apply:
file://[{host}]{abs_path}
"
MUST return
an InputConnection
(for READ
mode),
an OutputConnection
(for WRITE
mode) or
a StreamConnection
(for READ_WRITE
mode).
The file URL MUST support
(
RFC 2396 Uniform Resource Identifiers (URI): Generic Syntax)
and
RFC 1738 Uniform Resource Locators (URL).
All three modes READ
, WRITE
and READ_WRITE
MUST be supported.
datagram://[{host}]:[{port}]
" MUST return a
UDPDatagramConnection
.
dtls://{host}:{port}
" MUST return a
SecureDatagramConnection
.
multicast://[{host}]:[{port}]
" MUST return a
UDPMulticastConnection
.
If the protocol "multicast:" is implemented
then the protocol "datagram:" must also be implemented.
socket://{host}:{port}
" MUST
return a SocketConnection
.
socket://
" | "socket://:{port}
"
MUST return a ServerSocketConnection
.
ssl://{host}:{port}
" MUST
return a SecureConnection
.
ssl://
" | "ssl://:{port}
"
return a SecureServerConnection
.
http://{host}/{path}
"
MUST return a HttpConnection
.
https://{host}/{path}
"
MUST return a HttpsConnection
.
comm:
"
MUST return a CommConnection
.Connector.open
MUST return a
ModemConnection
instead.
The exact syntax of the protocol schemes is defined in the individual protocol class.
For the protocols above, the {host}
parameter can be a host name,
such as "www.jcp.org", or a string representing its IPV4 or IPV6 literal address,
such as "206.26.48.100" or "[1080:0:0:0:8:800:200C:4171]".
A literal IPv4 address is specified by the IPv4address
rule of
RFC 3986.
A literal IPv6 address is an IP-literal
as defined
by RFC 3986,
which requires to surround the IPv6Address
with square brackets ('[', ']').
IPvFuture
addresses from RFC 3986 are not supported.
Access to each protocol via the methods of
javax.microedition.io.Connector
is
controlled by per protocol subclasses of
GCFPermission
and
by host and port security checks in java.lang.SecurityManager
or
java.security.AccessController
as appropriate for the platform.
Access is permitted if the check succeeds for either the per protocol permission or check succeeds for the host and port. If either check succeeds then the other check does not need to be performed.
Operating system access controls that prevent access to resources SHOULD be reported by throwing @{code java.io.IOException} with an informative message and MUST NOT throw @{code java.lang.SecurityExcecption}.
For a given protocol scheme, a corresponding security permission,
{Scheme}ProtocolPermission
,
must be checked either by java.lang.SecurityManager
or
java.security.AccessController
.
The table below provides the permission corresponding to the
original URL request.
Protocol/Function | URI Form and Function | AccessController.checkPermission |
TCP/IP Client Socket | socket://{host}:{port} |
SocketProtocolPermission("socket://{host}:{port}") |
TCP/IP Server Socket | socket://:{port} (open)socket://{host}:{port}
(acceptAndOpen ) |
SocketProtocolPermission("socket://:{port}") SocketProtocolPermission("socket://{host}:{port}") |
HTTP 1.1 | http://{host}[{path}] http://{host}:{port}[{path}] |
HttpProtocolPermission("http://{host}[{path}]") |
HTTPS | https://{host}[{path}] http://{host}:{port}[{path}] |
HttpsProtocolPermission("https://{host}[{path}"] |
Secure Socket | ssl://{host}:{port} |
SSLProtocolPermission("ssl://{host}:{port}") |
Secure Server Socket | ssl://:{port} |
SSLProtocolPermission("ssl://:{port}") |
File I/O | file://{abs_path} (mode READ)file://{abs_path} (mode WRITE)file://{abs_path} (mode READ_WRITE) |
FileProtocolPermission("file://{abs_path}", "READ") |
Datagram Socket | datagram://:{port} (open)datagram://{host}:{port} (open)datagram://{host}:{port} (send and
receive ) |
DatagramProtocolPermission("datagram://:{port}") |
Secure Datagram Socket | dtls://{host}:{port} (open)dtls://{host}:{port} (send and
receive ) |
DTLSProtocolPermission("dtls://{host}:{port}") |
Multicast Datagram Socket | multicast://:{port} (open)multicast://{host}:{port} (open)multicast://{host}:{port} (send and
receive ,
join and
leave ) |
MulticastProtocolPermission("multicast://:{port}") |
NetworkUtilities | N/A |
SocketProtocolPermission("socket://{host}:*") |
Serial Ports | comm://{portid}[{params}] |
CommProtocolPermission("comm://{portid}[{params}]") |
Access to network hosts and ports and files can be permitted
via the resource based checks of the SecurityManager
.
For each protocol the following SecurityManager
checks
permit access:
Protocol/Function | URI Form and Function | SecurityManager Check |
TCP/IP Client Socket | socket://{host}:{port} |
checkConnect({host}, {port}) |
TCP/IP Server Socket | socket://:{port} (open)Check the incoming host and port before returning from acceptAndOpen |
checkListen({port}) checkAccept({host}, {port}) |
HTTP 1.1 | http://{host}[{path}] http://{host}:{port}[{path}] |
checkConnect({host}, 80) checkConnect({host}, {port}) |
HTTPS | https://{host}[{path}] https://{host}:{port}[{path}] |
checkConnect({host}, 443) checkConnect({host}, {port}) |
Secure Socket | ssl://{host}:{port} |
checkConnect({host}, {port}) |
Secure Server Socket | ssl://:{port} (open)Check the incoming host and port before returning from acceptAndOpen |
checkListen({port}) checkAccept({host}, {port}) |
File I/O | file://{abs_path} (mode READ)file://{abs_path} (mode WRITE)file://{abs_path} (mode READ_WRITE) |
checkRead({abs_path}) checkWrite({abs_path}) checkRead({abs_path}) and checkWrite({abs_path}) |
Datagram Socket | datagram://{host}:{port} (open)datagram://:{port} (open)datagram://{host}:{port} (send )datagram://{host}:{port} (receive ) |
checkListen(0) checkListen({port}) checkConnect({host}, {port}) checkAccept({host}, {port}) |
Secure Datagram Socket | dtls://{host}:{port} (open)dtls://{host}:{port} (send )dtls://{host}:{port} (receive ) |
checkListen(0) checkConnect({host}, {port}) checkAccept({host}, {port}) |
Multicast Datagram Socket | multicast://{host}:{port} (open)multicast://:{port} (open)multicast://{host}:{port} (send )multicast://{host}:{port} (receive )multicast://{host}:{port} (join )multicast://{host}:{port} (leave ) |
checkListen(0) checkListen({port}) checkConnect({host}, {port}) checkAccept({host}, {port}) checkAccept({host}, {port}) checkAccept({host}, {port}) |
Network Utilities | N/A | checkConnect({host}, -1) |
Serial Ports | N/A | The only SecurityManager check applicable to the comm protocol
is SecurityManager.checkPermission(CommProtocolPermission). |
The Generic Connection Framework may be extended through the definition of
additional protocol schemes.
A specification that extends the Generic Connection Framework should define
both the connection type and
GCFPermission
subclass
associated with the new protocol in a package unique to the specification.
Each StreamConnection
has one underlying InputStream and one OutputStream.
Also each InputConnection
and OutputConnection
has only one underlying stream instance.
Opening a DataInputStream
counts as opening the
InputStream
and opening a
DataOutputStream
counts as opening the
OutputStream
.
Each stream may be opened multiple times using the methods of
InputConnection
, OutputConnection
and
StreamConnection
.
The stream returned from each call MUST behave as if there was only a single stream.
Trying to open
InputStream
or OutputStream
again
from a StreamConnection
MUST NOT cause any exception.
Applications should match each call to open
a stream
with a call to close
the stream in order to free resources
used by the stream.
The methods of StreamConnection and any of its streams are not synchronized.
The only stream method that can be called safely in another thread is close
.
When the close
method is invoked on a stream that is executing in another thread,
any pending I/O method MUST throw an InterruptedIOException
.
In the above case implementations SHOULD try to throw the exception in a timely manner.
When all open streams have been closed, and when the Connection
is closed,
any pending I/O operations MUST be interrupted in a timely manner.
After calling the close
method, regardless of open
streams, further method calls to the connection will result in an
IOException
for those methods that are declared to
throw IOException
.
For the methods that do not throw exceptions, unknown
results may be returned.
Copyright (c) 2014, Oracle and/or its affiliates. All Rights Reserved. Use of this specification is subject to license terms.