SMSLib 3.5.3

org.smslib
Class Message

java.lang.Object
  extended by org.smslib.Message
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
InboundMessage, OutboundMessage

public abstract class Message
extends java.lang.Object
implements java.io.Serializable

The parent of all message-related classes. Most of common fields and attributes of both inbound and outbound messages are placed in this class.

See Also:
Serialized Form

Nested Class Summary
static class Message.MessageClasses
          Enumeration representing the different message classes.
static class Message.MessageEncodings
          Enumeration representing available message encodings.
static class Message.MessageTypes
          Enumeration representing the different types of messages.
 
Constructor Summary
Message(Message.MessageTypes myType, java.util.Date myDate, java.lang.String myText)
           
 
Method Summary
 void addText(java.lang.String addText)
           
 java.util.Date getDate()
          Returns the creation date.
 Message.MessageClasses getDCSMessageClass()
          Returns the message Class.
 int getDstPort()
          Returns the destination port of the message.
 Message.MessageEncodings getEncoding()
          Returns the message encoding.
 java.lang.String getGatewayId()
          Returns the ID of the gateway which the message was received from (for inbound messages) or the message was dispatched from (outbound messages).
 java.lang.String getId()
          Returns the message ID.
 long getMessageId()
          Returns the auto-generated, internal message ID.
abstract  java.lang.String getPduUserData()
           
abstract  java.lang.String getPduUserDataHeader()
           
 int getSrcPort()
          Returns the source port of the message.
 java.lang.String getText()
          Returns the message text.
 Message.MessageTypes getType()
          Returns the message type.
 java.lang.String getUuid()
           
 void setDate(java.util.Date myDate)
          Sets the creation date to a specific date.
 void setDCSMessageClass(Message.MessageClasses messageClass)
          Sets the message Class to the specified one.
 void setDstPort(int myDstPort)
          Sets the destination port of the message.
 void setEncoding(Message.MessageEncodings myEncoding)
          Sets the message encoding to the specified one.
 void setGatewayId(java.lang.String myGtwId)
          Sets the message's Gateway ID to a specific value.
 void setId(java.lang.String myId)
          Sets the message ID to a specific value.
 void setSrcPort(int mySrcPort)
          Sets the source port of the message.
 void setText(java.lang.String myText)
          Sets the message text.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Message

public Message(Message.MessageTypes myType,
               java.util.Date myDate,
               java.lang.String myText)
Method Detail

getDate

public java.util.Date getDate()
Returns the creation date. For outbound messages, this is the object's creation date. For inbound messages, this is the date when the originator has sent the message.

Returns:
the creation date.
See Also:
setDate(Date)

setDate

public void setDate(java.util.Date myDate)
Sets the creation date to a specific date.

Parameters:
myDate - A custom date.
See Also:
getDate()

getEncoding

public Message.MessageEncodings getEncoding()
Returns the message encoding.

Returns:
The message encoding.
See Also:
setEncoding(MessageEncodings), Message.MessageEncodings

getDCSMessageClass

public Message.MessageClasses getDCSMessageClass()
Returns the message Class.

Returns:
The message class.
See Also:
setDCSMessageClass(org.smslib.Message.MessageClasses), Message.MessageClasses

setDCSMessageClass

public void setDCSMessageClass(Message.MessageClasses messageClass)
Sets the message Class to the specified one.

Parameters:
messageClass - The message Class.
See Also:
getDCSMessageClass(), Message.MessageClasses

getGatewayId

public java.lang.String getGatewayId()
Returns the ID of the gateway which the message was received from (for inbound messages) or the message was dispatched from (outbound messages).

Returns:
The Gateway ID.
See Also:
setGatewayId(String)

setGatewayId

public void setGatewayId(java.lang.String myGtwId)
Sets the message's Gateway ID to a specific value.

Parameters:
myGtwId - The Gateway ID.
See Also:
getGatewayId()

getId

public java.lang.String getId()
Returns the message ID. This field can be used for your own purposes.

Returns:
The message ID.
See Also:
setId(String)

setId

public void setId(java.lang.String myId)
Sets the message ID to a specific value.

Parameters:
myId - The new message ID.
See Also:
getId()

getMessageId

public long getMessageId()
Returns the auto-generated, internal message ID.

Returns:
The message ID.

getText

public java.lang.String getText()
Returns the message text.

Returns:
The message text.
See Also:
setText(String)

setText

public void setText(java.lang.String myText)
Sets the message text.

Parameters:
myText - The message text.
See Also:
getText()

addText

public void addText(java.lang.String addText)
             throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException

getType

public Message.MessageTypes getType()
Returns the message type.

Returns:
The message type.
See Also:
Message.MessageTypes, setType(MessageTypes)

getDstPort

public int getDstPort()
Returns the destination port of the message. Source and Destination ports are used when messages are targeting a midlet application. For standard SMS messages, the Source and Destination ports should both be set to -1 (which is their default value anyway).

Returns:
The destination port.
See Also:
getDstPort(), setSrcPort(int), getSrcPort()

setDstPort

public void setDstPort(int myDstPort)
Sets the destination port of the message. Source and Destination ports are used when messages are targeting a midlet application. For standard SMS messages, the Source and Destination ports should both be set to -1 (which is their default value anyway).

The default is (-1).

Parameters:
myDstPort - The destination port.
See Also:
setDstPort(int), setSrcPort(int), getSrcPort()

getSrcPort

public int getSrcPort()
Returns the source port of the message. Source and Destination ports are used when messages are targeting a midlet application. For standard SMS messages, the Source and Destination ports should both be set to -1 (which is their default value anyway).

Returns:
The source port.
See Also:
setSrcPort(int), setDstPort(int), getDstPort()

setSrcPort

public void setSrcPort(int mySrcPort)
Sets the source port of the message. Source and Destination ports are used when messages are targeting a midlet application. For standard SMS messages, the Source and Destination ports should both be set to -1 (which is their default value anyway).

The default is (-1).

Parameters:
mySrcPort - The source port.
See Also:
setDstPort(int), setSrcPort(int), getSrcPort()

setEncoding

public void setEncoding(Message.MessageEncodings myEncoding)
Sets the message encoding to the specified one.

Parameters:
myEncoding - The message encoding.
See Also:
getEncoding(), Message.MessageEncodings

getPduUserData

public abstract java.lang.String getPduUserData()

getPduUserDataHeader

public abstract java.lang.String getPduUserDataHeader()

getUuid

public java.lang.String getUuid()

SMSLib 3.5.3

(c) 2002-2011, http://smslib.org