|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.unipro.smlib.OutMessage
Class represents outgoing SMS message.
Outgoing message can be represented as OutMessage instance and sent by sendMessage()
method of SmsManager class.
You can set and get parameters of the message by calling set/get methods.
Parameters are: | |
Recipient number | The recipient number in national format without '+' in provider specified number's number. For example: 79029070904 - national format, 001900 - provider specified format. String number must consist of numeral symbols, "00000000000" by default. For example: "79029070904" |
SMSC Number | The number of Short Message Service Center in national format without '+', null by default |
Text | The message text, "www.mobiles.unipro.ru" by default |
Validity Time | The validity period, 144 by default |
ACK | The request for status report, false by default. |
Reply Path | Reply path flag can be use to notify receiver if transmitter is capable to receive messages, true by default. |
Flash Flag | Flag indicates if this message is a flash message, false by default. |
Reject Duplicates | Instruct the SMSC to accept or reject an outgoung messages for an message still held in the SMSC which has the same message reference and the same recipient's address as a previously submitted message from the same mobile, false by default. |
Constructor Summary | |
OutMessage()
Creates new Outgoing Message with default values. |
|
OutMessage(java.lang.String num,
java.lang.String mes)
Creates new OutMessage with the specified receiver and message string. |
|
OutMessage(java.lang.String num,
java.lang.String mes,
boolean ack)
Creates new OutMessage with the specified receiver, message string and ACK request. |
|
OutMessage(java.lang.String num,
java.lang.String SMSCnum,
java.lang.String mes)
Creates new OutMessage with the specified receiver, Short Message Service Center number and message string. |
|
OutMessage(java.lang.String num,
java.lang.String SMSCnum,
java.lang.String mes,
boolean ack,
int valPer)
Creates new OutMessage with the specified receiver, Short Message Service Center number, message string, request for status report, validity period. |
Method Summary | |
boolean |
getACKRequest()
Gets message request for status report (ACK). |
static java.lang.String |
getDefaultSMSCNumber()
Gets default SMSC number. |
java.lang.String |
getRecipientNumber()
Gets message recipient number. |
boolean |
getRejectDuplicates()
Returns reject duplicates parameter of this message. |
boolean |
getReplyPath()
Gets the reply path flag. |
java.lang.String |
getSMSCNumber()
Gets message Short Message Service Center number. |
java.lang.String |
getText()
Gets message text. |
int |
getValidityTime()
Gets message validity period. |
boolean |
isFlash()
Tests if this message is a flash message. |
void |
setACKRequest(boolean r)
Sets request for status report (ACK) for the message. |
static void |
setDefaultSMSCNumber(java.lang.String num)
Sets default SMSC number. |
void |
setFlash(boolean f)
Sets flag to indicate this message as flash message. |
void |
setRecipientNumber(java.lang.String num)
Sets recipient number of the message. |
void |
setRejectDuplicates(boolean b)
Instruct the SMSC to accept or reject an outgoung messages for an message still held in the SMSC which has the same message reference and the same recipient's address as a previously submitted message from the same mobile. |
void |
setReplyPath(boolean repPath)
Sets reply path flag. |
void |
setSMSCNumber(java.lang.String num)
Sets Short Message Service Center number of this message. |
void |
setText(java.lang.String mess)
Sets the text of the message. |
void |
setValidityTime(int val)
Sets validity period of the message. |
java.lang.String |
toString()
Returns a String representation of the OutMessage object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public OutMessage(java.lang.String num, java.lang.String SMSCnum, java.lang.String mes, boolean ack, int valPer) throws ValidationException
num
- receiver address.SMSCnum
- Short Message Service Center number, MTS by default.mes
- message string up to 38760=255*152 characters.ack
- request for status report, if ack=true then status report will be requested at the SMS Center.valPer
- validity period.ValidationException
- If any parameter of OutMessage is invalid:
public OutMessage(java.lang.String num, java.lang.String SMSCnum, java.lang.String mes) throws ValidationException
num
- receiver address.SMSCnum
- Short Message Service Center number, MTS by default.mes
- message string up to 38760=255*152 characters.
ValidationException
- If any parameter of OutMessage is invalid:
public OutMessage(java.lang.String num, java.lang.String mes, boolean ack) throws ValidationException
num
- receiver address.mes
- message string up to 38760=255*152 characters.ack
- request for status report, if ack=true then status report will be requested at the SMSC Center.
ValidationException
- If any parameter of OutMessage is invalid:
public OutMessage(java.lang.String num, java.lang.String mes) throws ValidationException
num
- receiver addressmes
- message string up to 38760=255*152 characters
ValidationException
- If parameter is invalid.
public OutMessage()
Method Detail |
public static void setDefaultSMSCNumber(java.lang.String num) throws ValidationException
num
- default SMSC number, 79029869990 by default.ValidationException
- If parameter is invalid:
public static java.lang.String getDefaultSMSCNumber()
public void setValidityTime(int val) throws ValidationException
val
- validity period in validity period format: val value | Validity period value |
0 to 143 | (val + 1) * 5 minutes (i.e. 5 minutes intervals up to 12 hours) |
144 to 167 | 12 hours + ((val - 143) * 30 minutes) |
168 to 196 | (val - 166) * 1 day |
197 to 255 | (val - 192) * 1 week |
ValidationException
- If parameter is invalid: if validity period parameter value is less than 0 or more than 255. public void setRecipientNumber(java.lang.String num) throws ValidationException
num
- recipient number in national format without '+'.
ValidationException
- If parameter is invalid:
public void setACKRequest(boolean r)
r
- request for status report: If r is true then report will be requested at the SMSC Center.
public boolean getACKRequest()
public java.lang.String getSMSCNumber()
public void setSMSCNumber(java.lang.String num) throws ValidationException
num
- Short Message Service Center number in national format without '+'.
ValidationException
- If parameter is invalid:
public void setText(java.lang.String mess) throws ValidationException
mess
- - text of message up to 38760=255*152 characters.ValidationException
- If parameter is invalid:
public java.lang.String getRecipientNumber()
public int getValidityTime()
val value | Validity period value |
0 to 143 | (val + 1) * 5 minutes (i.e. 5 minutes intervals up to 12 hours) |
144 to 167 | 12 hours + ((val - 143) * 30 minutes) |
168 to 196 | (val - 166) * 1 day |
197 to 255 | (val - 192) * 1 week |
public java.lang.String getText()
public void setReplyPath(boolean repPath)
repPath
- reply path flag, if this parameter is true - reply path is specified, false - not public boolean getReplyPath()
public void setFlash(boolean f)
f
- flash flag, if f is true, then this message is indicated as flash, false - otherwise. The default value is false.public boolean isFlash()
public void setRejectDuplicates(boolean b)
b
- true means reject duplicates, false otherwise. The default value is false.public boolean getRejectDuplicates()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |