mx.udlap.kjProtocol.packets
Class SMSPacketMessage

java.lang.Object
  extended bymx.udlap.kjProtocol.packets.BasicPacket
      extended bymx.udlap.kjProtocol.packets.SMSPacketMessage
All Implemented Interfaces:
BasicKannelProtocolMessage

public class SMSPacketMessage
extends BasicPacket
implements BasicKannelProtocolMessage

Kannel's protocol sms_packet message.

Author:
Oscar Medina Duarte

Field Summary
static int SMSTYPE_MO
          Mobile Originated SMS message type
static int SMSTYPE_MT_PUSH
          Mobile Terminated Push SMS message type
static int SMSTYPE_MT_REPLY
          Mobile Terminated Reply SMS message type
static int SMSTYPE_REPORT_MO
          Mobile Originated Report
static int SMSTYPE_REPORT_MT
          Mobile Terminated Report SMS message type
 
Fields inherited from class mx.udlap.kjProtocol.packets.BasicPacket
ACK_PKT, ADMIN_PKT, HEARTBEAT_PKT, length, NODATA, SMS_PKT, type, WDP_PKT
 
Constructor Summary
SMSPacketMessage()
          Constructor for the SMSPacketMessage object
SMSPacketMessage(byte[] data)
          Constructor for the SMSPacketMessage object
SMSPacketMessage(java.lang.String sender, java.lang.String receiver, java.lang.String udhdata, java.lang.String msgdata)
          Constructor for the SMSPacketMessage object
 
Method Summary
 KString getAccount()
          Gets the account attribute of the SMSPacketMessage object
 KInteger getAlt_dcs()
          Gets the alt_dcs attribute of the SMSPacketMessage object
 KString getBinfo()
          Gets the binfo attribute of the SMSPacketMessage object
 KString getBoxc_id()
          Gets the boxc_id attribute of the SMSPacketMessage object
 KString getCharset()
          Gets the charset attribute of the SMSPacketMessage object
 KInteger getCoding()
          Gets the coding attribute of the SMSPacketMessage object
 KInteger getCompress()
          Gets the compress attribute of the SMSPacketMessage object
 KInteger getDeferred()
          Gets the deferred attribute of the SMSPacketMessage object
 KInteger getDlr_mask()
          Gets the dlr_mask attribute of the SMSPacketMessage object
 KString getDlr_url()
          Gets the dlr_url attribute of the SMSPacketMessage object
 KInteger getMclass()
          Gets the mclass attribute of the SMSPacketMessage object
 byte[] getMessage()
          Gets the message attribute of the SMSPacketMessage object
 KInteger getMsg_left()
          Gets the msg_left attribute of the SMSPacketMessage object
 KString getMsgdata()
          Gets the msgdata attribute of the SMSPacketMessage object
 KInteger getMwi()
          Gets the mwi attribute of the SMSPacketMessage object
 KInteger getPid()
          Gets the pid attribute of the SMSPacketMessage object
 KInteger getPriority()
          Gets the priority attribute of the SMSPacketMessage object
 KString getReceiver()
          Gets the receiver attribute of the SMSPacketMessage object
 KInteger getRpi()
          Gets the rpi attribute of the SMSPacketMessage object
 KString getSender()
          Gets the sender attribute of the SMSPacketMessage object
 KString getService()
          Gets the service attribute of the SMSPacketMessage object
 KInteger getSms_type()
          Gets the sms_type attribute of the SMSPacketMessage object
 KString getSmsc_id()
          Gets the smsc_id attribute of the SMSPacketMessage object
 KTime getTime()
          Gets the time attribute of the SMSPacketMessage object
 KString getUdhdata()
          Gets the udhdata attribute of the SMSPacketMessage object
 KUUID getUuid()
          Gets the uuid attribute of the SMSPacketMessage object
 KInteger getValidity()
          Gets the validity attribute of the SMSPacketMessage object
 java.lang.String hexDump()
          Returns a Hex Editor style representation of the message
static void main(java.lang.String[] args)
          Testing method
 void setAccount(KString account)
          Sets the account attribute of the SMSPacketMessage object
 void setAlt_dcs(KInteger alt_dcs)
          Sets the alt_dcs attribute of the SMSPacketMessage object
 void setBinfo(KString binfo)
          Sets the binfo attribute of the SMSPacketMessage object
 void setBoxc_id(KString boxc_id)
          Sets the boxc_id attribute of the SMSPacketMessage object
 void setCharset(KString charset)
          Sets the charset attribute of the SMSPacketMessage object
 void setCoding(KInteger coding)
          Sets the coding attribute of the SMSPacketMessage object
 void setCompress(KInteger compress)
          Sets the compress attribute of the SMSPacketMessage object
 void setDeferred(KInteger deferred)
          Sets the deferred attribute of the SMSPacketMessage object
 void setDlr_mask(KInteger dlr_mask)
          Sets the dlr_mask attribute of the SMSPacketMessage object
 void setDlr_url(KString dlr_url)
          Sets the dlr_url attribute of the SMSPacketMessage object
 void setMclass(KInteger mclass)
          Sets the mclass attribute of the SMSPacketMessage object
 void setMessage(byte[] data)
          Sets the message attribute of the SMSPacketMessage object
 void setMsg_left(KInteger msg_left)
          Sets the msg_left attribute of the SMSPacketMessage object
 void setMsgdata(KString msgdata)
          Sets the msgdata attribute of the SMSPacketMessage object
 void setMwi(KInteger mwi)
          Sets the mwi attribute of the SMSPacketMessage object
 void setPid(KInteger pid)
          Sets the pid attribute of the SMSPacketMessage object
 void setPriority(KInteger priority)
          Sets the priority attribute of the SMSPacketMessage object
 void setReceiver(KString receiver)
          Sets the receiver attribute of the SMSPacketMessage object
 void setRpi(KInteger rpi)
          Sets the rpi attribute of the SMSPacketMessage object
 void setSender(KString sender)
          Sets the sender attribute of the SMSPacketMessage object
 void setService(KString service)
          Sets the service attribute of the SMSPacketMessage object
 void setSms_type(KInteger sms_type)
          Sets the sms_type attribute of the SMSPacketMessage object
 void setSmsc_id(KString smsc_id)
          Sets the smsc_id attribute of the SMSPacketMessage object
 void setTime(KTime time)
          Sets the time attribute of the SMSPacketMessage object
 void setUdhdata(KString udhdata)
          Sets the udhdata attribute of the SMSPacketMessage object
 void setUuid(KUUID uuid)
          Sets the uuid attribute of the SMSPacketMessage object
 void setValidity(KInteger validity)
          Sets the validity attribute of the SMSPacketMessage object
 java.lang.String toString()
          String representation of this packet showing all its field and contents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SMSTYPE_MO

public static final int SMSTYPE_MO
Mobile Originated SMS message type

See Also:
Constant Field Values

SMSTYPE_MT_REPLY

public static final int SMSTYPE_MT_REPLY
Mobile Terminated Reply SMS message type

See Also:
Constant Field Values

SMSTYPE_MT_PUSH

public static final int SMSTYPE_MT_PUSH
Mobile Terminated Push SMS message type

See Also:
Constant Field Values

SMSTYPE_REPORT_MO

public static final int SMSTYPE_REPORT_MO
Mobile Originated Report

See Also:
Constant Field Values

SMSTYPE_REPORT_MT

public static final int SMSTYPE_REPORT_MT
Mobile Terminated Report SMS message type

See Also:
Constant Field Values
Constructor Detail

SMSPacketMessage

public SMSPacketMessage()
Constructor for the SMSPacketMessage object


SMSPacketMessage

public SMSPacketMessage(java.lang.String sender,
                        java.lang.String receiver,
                        java.lang.String udhdata,
                        java.lang.String msgdata)
Constructor for the SMSPacketMessage object

Parameters:
sender - Part that sends the message
receiver - Part that receives de message
udhdata - UDH data
msgdata - Message data

SMSPacketMessage

public SMSPacketMessage(byte[] data)
                 throws PacketParseException
Constructor for the SMSPacketMessage object

This parses an array of bytes into a SMSPacketMessage

Parameters:
data - Byte array as received in a tcp link
Throws:
PacketParseException - Exception thrown when a byte array is too short or its badly formed
Method Detail

getMessage

public byte[] getMessage()
Gets the message attribute of the SMSPacketMessage object

Specified by:
getMessage in interface BasicKannelProtocolMessage
Returns:
Byte array containing the packet to be sent over a tcp connection

setMessage

public void setMessage(byte[] data)
                throws PacketParseException
Sets the message attribute of the SMSPacketMessage object

Specified by:
setMessage in interface BasicKannelProtocolMessage
Parameters:
data - Byte array containing a packet as received over a tcp connection
Throws:
PacketParseException - Exception thrown when

setSender

public void setSender(KString sender)
Sets the sender attribute of the SMSPacketMessage object

Parameters:
sender - The new sender value

setReceiver

public void setReceiver(KString receiver)
Sets the receiver attribute of the SMSPacketMessage object

Parameters:
receiver - The new receiver value

setUdhdata

public void setUdhdata(KString udhdata)
Sets the udhdata attribute of the SMSPacketMessage object

Parameters:
udhdata - The new udhdata value

setMsgdata

public void setMsgdata(KString msgdata)
Sets the msgdata attribute of the SMSPacketMessage object

Parameters:
msgdata - The new msgdata value

setTime

public void setTime(KTime time)
Sets the time attribute of the SMSPacketMessage object

Parameters:
time - The new time value

setSmsc_id

public void setSmsc_id(KString smsc_id)
Sets the smsc_id attribute of the SMSPacketMessage object

Parameters:
smsc_id - The new smsc_id value

setService

public void setService(KString service)
Sets the service attribute of the SMSPacketMessage object

Parameters:
service - The new service value

setAccount

public void setAccount(KString account)
Sets the account attribute of the SMSPacketMessage object

Parameters:
account - The new account value

setUuid

public void setUuid(KUUID uuid)
Sets the uuid attribute of the SMSPacketMessage object

Parameters:
uuid - The new uuid value

setSms_type

public void setSms_type(KInteger sms_type)
Sets the sms_type attribute of the SMSPacketMessage object

Parameters:
sms_type - The new sms_type value

setMclass

public void setMclass(KInteger mclass)
Sets the mclass attribute of the SMSPacketMessage object

Parameters:
mclass - The new mclass value

setMwi

public void setMwi(KInteger mwi)
Sets the mwi attribute of the SMSPacketMessage object

Parameters:
mwi - The new mwi value

setCoding

public void setCoding(KInteger coding)
Sets the coding attribute of the SMSPacketMessage object

Parameters:
coding - The new coding value

setCompress

public void setCompress(KInteger compress)
Sets the compress attribute of the SMSPacketMessage object

Parameters:
compress - The new compress value

setValidity

public void setValidity(KInteger validity)
Sets the validity attribute of the SMSPacketMessage object

Parameters:
validity - The new validity value

setDeferred

public void setDeferred(KInteger deferred)
Sets the deferred attribute of the SMSPacketMessage object

Parameters:
deferred - The new deferred value

setDlr_mask

public void setDlr_mask(KInteger dlr_mask)
Sets the dlr_mask attribute of the SMSPacketMessage object

Parameters:
dlr_mask - The new dlr_mask value

setDlr_url

public void setDlr_url(KString dlr_url)
Sets the dlr_url attribute of the SMSPacketMessage object

Parameters:
dlr_url - The new dlr_url value

setPid

public void setPid(KInteger pid)
Sets the pid attribute of the SMSPacketMessage object

Parameters:
pid - The new pid value

setAlt_dcs

public void setAlt_dcs(KInteger alt_dcs)
Sets the alt_dcs attribute of the SMSPacketMessage object

Parameters:
alt_dcs - The new alt_dcs value

setRpi

public void setRpi(KInteger rpi)
Sets the rpi attribute of the SMSPacketMessage object

Parameters:
rpi - The new rpi value

setCharset

public void setCharset(KString charset)
Sets the charset attribute of the SMSPacketMessage object

Parameters:
charset - The new charset value

setBoxc_id

public void setBoxc_id(KString boxc_id)
Sets the boxc_id attribute of the SMSPacketMessage object

Parameters:
boxc_id - The new boxc_id value

