com.unipro.smlib
Class InMessage

java.lang.Object
  |
  +--com.unipro.smlib.InMessage
All Implemented Interfaces:
com.unipro.smlib.InputItem, java.io.Serializable

public class InMessage
extends java.lang.Object
implements com.unipro.smlib.InputItem, java.io.Serializable

Class represents incoming message.
InMessage object is passed as a parameter to SmsListener.proccessMessage() method.
To process in messages register SmsListener in the SmsManager. You can get parameters of the message using get methods. If there is a concatenated message, text of message is a concatenated string.

Parameters are:
Sender number The phone number in national format without '+' or in provider specified number's format. For example: 79029070904 - national format, 001900 - provider specified format.
SMSC Number The number of Short Message Service Center in national format without '+'
Text The message text
SMSC Time The time stamp from SMSC in java.util.GregorianCalendar format
Reply Path Reply path flag can be use to notify receiver if transmitter is capable to receive messages.
More Messages The More Messages is the information element by which the SMSC informs the mobile station that there are one or more messages waiting in that SMSC to be delivered to the mobile.
Flash Flag Flag indicates if this message is a flash message, false by default.
ACK The request for status indication report.

See Also:
Serialized Form

Method Summary
 boolean getMoreMessages()
          Gets more messages flag.
 boolean getReplyPath()
          Gets the reply path flag.
 java.lang.String getSenderNumber()
          Gets message sender number.
 java.lang.String getSMSCNumber()
          Gets Short Message Service Center number of the message.
 java.util.GregorianCalendar getSMSCTime()
          Gets Short Message Service Center time.
 java.lang.String getText()
          Gets message text.
 boolean isACKReportForThisMessage()
          Tests if a status report will be returned to the mobile phone for this message.
 boolean isFlash()
          Tests if this message is a flash message.
 java.lang.String toString()
          Returns String representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getSenderNumber

public java.lang.String getSenderNumber()
Gets message sender number.
Returns:
the sender number in national format without '+', or in provider specified number's format.

getSMSCNumber

public java.lang.String getSMSCNumber()
Gets Short Message Service Center number of the message.
Specified by:
getSMSCNumber in interface com.unipro.smlib.InputItem
Returns:
the Short Message Service Center number in national format without '+'.

getSMSCTime

public java.util.GregorianCalendar getSMSCTime()
Gets Short Message Service Center time. Short Message Service Center time is a time stamp, which was set in SMSC before sending the message.
Specified by:
getSMSCTime in interface com.unipro.smlib.InputItem
Returns:
the Short Message Service Center time in java.util.GregorianCalendar format.

getText

public java.lang.String getText()
Gets message text. If the concatenated message is received, text of message is a concatenated string of all received messages, which length is greater than 160 characters.
Returns:
the text of this message.

getMoreMessages

public boolean getMoreMessages()
Gets more messages flag. The More Messages is the information element by which the SMSC informs the mobile station that there are one or more messages waiting in that SMSC to be delivered to the mobile.
Returns:
more message flag, If value is true - more messages to be delivered.

getReplyPath

public boolean getReplyPath()
Gets the reply path flag. more about reply path.
Returns:
reply path flag.

isFlash

public boolean isFlash()
Tests if this message is a flash message. more about flash messages.
Returns:
flash flag

isACKReportForThisMessage

public boolean isACKReportForThisMessage()
Tests if a status report will be returned to the mobile phone for this message.
Returns:
true is status report will be returned, false otherwise.

toString

public java.lang.String toString()
Returns String representation of the object. Format: "InMessage [From: {sender number}, Text: {text}, SMSC Number: {smsc number}, SMSC Time: {time in Date format}, Reply Path: {true/false}, More Messages: {true/false}, Flash:: {true/false}]"
Overrides:
toString in class java.lang.Object
Returns:
a string representation of object