| java.lang.Object com.sun.tck.wma.PropLoader com.sun.tck.wma.mms.MMSMessageConnection
Field Summary | |
protected String | appID Application ID - the parsed ID from the URL. | byte[] | buf Datagram buffer. | protected String | clientHost Datagram host for sending/receiving. | DatagramSocket | dgc Datagram server connection. | protected String | host Machine name - the parsed target address from the URL. | DatagramPacket | mess Datagram envelope for sending or receiving messages. | protected boolean | open The "open" flag indicates when the connection is open. | protected String | phoneNumber Phone number of the message sender. | protected int | portIn Datagram transport for receiving. | protected int | portOut Datagram transport for sending. | protected String | replyToAppID The application ID to which replies should be sent. |
Method Summary | |
public void | close() Closes the connection. | public Message | newMessage(String type) Constructs a new message object of MULTIPART_MESSAGE type.
If this method is called in a sending mode, a new
Message object is requested from the connection. | public Message | newMessage(String type, String addr) Constructs a new MULTIPART_MESSAGE message object with the
desired a destination address.
The destination address addr has the following format:
sms://phone_number:port .
Parameters: type - MULTIPART_MESSAGE is the only type permitted. Parameters: addr - The destination address of the message. | public MessageConnection | openPrim(String name) Opens a connection. | public MessageConnection | openPrimInternal(String name) Opens a connection. | public synchronized Message | receive() Receives the bytes that have been sent over the connection,
constructs a Message object, and returns it. | public void | send(Message msg) Sends an MMS message. |
appID | protected String appID(Code) | | Application ID - the parsed ID from the URL.
|
buf | byte[] buf(Code) | | Datagram buffer.
|
clientHost | protected String clientHost(Code) | | Datagram host for sending/receiving.
|
host | protected String host(Code) | | Machine name - the parsed target address from the URL.
|
open | protected boolean open(Code) | | The "open" flag indicates when the connection is open. When the
connection is closed, subsequent operations throw an exception.
|
phoneNumber | protected String phoneNumber(Code) | | Phone number of the message sender.
|
portIn | protected int portIn(Code) | | Datagram transport for receiving.
|
portOut | protected int portOut(Code) | | Datagram transport for sending.
|
replyToAppID | protected String replyToAppID(Code) | | The application ID to which replies should be sent.
|
MMSMessageConnection | public MMSMessageConnection()(Code) | | Construct a new MMS message connection handler.
|
close | public void close() throws IOException(Code) | | Closes the connection. Reset the connection-is-open flag so methods can
be checked to throws an appropriate exception for operations on a closed
connection.
exception: IOException - if an I/O error occurs. |
newMessage | public Message newMessage(String type)(Code) | | Constructs a new message object of MULTIPART_MESSAGE type.
If this method is called in a sending mode, a new
Message object is requested from the connection. Example:
Message msg = conn.newMessage(MULTIPART_MESSAGE);
The created Message does not have the destination
address set. It must be set by the application before
the message is sent.
If it is called in receiving mode, the Message object does
have its address set. The application can act on the object to extract
the address and message data.
Parameters: type - MULTIPART_MESSAGE is the only type permitted. A new Message object. |
newMessage | public Message newMessage(String type, String addr)(Code) | | Constructs a new MULTIPART_MESSAGE message object with the
desired a destination address.
The destination address addr has the following format:
sms://phone_number:port .
Parameters: type - MULTIPART_MESSAGE is the only type permitted. Parameters: addr - The destination address of the message. A new Message object. |
openPrim | public MessageConnection openPrim(String name) throws IOException(Code) | | Opens a connection. This method is called from
Connector.open() method to obtain the destination address
given in the name parameter.
The format for the name string for this method is:
mms://phone_number:port where the
phone_number: is optional. If the phone_number
parameter is present, the connection is being opened in "client" mode.
This means that messages can be sent. If the parameter is absent, the
connection is being opened in "server" mode. This means that messages
can be sent and received.
The connection is opened to any of the following, low-level transport
mechanisms:
- A datagram Short Message Peer to Peer (SMPP) to a service center.
- A
comm connection to a phone device with AT-commands.
- a native MMS stack.
Parameters: name - the target of the connection this connection throws: IOException - if the connection is closed or unavailable. |
openPrimInternal | public MessageConnection openPrimInternal(String name) throws IOException(Code) | | Opens a connection. This method is called from
Connector.open() method to obtain the destination address
given in the name parameter.
The format for the name string for this method is:
mms://phone_number:appID where the
phone_number: is optional. If the phone_number
parameter is present, the connection is being opened in "client" mode.
This means that messages can be sent. If the parameter is absent, the
connection is being opened in "server" mode. This means that messages
can be sent and received.
The connection is opened to any of the following, low-level transport
mechanisms:
- A datagram Short Message Peer to Peer (SMPP) to a service center.
- A
comm connection to a phone device with AT-commands.
- a native MMS stack.
Parameters: name - the target of the connection this connection throws: IOException - if the connection is closed or unavailable. |
receive | public synchronized Message receive() throws IOException(Code) | | Receives the bytes that have been sent over the connection,
constructs a Message object, and returns it.
If there are no Message s waiting on the connection,
this method will block until a message
is received, or the MessageConnection is closed.
A Message object throws: IOException - if an I/O error occurs. |
send | public void send(Message msg) throws IOException(Code) | | Sends an MMS message.
Parameters: msg - The MMS Message to be sent. exception: ConnectionNotFoundException - if the address is invalid or ifno address is found in the message. exception: IOException - if an I/O error occurs. |
|
|