com.objectxp.msg
Class SEOMessage

java.lang.Object
  extended bycom.objectxp.msg.Message
      extended bycom.objectxp.msg.SmsMessage
          extended bycom.objectxp.msg.SEOMessage
All Implemented Interfaces:
java.lang.Cloneable, MultiPartMessage, java.io.Serializable

public class SEOMessage
extends SmsMessage
implements MultiPartMessage

This class can be used to send Multimedia Short Messages to Siemens Phones which support the Siemens Exchange Object (SEO) format.

Support for SEO Messages is available for Siemens S45, ME45 and later models.

A SEO Message consists of a object type (e.g. "bmp"), a object name (e.g. "Operator.bmp") and the actual object data. If the object doesn't fit into a single SMS, the object will be sent using multiple SMS.

Content-Format specification

Bitmaps

Standard BMP-Format, according to the Windows Bitmap File Format Specification V1.1. At maximum 256 colours can be supported. They will be internally converted according to the capabilities of the individual mobile phone.

The bitmap will not be rejected if its size exceeds the display capabilities of the mobile phone. In this case the middle of the bitmap will be adjusted to the middle of the mobile phones display. The parts of the display which exceed the display capabilities will be cut off.

Depending on the capabilities of the individual phones the Bitmaps received can be stored either as a replacement of the operators logo or as a screensaver. The user will be free to decide for which purpose an incoming Bitmap should be used.

Monophonic Ringtones

General MIDI 1.0 File Format 0 and 1, according to "The Complete Detailed MIDI 1.0 Specification (1996)". Details can be found at this URL: http://www.midi.org/

VCard

VCard-Format, according to RFC 2425.

Usage

For VCards, construct a VCard object and pass it to the SEOMessage(VCard) constructor. For other types, construct an empty SEOMessage, pass the Object Data by calling one of the setUserData() methods and set the object name and type accordingly.

Examples

  // Construct a SEO Operator-logo
  SEOMessage msg = new SEOMessage();
  InputStream bmp = new FileInputStream("/path/to/operator.bmp");
  msg.setUserData(bmp);
  msg.setObjectType(SEOMessage.TYPE_BMP);
  msg.setObjectName("operator.bmp");
 
  // Construct a SEO VCard
  VCard vc = new VCard();
  vc.setItem(VCard.NAME,"John Doe");
  vc.setItem(VCard.TITLE, "CTO");
  vc.setItem(VCard.PHONE, "+4123456789");
  SEOMessage msg = new SEOMessage(vc);
 

See Also:
Serialized Form

Field Summary
static java.lang.String TYPE_BMP
          Object Type: BMP
static java.lang.String TYPE_MIDI
          Object Type: MIDI
static java.lang.String TYPE_VCARD
          Object Type: VCard
 
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
SEOMessage()
          Construct a new, empty Siemens Exchange Object Message.
SEOMessage(VCard card)
          Construct a new SEOMessage by converting an existing VCard object.
 
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.
 boolean containsUserDataHeader()
          This method will always return false since SEO-Messages may not contain a UDH.
 short getAlphabet()
          This method will always return SmsMessage.DC_8BIT since the SEO specification requires the alphabet to be set to 8-Bit.
 short getCodingGroup()
          This method will always return SmsMessage.DC_GROUP_DATA since the SEO specification requires the coding group to be of type "DATA".
 short getMessageClass()
          This method will always return SmsMessage.CLASS_1 since the SEO specification requires the message class to be 1.
 SmsMessage[] getParts()
          Returns the parts (fragments).
 void setObjectName(java.lang.String name)
          Set the object name for this message.
 void setObjectType(java.lang.String type)
          Set the object type for this message.
 void setUserData(java.io.InputStream stream)
          Set the SEO Object for this message.
 java.lang.String toString()
          Constructs a string representation of this Message
 
Methods inherited from class com.objectxp.msg.SmsMessage
copyFields, getBytes, getDeferredDeliveryAsDate, getDeferredDeliveryInMinutes, getID, getIndicationState, getIndicationType, getMessage, 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
 

Field Detail

TYPE_BMP

public static final java.lang.String TYPE_BMP
Object Type: BMP

See Also:
Constant Field Values

TYPE_MIDI

public static final java.lang.String TYPE_MIDI
Object Type: MIDI

See Also:
Constant Field Values

TYPE_VCARD

public static final java.lang.String TYPE_VCARD
Object Type: VCard

See Also:
Constant Field Values
Constructor Detail

SEOMessage

public SEOMessage()
Construct a new, empty Siemens Exchange Object Message.


SEOMessage

public SEOMessage(VCard card)
Construct a new SEOMessage by converting an existing VCard object. The name of the SEO Object will be set to "VCard.vcf".

Method Detail

setObjectType

public void setObjectType(java.lang.String type)
Set the object type for this message. Currently, the following types are supported:

Parameters:
type - the object type

setObjectName

public void setObjectName(java.lang.String name)
Set the object name for this message.

Parameters:
name - the object name (e.g. "Operator.bmp")

setUserData

public void setUserData(java.io.InputStream stream)
                 throws java.io.IOException
Set the SEO Object for this message.

Parameters:
stream - InputStream of the Object to send.
Throws:
java.io.IOException - if reading from the supplied stream fails.

containsUserDataHeader

public boolean containsUserDataHeader()
This method will always return false since SEO-Messages may not contain a UDH.

Overrides:
containsUserDataHeader in class SmsMessage

getAlphabet

public short getAlphabet()
This method will always return SmsMessage.DC_8BIT since the SEO specification requires the alphabet to be set to 8-Bit.

Overrides:
getAlphabet in class SmsMessage
See Also:
SmsMessage.DC_DEFAULT, SmsMessage.DC_8BIT, SmsMessage.DC_UCS2

getCodingGroup

public short getCodingGroup()
This method will always return SmsMessage.DC_GROUP_DATA since the SEO specification requires the coding group to be of type "DATA".

Overrides:
getCodingGroup in class SmsMessage
Returns:
the Coding Group
See Also:
SmsMessage.setCodingGroup(short)

getMessageClass

public short getMessageClass()
This method will always return SmsMessage.CLASS_1 since the SEO specification requires the message class to be 1.

Overrides:
getMessageClass in class SmsMessage
Returns:
the message class (SmsMessage.NO_CLASS, SmsMessage.CLASS_0, SmsMessage.CLASS_1, SmsMessage.CLASS_2, SmsMessage.CLASS_3)

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-2007. All rights reserved object XP