C H A P T E R  9

Confirm Service API

The Sun Java System Content Delivery Server Confirm Service API enables the Content Delivery Server to handle confirmation messages sent from a Multimedia Messaging Service Center (MMSC). Confirmation messages are generally sent after content is downloaded to a device.

The Confirm Service API consists of the following classes:

For additional information on these classes, see the HTML output of the Javadoc tool at $CDS_HOME/javadoc/cdsapi/index.html.


9.1 General Process Flow

The Content Delivery Server can send content in a multimedia message to devices that support the MMS standard. When a device receives content in an MMS message, a confirmation message is returned through the MMSC. The confirm service adapter that you write using the Confirm Service API sets up the connection between the Content Delivery Server and the MMSC, and handles the confirmation messages from the MMSC.


9.2 ConfirmServiceAdapter Class

The ConfirmServiceAdapter class establishes the connection with the MMSC, listens for confirmation messages, and passes the messages received to the Content Delivery Server. Extend ConfirmServiceAdapter to create a confirm service adapter for your system.

The ConfirmServiceAdapter class is in the com.sun.content.server.confirmservice package.

9.2.1 connect()

public abstract boolean connect() throws ConnectionFailedException

Use this method to connect to the Content Delivery Server to the MMSC that you are using.

9.2.2 listen()

public abstract void listen() throws ConfirmServiceException

Use this method to listen for confirmation messages from the MMSC. When a confirmation message is received, use the information in the message to create a ConfirmResponse object and call the messageReceived() method.

The ConfirmResponse object requires the information shown in the following table.


TABLE 9-1 ConfirmResponse Parameters

Parameter

Description

pushType

The type of message received. The value must be one of the types defined in the PushConstants class (see Section 8.12, PushConstants Class.)

messageID

The ID assigned by the MMSC to identify the message.

responseStatus

The status of the response.

responseDescription

The description of the response.

responseObject

Not used for MMS messages. Pass null.


9.2.3 messageReceived()

protected void messageReceived(ConfirmResponse confirmResponse) throws ConfirmServiceException

Use this method to send the information received in the confirmation message to the Content Delivery Server. Call this message from your implementation of the listen() method.


9.3 Using the Confirm Service API

Modify the ConfirmListener.properties file in the $CDS_HOME/deployment/deployment-name/conf directory to add another instance of the following property:

confirmservice.class.id

Set this property to the class name of your implementation of the ConfirmServiceAdapter class, for example:

confirmservice.class.id=com.sun.content.server.server.confirm.mms.MMSConfirmService

The classes for the Confirm Service API are available in cdsapi.jar, which is found in the $CDS_HOME/deployment/deployment-name/lib/cdslib directory.

The cdsapi.jar file must be in your classpath when you compile your adapter.

To make your adapter available to the Content Delivery Server, follow these steps:

1. Create a JAR file for your adapter.

2. Place the JAR file in the $CDS_HOME/deployment/deployment-name/lib/external directory.

3. Open the ConfirmListener.properties file in the $CDS_HOME/deployment/deployment-name/conf directory.

4. Add another instance of the confirmservice.class.id property.

Set this property to the class name of your implementation of the ConfirmServiceAdapter class, for example:

confirmservice.class.id=com.sun.content.server.server.confirm.mms.MMSConfirmService

5. Save your changes.

6. Restart the Content Delivery Server to make it aware of the new JAR file.