|
CDC 1.1.2 | ||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
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 class defines an abstract interface for datagram packets. |
DatagramConnection | This interface defines the capabilities that a datagram connection must have. |
InputConnection | This interface defines the capabilities that an input stream connection must have. |
OutputConnection | This interface defines the capabilities that an output stream connection must have. |
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. |
Class Summary | |
Connector | This class is a factory for creating new Connection objects. |
Exception Summary | |
ConnectionNotFoundException | This class is used to signal that a connection target cannot be found, or the protocol type is not supported. |
Provides a simplified mechanism for applications to use various types of I/O
protocols in resource-constrained environments. I/O is performed by means of
Connections obtained through the Connector factory class. Connections are
dynamically created based on URIs of the form: {scheme}:[{target}][{params}]
Please see the Connector class for more information.
The Generic Connection Framework of CDC must behave as defined
below for the following protocols: 1. File URLs as defined by RFC 1738 (http://www.w3.org/Addressing/rfc1738.txt) of the form "file://{path}" must return an object that implements either javax.microedition.io.InputConnection (for "read" mode), javax.microedition.io.OutputConnection (for "write" mode) or javax.microedition.io.StreamConnection (for "read/write" mode). At least the "read" mode must be supported by the implementation. 2. Datagram Socket as defined by javax.microedition.io.UDPDatagramConnection with the format "datagram://[{host}]:{port}" must return an object with behavior that follows the javax.microedition.io.UDPDatagramConnection interface specification which extends the javax.microedition.io.DatagramConnection interface. 3. Communication Port The implementation of the GCF CommConnection interface is optional, as it has a dependency on a serial connection of the device and it is up to the device manufacturer whether to include it or not.
{host}
parameter can either
be a machine name, such as "www.jcp.org", or a string representing
its IP address, such as "206.26.48.100".
The following connection protocols must be supported for CDC/Foundation Profile (only when Foundation Profile is present):
The Generic Connection Framework of Foundation Profile must behave
as defined below for the following protocols: 1. All protocols as defined by the CDC specification regarding the
Generic Connection Framework. 2. TCP/IP Client Socket. URIs of the form"socket://{host}:{port}"
must return an object with behavior that follows thejavax.microedition.io.StreamConnection
interface specification. The streams provided by this connection are functionally equivalent to the streams provided by thejava.net.Socket
class when theSocket(String, int)
constructor is used and no socket options are set. TCP/IP Server Socket. URIs of the form"socket:// | socket://:{port}"
must return an object with behavior that follows thejavax.microedition.io.StreamConnectionNotifier
interface specification. The streams provided by this connection are functionally equivalent to the streams provided by thejava.net.Socket
class returned by thejava.net.ServerSocket.accept()
method when the ServerSocket(int) constructor is used to create the ServerSocket instance. 3. HTTP as defined by the Mobile Information Device Profile (MIDP)
javax.microedition.io.HttpConnection interface with the format
that follows the MIDP javax.microedition.io.HttpConnection URL
specification and must return an object with behavior that follows
the javax.microedition.io.HttpConnection interface specification.
The implementation of the following MIDP interfaces are optional, as they
have a dependency on SSL protocol.
If either one or the other of SecureConnection or HttpsConnection
is implemented, or if the Java Secure Socket Extension (JSSE) part
of the Java ME Security Optional Package is present, both of these
two specific interfaces (SecureConnection and HttpsConnection) must
be implemented as well.
{host}
parameter can either be a machine name, such as "www.jcp.org", or a string representing its IP address, such as "206.26.48.100".
Generic Connection Framework (GCF) Security Checks (for CDC)
Access to connections of the required protocol types via the methods of javax.microedition.io.Connector
is governed by certain java.lang.SecurityManager
checks, as described below for CDC:
Protocol | URI Form | Security Check |
File I/O | file://{path} (reading)file://{path} (writing) |
checkRead({path}) checkWrite({path}) |
Datagram Socket | datagram://{host}:{port} datagram://:{port} |
checkListen(0) checkListen({port}) |
The methods javax.microedition.io.InputConnection.openDataInputStream()
and javax.microedition.io.InputConnection.openInputStream()
result in security checks, as described below:
Protocol | URI Form | Security Check |
File Input | file://{path} |
checkRead({path}) |
The methods javax.microedition.io.OutputConnection.openDataOutputStream()
and javax.microedition.io.OutputConnection.openOutputStream()
result in security checks, as described below:
Protocol | URI Form | Security Check |
File Output | file://{path} |
checkWrite({path}) |
Generic Connection Framework (GCF) Security Checks (for CDC/Foundation Profile)
Access to connections of the required protocol types via the methods of javax.microedition.io.Connector
is governed by certain java.lang.SecurityManager
checks, as described below for CDC/Foundation Profile (only when Foundation Profile is present):
Protocol | URI Form | Security Check |
TCP/IP Client Socket | socket://{host}:{port} |
checkConnect({host}, {port}) |
TCP/IP Server Socket | socket://:{port} |
checkListen({port}) |
HTTP 1.1 | http://{host}[{path}] http://{host}:{port}[{path}] |
checkConnect({host}, 80) checkConnect({host}, {port}) |
HTTPS | https://{host}[{path}] http://{host}:{port}[{path}] |
checkConnect({host}, 443) checkConnect({host}, {port}) |
Secure Socket | ssl://{host}:{port} |
checkConnect({host}, {port}) |
File I/O | file://{path} (reading)file://{path} (writing) |
checkRead({path}) checkWrite({path}) |
Datagram Socket | datagram://{host}:{port} datagram://:{port} |
checkListen(0) checkListen({port}) |
The methods javax.microedition.io.InputConnection.openDataInputStream()
and javax.microedition.io.InputConnection.openInputStream()
result in security checks, as described below:
Protocol | URI Form | Security Check |
HTTP 1.1 | http://{host}[{path}] http://{host}:{port}[{path}] |
checkConnect({host}, 80) checkConnect({host}, {port}) |
HTTPS | https://{host}[{path}] http://{host}:{port}[{path}] |
checkConnect({host}, 443) checkConnect({host}, {port}) |
Secure Socket | ssl://{host}:{port} |
checkConnect({host}, {port}) |
File Input | file://{path} |
checkRead({path}) |
The methods javax.microedition.io.OutputConnection.openDataOutputStream()
and javax.microedition.io.OutputConnection.openOutputStream()
result in security checks, as described below:
Protocol | URI Form | Security Check |
HTTP 1.1 | http://{host}[{path}] http://{host}:{port}[{path}] |
checkConnect({host}, 80) checkConnect({host}, {port}) |
HTTPS | https://{host}[{path}] http://{host}:{port}[{path}] |
checkConnect({host}, 443) checkConnect({host}, {port}) |
Secure Socket | ssl://{host}:{port} |
checkConnect({host}, {port}) |
File Output | file://{path} |
checkWrite({path}) |
Opening a DataInputStream
counts as opening an
InputStream
and opening a
DataOutputStream
counts as opening an
OutputStream
.
In Foundation Profile, multiple streams may be opened by one
StreamConnection
. Trying to open another
InputStream
or another OutputStream
from a StreamConnection
must not cause any exception.
Trying to open InputStream
or
OutputStream
after they have been closed
causes an IOException
.
After calling the close
method, regardless of open
streams, further method calls to connection will result in
IOExceptions
for those methods that are declared to
throw IOExceptions
.
For the methods that do not throw exceptions, unknown
results may be returned.
|
CDC 1.1.2 | ||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |