Oracle Application Server Wireless Java API Reference
B14043-01


oracle.panama.messaging.xms
Interface XMSSimpleSender

All Known Subinterfaces:
XMSSender

public interface XMSSimpleSender

XMSSimpleSender is a light-weight and easy to use XMS messaging client.


Field Summary
static java.lang.String VERSION_NUMBER
          Current version of the XMS API.

 

Method Summary
 void addDeliveryType(java.lang.String deliveryType, java.lang.String returnAddress)
          Add a delivery type to use for sending.
 java.lang.String getStatus(java.lang.String messageID)
          Get current status of the message ID as a String.
 java.lang.String[] getStatus(java.lang.String[] messageIDs)
          Get current status of a set of message IDs.
 java.lang.String[] getSupportedTransports()
          Get names of available transports from the underlying XMS server.
 java.lang.String getVersion()
          Get version of XMS API.
 java.lang.String[] sendMsg(java.lang.String[] recipients, java.lang.String subject, org.w3c.dom.Document message)
          Deprecated. Use sendMsg(String[], String, String, String) instead
 java.lang.String[] sendMsg(java.lang.String[] recipients, java.lang.String subject, java.lang.String message)
          Send the message.
 java.lang.String[] sendMsg(java.lang.String[] recipients, java.lang.String subject, java.lang.String message, java.lang.String contentType)
          Send the message.
 java.lang.String[] sendMsg(java.lang.String[] recipients, java.lang.String subject, java.net.URL messageURL)
          Deprecated. Use sendMsg(String[], String, String, String) instead
 void setProxy(java.lang.String host, int port)
          Set the HTTP proxy to use.
 void setProxy(java.lang.String host, int port, java.lang.String userID, java.lang.String password)
          Set the HTTP proxy to use.

 

Field Detail

VERSION_NUMBER

public static final java.lang.String VERSION_NUMBER
Current version of the XMS API.
See Also:
Constant Field Values

Method Detail

addDeliveryType

public void addDeliveryType(java.lang.String deliveryType,
                            java.lang.String returnAddress)
Add a delivery type to use for sending. This method should be called for each delivery type that XMS should use when sending messages.

Example:

// want to send messages as email or SMS xmsSender = XMSFactory.createXMSSender(); xmsSender.addDeliveryType(DeliveryType.EMAIL.getName(), "someone@oracle.com"); xmsSender.addDeliveryType(DeliveryType.SMS.getName(), "16501112222");
Parameters:
deliveryType - the delivery type is the channel will be used.
returnAddress - address will be used as the return address for all messages of that delivery type.

getStatus

public java.lang.String getStatus(java.lang.String messageID)
                           throws XMSException
Get current status of the message ID as a String. This API only supports English locale Status Message. For other Locale Status message support, use XMSSender#getStatus() instead.
Returns:
a status string like one of the following:
  • "message is delivered to the external gateway."
  • "message is delivered to the device."
  • "intermediate notification."
  • "message has been read."
  • "message has been replied."
  • "message is failed to deliver to the external gateway."
  • "message is failed to deliver to the device."
  • "failed to read the message."
  • "failed to reply to the message."
Throws:
XMSException
See Also:
XMSSender

getStatus

public java.lang.String[] getStatus(java.lang.String[] messageIDs)
                             throws XMSException
Get current status of a set of message IDs. webmethod
Throws:
XMSException

getSupportedTransports

public java.lang.String[] getSupportedTransports()
                                          throws XMSException
Get names of available transports from the underlying XMS server. Use this method to get what kinds of transports the XMS server supports. For example: if the return values are: "SMS","email". You may only send SMS and email messages through this gateway.
Throws:
XMSException

getVersion

public java.lang.String getVersion()
Get version of XMS API.

sendMsg

public java.lang.String[] sendMsg(java.lang.String[] recipients,
                                  java.lang.String subject,
                                  org.w3c.dom.Document message)
                           throws XMSException
Deprecated. Use sendMsg(String[], String, String, String) instead
Send the message.
Parameters:
recipients - List of users to send message to. Each user can either be a Wireless user name or a fully-qualified address such as Email:user@oracle.com. If just a panama user is specified that user is looked up and the message is sent to the 'best' device for that user. If the latter (explicit) form is used then the specified delivery type will be used
subject - subject to use for the message
message - the MobileXML (XHTML+) message to send out, as a DOM Document
Throws:
XMSException

sendMsg

public java.lang.String[] sendMsg(java.lang.String[] recipients,
                                  java.lang.String subject,
                                  java.lang.String message)
                           throws XMSException
Send the message.
Parameters:
recipients - List of users to send message to. Each user can either be a Wireless user name or a fully-qualified address such as Email:user@oracle.com. If just a panama user is specified that user is looked up and the message is sent to the 'best' device for that user. If the latter (explicit) form is used then the specified delivery type will be used
subject - subject to use for the message
message - the MobileXML (XHTML+) message to send out, as a String
Throws:
XMSException

sendMsg

public java.lang.String[] sendMsg(java.lang.String[] recipients,
                                  java.lang.String subject,
                                  java.lang.String message,
                                  java.lang.String contentType)
                           throws XMSException
Send the message.
Parameters:
recipients - List of users to send message to. Each user can either be a Wireless user name or a fully-qualified address such as Email:user@oracle.com. If just a panama user is specified that user is looked up and the message is sent to the 'best' device for that user. If the latter (explicit) form is used then the specified delivery type will be used
subject - subject to use for the message
message - the message to send out, as a String
contentType - the mime-type of the content to send
Throws:
XMSException

sendMsg

public java.lang.String[] sendMsg(java.lang.String[] recipients,
                                  java.lang.String subject,
                                  java.net.URL messageURL)
                           throws XMSException
Deprecated. Use sendMsg(String[], String, String, String) instead
Send the message.
Parameters:
recipients - List of users to send message to. Each user can either be a Wireless user name or a fully-qualified address such as Email:user@oracle.com. If just a panama user is specified that user is looked up and the message is sent to the 'best' device for that user. If the latter (explicit) form is used then the specified delivery type will be used
subject - subject to use for the message
messageURL - the URL to get message contents from.
Throws:
XMSException

setProxy

public void setProxy(java.lang.String host,
                     int port)
Set the HTTP proxy to use. If XMS client machine is inside firewall and XMS Server is outside firewall, user may need to tell XMS client his/her HTTP proxy settings.
DO NOT set proxy if:
- XMS server is on Internet and XMS client machine connects to internet directly
- they both on the same intranet
- local installation
Parameters:
host - host name of proxy For example: proxy.company.com
port - port number of the proxy. For example: 80

setProxy

public void setProxy(java.lang.String host,
                     int port,
                     java.lang.String userID,
                     java.lang.String password)
Set the HTTP proxy to use. If XMS client machine is inside firewall and XMS Server is outside firewall, user may need to tell XMS client his/her HTTP proxy settings.
DO NOT set proxy if:
- XMS server is on Internet and XMS client machine connects to internet directly
- they both on the same intranet
- local installation
Parameters:
host - host name of proxy For example: proxy.company.com
port - port number of the proxy. For example: 80
userID - proxy userID.
password - proxy password

Oracle Application Server Wireless Java API Reference
B14043-01


Copyright © 2004 Oracle Corporation. All Rights Reserved.