public class SEOMessage extends SmsMessage implements MultiPartMessage
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.
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.
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.
// 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);
Modifier and Type | Field and Description |
---|---|
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
|
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
ACK_TIME, MT_BINARY, MT_STATUS, MT_TEXT, SENDER_TYPE_ALPHA, SENDER_TYPE_GUESS, SENDER_TYPE_NUMBER
Constructor and Description |
---|
SEOMessage()
Construct a new, empty Siemens Exchange Object Message.
|
SEOMessage(VCard card)
Construct a new SEOMessage by converting an existing VCard object.
|
Modifier and Type | Method and Description |
---|---|
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
|
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
clone, getProperty, getSenderType, getTimestamp, setID, setProperty, setSenderType
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getTimestamp
public static final java.lang.String TYPE_BMP
public static final java.lang.String TYPE_MIDI
public static final java.lang.String TYPE_VCARD
public SEOMessage()
public SEOMessage(VCard card)
public void setObjectType(java.lang.String type)
type
- the object typepublic void setObjectName(java.lang.String name)
name
- the object name (e.g. "Operator.bmp")public void setUserData(java.io.InputStream stream) throws java.io.IOException
stream
- InputStream of the Object to send.java.io.IOException
- if reading from the supplied stream fails.public boolean containsUserDataHeader()
containsUserDataHeader
in class SmsMessage
public short getAlphabet()
SmsMessage.DC_8BIT
since the SEO
specification requires the alphabet to be set to 8-Bit.getAlphabet
in class SmsMessage
SmsMessage.DC_DEFAULT
,
SmsMessage.DC_8BIT
,
SmsMessage.DC_UCS2
public short getCodingGroup()
SmsMessage.DC_GROUP_DATA
since the
SEO specification requires the coding group to be of type "DATA".getCodingGroup
in class SmsMessage
SmsMessage.setCodingGroup(short)
public short getMessageClass()
SmsMessage.CLASS_1
since the
SEO specification requires the message class to be 1.getMessageClass
in class SmsMessage
SmsMessage.NO_CLASS
, SmsMessage.CLASS_0
, SmsMessage.CLASS_1
,
SmsMessage.CLASS_2
, SmsMessage.CLASS_3
)public SmsMessage[] getParts()
MultiPartMessage
getParts
in interface MultiPartMessage
public final void buildParts(int refnr)
MultiPartMessage
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.
buildParts
in interface MultiPartMessage
refnr
- the reference-number to use for concatenated messages.public final void buildParts(java.lang.Class type, int refnr) throws java.lang.IllegalArgumentException
MultiPartMessage
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);
buildParts
in interface MultiPartMessage
type
- the type used for the fragments. Must be an instance of SmsMessage
.refnr
- the reference-number to use for the concatenated messages.java.lang.IllegalArgumentException
- if the type is not an instance of SmsMessage or
is an instance of MultiPartMessage.public java.lang.String toString()
Message
toString
in class SmsMessage
object XP, Inc. © 2000-2013. All rights reserved object XP