C H A P T E R 8 |
Messaging API |
This chapter describes the Sun Java System Content Delivery Server Messaging API. The Messaging API provides a mechanism for carriers or application vendors to integrate their WAP, SMS, and MMS push implementations with Content Delivery Server by creating a push adapter. The Messaging API is used to create both push sender adapters and push listener adapters.
The following figure illustrates the high-level architecture of the Messaging API and the different components that use this API.
FIGURE 8-1 Architecture of the Messaging API
An external push system can interact or receive push messages from Content Delivery Server.
For information on classes and methods, see the HTML output of the Javadoc tool for the Messaging API at $CDS_HOME/javadoc/cdsapi/index.html.
The PushMsgSender interface declares the methods needed for a push message sender implementation. This interface is called by the Content Delivery Server Messaging Service when Content Delivery Server sends a push message. Implement this interface and all methods. For additional information, see the HTML output of the Javadoc tool for the Messaging API at $CDS_HOME/javadoc/cdsapi/index.html.
The PushMsgListener interface declares the methods needed for a push message listener implementation. Implement this interface and all methods. For additional information, see the HTML output of the Javadoc tool for the Messaging API at $CDS_HOME/javadoc/cdsapi/index.html.
PushMessage is the base class for all of the different types of push messages generated by Content Delivery Server. The MMSPushMessage class used for MMS messages extends the PushMessage class.
All of the set methods are used by Content Delivery Server during message construction. All of the get methods can be used by a sender’s implementation of a push message.
The SMSMessage class is deprecated. The following methods are now part of PushMessage class:
To get and set the content name or download URL, use the getAttribute and setAttribute methods in the PushMessage class with the appropriate constant defined in PushConstants. See the output of the Javadoc tool for these classes at $CDS_HOME/javadoc/cdsapi/index.html for more information.
The WapPushMessage class is deprecated. To get and set the download URL, use the getAttribute and setAttribute methods in the PushMessage class with the appropriate constant defined in PushConstants. See the output of the Javadoc tool for these classes at $CDS_HOME/javadoc/cdsapi/index.html for more information.
The SMTPMessage class is deprecated. To get and set the subject or message’s From address, use the getAttribute and setAttribute methods in the PushMessage class with the appropriate constant defined in PushConstants. See the output of the Javadoc tool for these classes at $CDS_HOME/javadoc/cdsapi/index.html for more information.
The ContentSlide class stores the binary data from the MMS push message. The binary data can have a MIME type and a unique ID associated with it. All of the set methods are used by the server during message construction. All the get methods can be used by an implementation of a push message. See the output of the Javadoc tool for these classes at $CDS_HOME/javadoc/cdsapi/index.html for more information.
The MMSSlide class is a wrapper for ContentSlide objects and is used to construct MMS push messages. All of the set methods are used by Content Delivery Server during message construction. All the get methods can be used by an implementation of a push message. See the output of the Javadoc tool for these classes at $CDS_HOME/javadoc/cdsapi/index.html for more information.
The MMSPushMessage class extends PushMessage and represents an MMS push message. All of the set methods are used by Content Delivery Server during message construction. All of the get methods can be used by an implementation of a push message. This class contains the From address, the To addresses, MMSC-related data, the user agent, and any Synchronized Multimedia Integration Language (SMIL) data, if available. It also encapsulates the MMSSlide object. See the output of the Javadoc tool for these classes at $CDS_HOME/javadoc/cdsapi/index.html for more information.
The MMSSender interface declares the method that sends an MMS message. This interface must be implemented for the vendor-specific MMSC during integration if you want to support MMS messages. See the output of the Javadoc tool for these classes at $CDS_HOME/javadoc/cdsapi/index.html for more information.
sendMMS(com.sun.content.server.server.messaging.message.MMSPushMessage message)
The sendMMS method encapsulates the functionality for sending an MMS message. This method is called by the Content Delivery Server Messaging Service when it receives an MMSPushMessage from Content Delivery Server.
Content Delivery Server sends an MMSPushMessage object to the Content Delivery Server Messaging Service. The Messaging Service uses the value of the mms.senderclass property in the MsgService.properties file to identify the fully qualified name of the class that provides the vendor-specific implementation of MMSSender.sendMMS. The code within the implementation of the sendMMS method transforms the MSSPushMessage object into a vendor-specific version of the MMS message object and sends it to the vendor-specific MMSC for processing. The following figure shows this process.
FIGURE 8-2 Process Flow for Sending an MMS Message
To implement a vendor-specific version of the MMSSender.sendMMS method, include the following items:
1. Connect to the vendor-specific MMSC.
2. Implement the MMSSender.sendMMS method to do the following tasks:
See the output of the Javadoc tool for these classes at $CDS_HOME/javadoc/cdsapi/index.html for more information.
The PushResponse class is the base class for all of the different types of push responses generated by the external push services. All of the set methods are used by an implementation of a push message sender. All of the get methods can be used by Content Delivery Server to log the push message in the database. See the output of the Javadoc tool for these classes at $CDS_HOME/javadoc/cdsapi/index.html for more information.
The PushConstants class contains all of the constants that the push services can support. A specific push service implementation compares these constants with the values received from the PushMessage object. See the output of the Javadoc tool at $CDS_HOME/javadoc/cdsapi/index.html for information on the constants defined.
A push sender adapter must implement the PushMsgSender interface. During deployment, the implementation class needs to be registered with Content Delivery Server. An XML file is used for registration. This XML file is located in the $CDS_HOME/deployment/deployment-name/conf directory and is named pushsenderfactory.xml.
The following example shows the structure of this file.
Four adapters are registered in this file. Specify the fully qualified class name and the protocol that the adapter supports. For example, if you have an adapter for SMS push, the protocol is sms. Make sure the adapter class and dependent classes are set in the classpath.
If you are using the default implementation of a push sender adapter for MMS, MMSPushMsgSender, you must implement the MMSSender interface. Set the mms.senderclass property in the MsgServices.properties file to the fully qualified name of your class. This class is in the $CDS_HOME/deployment/deployment-name/conf directory.
A push listener adapter implements the PushMsgListener interface. The implementation class needs to be registered with Content Delivery Server. An XML file is used for registration. This XML file is located in the $CDS_HOME/deployment/deployment-name/conf directory and is named pushlistenerfactory.xml.
The following example shows the structure of this file.
Copyright © 2008, Sun Microsystems, Inc. All Rights Reserved.