setBinfo

public void setBinfo(KString binfo)
Sets the binfo attribute of the SMSPacketMessage object

Parameters:
binfo - The new binfo value

setMsg_left

public void setMsg_left(KInteger msg_left)
Sets the msg_left attribute of the SMSPacketMessage object

Parameters:
msg_left - The new msg_left value

setPriority

public void setPriority(KInteger priority)
Sets the priority attribute of the SMSPacketMessage object

Parameters:
priority - The new priority value

getSender

public KString getSender()
Gets the sender attribute of the SMSPacketMessage object

Returns:
The sender value

getReceiver

public KString getReceiver()
Gets the receiver attribute of the SMSPacketMessage object

Returns:
The receiver value

getUdhdata

public KString getUdhdata()
Gets the udhdata attribute of the SMSPacketMessage object

Returns:
The udhdata value

getMsgdata

public KString getMsgdata()
Gets the msgdata attribute of the SMSPacketMessage object

Returns:
The msgdata value

getTime

public KTime getTime()
Gets the time attribute of the SMSPacketMessage object

Returns:
The time value

getSmsc_id

public KString getSmsc_id()
Gets the smsc_id attribute of the SMSPacketMessage object

Returns:
The smsc_id value

getService

public KString getService()
Gets the service attribute of the SMSPacketMessage object

Returns:
The service value

getAccount

public KString getAccount()
Gets the account attribute of the SMSPacketMessage object

Returns:
The account value

getUuid

public KUUID getUuid()
Gets the uuid attribute of the SMSPacketMessage object

Returns:
The uuid value

getSms_type

public KInteger getSms_type()
Gets the sms_type attribute of the SMSPacketMessage object

Returns:
The sms_type value

getMclass

public KInteger getMclass()
Gets the mclass attribute of the SMSPacketMessage object

Returns:
The mclass value

getMwi

public KInteger getMwi()
Gets the mwi attribute of the SMSPacketMessage object

Returns:
The mwi value

getCoding

public KInteger getCoding()
Gets the coding attribute of the SMSPacketMessage object

Returns:
The coding value

getCompress

public KInteger getCompress()
Gets the compress attribute of the SMSPacketMessage object

Returns:
The compress value

getValidity

public KInteger getValidity()
Gets the validity attribute of the SMSPacketMessage object

Returns:
The validity value

getDeferred

public KInteger getDeferred()
Gets the deferred attribute of the SMSPacketMessage object

Returns:
The deferred value

getDlr_mask

public KInteger getDlr_mask()
Gets the dlr_mask attribute of the SMSPacketMessage object

Returns:
The dlr_mask value

getDlr_url

public KString getDlr_url()
Gets the dlr_url attribute of the SMSPacketMessage object

Returns:
The dlr_url value

getPid

public KInteger getPid()
Gets the pid attribute of the SMSPacketMessage object

Returns:
The pid value

getAlt_dcs

public KInteger getAlt_dcs()
Gets the alt_dcs attribute of the SMSPacketMessage object

Returns:
The alt_dcs value

getRpi

public KInteger getRpi()
Gets the rpi attribute of the SMSPacketMessage object

Returns:
The rpi value

getCharset

public KString getCharset()
Gets the charset attribute of the SMSPacketMessage object

Returns:
The charset value

getBoxc_id

public KString getBoxc_id()
Gets the boxc_id attribute of the SMSPacketMessage object

Returns:
The boxc_id value

getBinfo

public KString getBinfo()
Gets the binfo attribute of the SMSPacketMessage object

Returns:
The binfo value

getMsg_left

public KInteger getMsg_left()
Gets the msg_left attribute of the SMSPacketMessage object

Returns:
The msg_left value

getPriority

public KInteger getPriority()
Gets the priority attribute of the SMSPacketMessage object

Returns:
The priority value

toString

public java.lang.String toString()
String representation of this packet showing all its field and contents

Returns:
String representation

hexDump

public java.lang.String hexDump()
Returns a Hex Editor style representation of the message

Returns:
String representation in Hex editor style

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Testing method

Parameters:
args - Description of the Parameter
Throws:
java.lang.Exception - Exception thrown when