Java Doc for MMSMessageConnection.java in  » 6.0-JDK-Modules » j2me » com » sun » tck » wma » mms » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.tck.wma.mms 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.tck.wma.PropLoader
      com.sun.tck.wma.mms.MMSMessageConnection

MMSMessageConnection
public class MMSMessageConnection extends PropLoader implements MessageConnection(Code)
MMS message connection handler.


Field Summary
protected  StringappID
     Application ID - the parsed ID from the URL.
 byte[]buf
     Datagram buffer.
protected  StringclientHost
     Datagram host for sending/receiving.
 DatagramSocketdgc
     Datagram server connection.
protected  Stringhost
     Machine name - the parsed target address from the URL.
 DatagramPacketmess
     Datagram envelope for sending or receiving messages.
protected  booleanopen
     The "open" flag indicates when the connection is open.
protected  StringphoneNumber
     Phone number of the message sender.
protected  intportIn
     Datagram transport for receiving.
protected  intportOut
     Datagram transport for sending.
protected  StringreplyToAppID
     The application ID to which replies should be sent.

Constructor Summary
public  MMSMessageConnection()
     Construct a new MMS message connection handler.

Method Summary
public  voidclose()
     Closes the connection.
public  MessagenewMessage(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  MessagenewMessage(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  MessageConnectionopenPrim(String name)
     Opens a connection.
public  MessageConnectionopenPrimInternal(String name)
     Opens a connection.
public synchronized  Messagereceive()
     Receives the bytes that have been sent over the connection, constructs a Message object, and returns it.
public  voidsend(Message msg)
     Sends an MMS message.

Field Detail
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.



dgc
DatagramSocket dgc(Code)
Datagram server connection.



host
protected String host(Code)
Machine name - the parsed target address from the URL.



mess
DatagramPacket mess(Code)
Datagram envelope for sending or receiving messages.



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.




Constructor Detail
MMSMessageConnection
public MMSMessageConnection()(Code)
Construct a new MMS message connection handler.




Method Detail
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 Messages 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.



Methods inherited from com.sun.tck.wma.PropLoader
protected int getIntProp(int valDefault, String envVar, String propsName, String propVar)(Code)(Java Doc)
protected String getProp(String valDefault, String envVar, String propsName, String propVar)(Code)(Java Doc)

Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.