com.objectxp.msg.ota
Class OTAMessage

java.lang.Object
  extended by com.objectxp.msg.Message
      extended by com.objectxp.msg.SmsMessage
          extended by com.objectxp.msg.ota.OTAMessage
All Implemented Interfaces:
MultiPartMessage, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
Bookmark, BrowserSettings, ServiceIndication, ServiceLoading

public abstract class OTAMessage
extends SmsMessage
implements MultiPartMessage

This is the base class for OTA Messages.

Please note that both a SAX parser implementing the Java API for XML Processing (JAXP) and the jWAP library (jWAP.jar) must be available.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.objectxp.msg.SmsMessage
CLASS_0, CLASS_1, CLASS_2, CLASS_3, DC_8BIT, DC_DEFAULT, DC_GROUP_DATA, DC_GROUP_GENERAL, DC_GROUP_MSG_WAITING_DISCARD, DC_GROUP_MSG_WAITING_STORE, DC_UCS2, INDICATION_ACTIVE, INDICATION_INACTIVE, INDICATION_TYPE_EMAIL, INDICATION_TYPE_FAX, INDICATION_TYPE_OTHER, INDICATION_TYPE_VOICEMAIL, NO_CLASS
 
Fields inherited from class com.objectxp.msg.Message
ACK_TIME, MT_BINARY, MT_STATUS, MT_TEXT, SENDER_TYPE_ALPHA, SENDER_TYPE_GUESS, SENDER_TYPE_NUMBER
 
Constructor Summary
OTAMessage()
           
 
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).
 java.lang.String toString()
          Constructs a string representation of this Message
 
Methods inherited from class com.objectxp.msg.SmsMessage
containsUserDataHeader, copyFields, getAlphabet, getBytes, getCodingGroup, getDeferredDeliveryAsDate, getDeferredDeliveryInMinutes, getID, getIndicationState, getIndicationType, getMessage, getMessageClass, getParent, getPID, getRecipient, getRecipientAddress, getSender, getSenderAddress, getType, getUserData, getUserDataHeader, getValidityPeriodAsDate, getValidityPeriodInMinutes, hasDeferredDelivery, hasMessageClass, hasValidityPeriod, isCompressed, isMMS, isRejectDuplicates, isRelativeDeferredDelivery, isRelativeValidityPeriod, isReplyPath, requestStatusReport, requestStatusReport, setAlphabet, setCodingGroup, setCompression, setDeferredDelivery, setDeferredDelivery, setIndicationState, setIndicationType, setMessage, setMessage, setMessageClass, setMMS, setParent, setPID, setRecipient, setRecipientAddress, setRejectDuplicates, setReplyPath, setSender, setSenderAddress, setType, setUserData, setUserDataHeader, setUserDataHeader, setValidityPeriod, setValidityPeriod
 
Methods inherited from class com.objectxp.msg.Message
clone, getProperty, getSenderType, getTimestamp, setID, setProperty, setSenderType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OTAMessage

public OTAMessage()
Method Detail

getParts

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

Specified by:
getParts in interface MultiPartMessage
Returns:
a array containing one or multiple short messages.

buildParts

public final void buildParts(int refNr)
Description copied from interface: MultiPartMessage
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 MultiPartMessage.getParts().

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

Specified by:
buildParts in interface MultiPartMessage
Parameters:
refNr - the reference-number to use for concatenated messages.

buildParts

public final void buildParts(java.lang.Class type,
                             int refNr)
                      throws java.lang.IllegalArgumentException
Description copied from interface: MultiPartMessage
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);
 

Specified by:
buildParts in interface MultiPartMessage
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.

toString

public java.lang.String toString()
Description copied from class: Message
Constructs a string representation of this Message

Overrides:
toString in class SmsMessage


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