Oracle Application Server Wireless Java API Reference
B14043-01


oracle.panama.messaging.common
Class EncodedSMS

java.lang.Object
  extended byoracle.panama.messaging.common.EncodedSMS

All Implemented Interfaces:
java.io.Serializable

public class EncodedSMS
extends java.lang.Object
implements java.io.Serializable

This class can be used to pass encoded binary/text messages to the transport layer. By default, it assumes a message to be binary, with DCS = 0xF5, PID = 0x00. An encoded SMS can contain many encoded SMS segment. Each segment contains data part and header part. An example to create an encoded SMS is shown below.

   Message msg = new Message();
   EncodedSMS encodedSMS = new EncodedSMS();
   EncodedSMSSegment seg1 = new EncodedSMSSegment();
   String data1 = "424547494E3A56434152440D0A56455253494F4E3A322E310D0A"+
   "464E3A56696A69206E6F74207365656E0D0A4E3A766A3B766A0D0A"+
   "54454C3B4641583A35313037313030350D0A454D41494C3B494E5445524E45543A"+
   "6162632E736D697468406E6F6B69612E636F6D0D0A454E443A56434152440D0A";
   
   seg1.setData(Conversion.toBytes(data1));
   
   seg1.setHeader(Conversion.toBytes("0E0003010101140700007600090000"));
   
   Vector segs = new Vector();
   segs.add(seg1);   
   encodedSMS.setSegments(segs);
   msg.setContent(encodedSMS);
   msg.setContentType(encodedSMS.MIME);   
 
See Also:
EncodedSMSSegment, Serialized Form

Field Summary
static java.lang.String MIME
MIME type for Encoded SMS.

Constructor Summary
EncodedSMS()
Creates an Encoded SMS object with DCS=0xF5 and PID=0x00.

Method Summary
boolean equals(java.lang.Object other)
Compares two EncodedSMS for equality.
byte getDcs()
Gets the Data coding scheme.
byte getPid()
Gets the protocol identifier of the Encoded SMS.
java.util.Vector getSegments()
Gets the Segments of the Encoded SMS.
int hashCode()
Generates and returns the hash code for the instance.
void setDcs(byte dcs)
Sets data coding scheme.
void setPid(byte pid)
Sets protocol identifier.
void setSegments(java.util.Vector segments)
Set the segments of the encoded SMS message.

Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

MIME

public static final java.lang.String MIME
MIME type for Encoded SMS.
See Also:
Constant Field Values

Constructor Detail

EncodedSMS

public EncodedSMS()
Creates an Encoded SMS object with DCS=0xF5 and PID=0x00.

Method Detail

equals

public boolean equals(java.lang.Object other)
Compares two EncodedSMS for equality.
Parameters:
other - EncodedSMS instance that is to be compared with "this" object.
Returns:
true if the two objects are equal. Otherwise returns false.

getDcs

public byte getDcs()
Gets the Data coding scheme.
Returns:
data coding scheme value.

getPid

public byte getPid()
Gets the protocol identifier of the Encoded SMS.
Returns:
the identifier.

getSegments

public java.util.Vector getSegments()
Gets the Segments of the Encoded SMS.
Returns:
vector contains EncodedSMSSegment.

hashCode

public int hashCode()
Generates and returns the hash code for the instance.
Returns:
the hash code.

setDcs

public void setDcs(byte dcs)
Sets data coding scheme.
Parameters:
dcs - value for the scheme. Default is 0xF5

setPid

public void setPid(byte pid)
Sets protocol identifier.
Parameters:
pid - value of identifier. Default is 0x00.

setSegments

public void setSegments(java.util.Vector segments)
Set the segments of the encoded SMS message.

Oracle Application Server Wireless Java API Reference
B14043-01


Copyright © 2004 Oracle Corporation. All Rights Reserved.