com.objectxp.mms
Interface MMSService

All Known Subinterfaces:
MM1Service, MM7Service

public interface MMSService

The MMSService interface defines the methods for sending and receiving Multimedia Messages (MMS).

Objects implementing this interface may be constructed by using the MMSServiceFactory.

Since:
jSMS 2.0

Method Summary
 void cancel(MMSMessage message)
          Cancel a previously submitted multimedia message.
 void connect()
          Connect to the MMS-Proxy-Relay.
 void disconnect()
          Closes the connection to the MMS-Proxy-Relay.
 MMSMessage fetch(MMSNotification notification)
          Fetches a message from the MMS-Proxy-Relay.
 MMSListener getListener()
          Returns the current MMS listener for this service.
 java.lang.String getName()
          Returns the name of the MMS Service.
 boolean hasCapability(MMSCapability capability)
          Determine if a MMS Service has a specific capability.
 void replace(MMSMessage oldMessage, MMSMessage newMessage)
          Replace a previously submitted multimedia message.
 void send(MMSMessage message)
          Send a MMS message.
 void setListener(MMSListener listener)
          Set a MMS listener for processing incoming multimedia messages, reports and notifications.
 

Method Detail

connect

void connect()
             throws MMSException,
                    ProtocolException,
                    TransportException,
                    java.io.IOException
Connect to the MMS-Proxy-Relay.

Throws:
MMSException - if connecting to the MMS Relay/Server fails
ProtocolException - if the underlying Protocol implementation fails
TransportException - if the underlying Transport layer fails
java.io.IOException - if an I/O error occurs

disconnect

void disconnect()
                throws MMSException,
                       ProtocolException,
                       TransportException,
                       java.io.IOException
Closes the connection to the MMS-Proxy-Relay.

Throws:
MMSException - if connecting to the MMS Relay/Server fails
ProtocolException - if the underlying Protocol implementation fails
TransportException - if the underlying Transport layer fails
java.io.IOException - if an I/O error occurs

send

void send(MMSMessage message)
          throws MMSException,
                 ProtocolException,
                 java.lang.IllegalStateException
Send a MMS message.

Parameters:
message - the message to send
Throws:
MMSException - if the MMSMessage is not valid,
ProtocolException - if the delivery of the Message fails.
java.lang.IllegalStateException - if the service is not connected.

fetch

MMSMessage fetch(MMSNotification notification)
                 throws MMSException
Fetches a message from the MMS-Proxy-Relay.

The MMS Relay/Server first sends a MMSNotification which advises the client that a MMS is ready to be picked up on the MMS Relay/Server.

This method fetches the MMSMessage corresponding to the given MMSNotification.

Returns:
the fetched MMSMessage
Throws:
MMSException - if the MMS can not be picked up.
java.lang.IllegalStateException - if the service is not connected.

getName

java.lang.String getName()
Returns the name of the MMS Service.


hasCapability

boolean hasCapability(MMSCapability capability)
Determine if a MMS Service has a specific capability.

Parameters:
capability - one of the Constants in the MMSCapability class.
Returns:
true if the service provides the capability.
Since:
jSMS 2.2

setListener

void setListener(MMSListener listener)
Set a MMS listener for processing incoming multimedia messages, reports and notifications.

Parameters:
listener - An object implementing the MMSListener interface.
Since:
jSMS 2.2

getListener

MMSListener getListener()
Returns the current MMS listener for this service.

Returns:
the current listener or null if no listener has been set.
Since:
jSMS 2.2

cancel

void cancel(MMSMessage message)
            throws java.lang.UnsupportedOperationException,
                   java.lang.IllegalStateException,
                   MMSException,
                   ProtocolException
Cancel a previously submitted multimedia message. The message can only be canceled if it has not yet been delivered to the recipient.

Parameters:
message - the message to cancel
Throws:
java.lang.UnsupportedOperationException - if the underlying MMS protocol does not support cancellation.
java.lang.IllegalStateException - if the service is not connected.
ProtocolException - if the underlying Protocol implementation fails
MMSException - if the MMS cannot be cancelled.
Since:
jSMS 2.2

replace

void replace(MMSMessage oldMessage,
             MMSMessage newMessage)
             throws java.lang.UnsupportedOperationException,
                    java.lang.IllegalStateException,
                    MMSException,
                    ProtocolException
Replace a previously submitted multimedia message. The message can only be replaced if it has not yet been delivered to the recipient.

Parameters:
oldMessage - the previously sent message.
newMessage - the replacement message.
Throws:
java.lang.UnsupportedOperationException - if the underlying MMS protocol does not support message replacement.
java.lang.IllegalStateException - if the service is not connected.
MMSException - if the MMS cannot be replaced.
ProtocolException - if the underlying Protocol implementation fails


object XP, Inc. © 2000-2008. All rights reserved object XP