com.objectxp.msg
Interface MultiPartMessage

All Known Implementing Classes:
Bookmark, BrowserSettings, CLIIcon, CSDBrowserSettings, EMSMessage, ExtendedBrowserSettings, GPRSBrowserSettings, GsmCsdBrowserSettings, GsmSmsBrowserSettings, GsmUssdBrowserSettings, Is136CsdBrowserSettings, OperatorLogo, OTAMessage, PictureMessage, Ringtone, SEOMessage, ServiceIndication, ServiceLoading, SmartMessage, VCalendar, VCard

public interface MultiPartMessage

Interface for handling short messages consisting of more than 140 octets (160 characters).


Method Summary
 void buildParts(java.lang.Class type, int refnr)
          Fragmentize the Multipart message.
 void buildParts(int refnr)
          This method will be called by SmsService implementations prior to sending a MultiPartMessage.
 SmsMessage[] getParts()
          Returns the parts (fragments).
 

Method Detail

getParts

SmsMessage[] getParts()
Returns the parts (fragments). Please note that for outgoing SMS, calling this method returns null until the message has been sent.

Returns:
a array containing one or multiple short messages.

buildParts

void buildParts(java.lang.Class type,
                int refnr)
                throws java.lang.IllegalArgumentException
Fragmentize the Multipart message.

Invoke this method before sending a Multipart message if you want to specify the type of the resulting fragments.

Example
The following example shows how to set the CIMD2 specific priority flag on all fragments of a Multipart message:

   Ringtone rt = new Ringtone("...");
   rt.buildParts(Cimd2Message.class, myRefnr++);
   Cimd2Message[] fragments = (Cimd2Message[]) rt.getParts();
   for( int i=0; i < fragments.length; i++ ) {
     fragments[i].setPriority(new Integer(5));
   }
   cimd2Service.sendMessage(rt);
 

Parameters:
type - the type used for the fragments. Must be an instance of SmsMessage.
refnr - the reference-number to use for the concatenated messages.
Throws:
java.lang.IllegalArgumentException - if the type is not an instance of SmsMessage or is an instance of MultiPartMessage.

buildParts

void buildParts(int refnr)
This method will be called by SmsService implementations prior to sending a MultiPartMessage.

buildParts() will split the message into multiple parts if necessary. The parts can then be accessed by calling getParts().

Please note that there is no need to invoke this method directly since SmsService implementations call this method automatically.

Parameters:
refnr - the reference-number to use for concatenated messages.


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