public class DeliveryReceipt extends Object
If the setRawErrorCode(String) method takes in a String that is not
parseable to an int via Integer.parseInt(String) then the
errorCode property will remain what it was originally set as,
default(int) or in the case of
parseShortMessage(String, DateTimeZone) -1.
| Modifier and Type | Field and Description |
|---|---|
static String |
FIELD_DLVRD |
static String |
FIELD_DONE_DATE |
static String |
FIELD_ERR |
static int |
FIELD_ERR_MAX_LEN |
static String |
FIELD_ID |
static String |
FIELD_STAT |
static String |
FIELD_SUB |
static String |
FIELD_SUBMIT_DATE |
static String |
FIELD_TEXT |
| Constructor and Description |
|---|
DeliveryReceipt() |
DeliveryReceipt(String messageId,
int submitCount,
int deliveredCount,
org.joda.time.DateTime submitDate,
org.joda.time.DateTime doneDate,
byte state,
int errorCode,
String text) |
DeliveryReceipt(String messageId,
int submitCount,
int deliveredCount,
org.joda.time.DateTime submitDate,
org.joda.time.DateTime doneDate,
byte state,
String errorCode,
String text) |
| Modifier and Type | Method and Description |
|---|---|
static void |
findFieldAndAddToTreeMap(String normalizedText,
String field,
TreeMap<Integer,String> fieldsByStartPos) |
int |
getDeliveredCount() |
org.joda.time.DateTime |
getDoneDate() |
int |
getErrorCode() |
String |
getMessageId() |
long |
getMessageIdAsLong() |
String |
getRawErrorCode() |
byte |
getState() |
int |
getSubmitCount() |
org.joda.time.DateTime |
getSubmitDate() |
String |
getText() |
static DeliveryReceipt |
parseShortMessage(String shortMessage,
org.joda.time.DateTimeZone zone) |
static DeliveryReceipt |
parseShortMessage(String shortMessage,
org.joda.time.DateTimeZone zone,
boolean checkMissingFields)
Parses the text of the short message and creates a DeliveryReceipt from
the fields.
|
void |
setDeliveredCount(int deliveredCount) |
void |
setDoneDate(org.joda.time.DateTime finalDate) |
void |
setErrorCode(int errorCode) |
void |
setMessageId(long messageId)
Sets the "id" field parameter as a long value that is zero padded to 10
digits.
|
void |
setMessageId(String messageId)
Sets the "id" field to the exact String we'll use.
|
void |
setRawErrorCode(String rawErrorCode)
Smpp 3.4 spec states that the "err" field is a <= 3 c-octet string, this
field takes that into account and will be chained with the
setErrorCode(int) field if the "err" field is valid |
void |
setState(byte state) |
void |
setSubmitCount(int submitCount) |
void |
setSubmitDate(org.joda.time.DateTime submitDate) |
void |
setText(String text) |
static String |
toMessageIdAsHexString(long value)
Converts a long value to a hex string.
|
static long |
toMessageIdAsLong(String value)
Converts a hex string to a long value.
|
String |
toShortMessage() |
static byte |
toState(String stateText) |
static String |
toStateText(byte state) |
String |
toString() |
public static final int FIELD_ERR_MAX_LEN
public static final String FIELD_ID
public static final String FIELD_SUB
public static final String FIELD_DLVRD
public static final String FIELD_SUBMIT_DATE
public static final String FIELD_DONE_DATE
public static final String FIELD_STAT
public static final String FIELD_ERR
public static final String FIELD_TEXT
public DeliveryReceipt()
public DeliveryReceipt(String messageId, int submitCount, int deliveredCount, org.joda.time.DateTime submitDate, org.joda.time.DateTime doneDate, byte state, int errorCode, String text)
public int getDeliveredCount()
public void setDeliveredCount(int deliveredCount)
public int getErrorCode()
public void setErrorCode(int errorCode)
public String getRawErrorCode()
public void setRawErrorCode(String rawErrorCode)
setErrorCode(int) field if the "err" field is validrawErrorCode - public org.joda.time.DateTime getDoneDate()
public void setDoneDate(org.joda.time.DateTime finalDate)
public String getMessageId()
public long getMessageIdAsLong()
throws NumberFormatException
NumberFormatExceptionpublic void setMessageId(String messageId)
messageId - public void setMessageId(long messageId)
messageId - public byte getState()
public void setState(byte state)
public int getSubmitCount()
public void setSubmitCount(int submitCount)
public org.joda.time.DateTime getSubmitDate()
public void setSubmitDate(org.joda.time.DateTime submitDate)
public String getText()
public void setText(String text)
public String toShortMessage()
public static void findFieldAndAddToTreeMap(String normalizedText, String field, TreeMap<Integer,String> fieldsByStartPos)
public static DeliveryReceipt parseShortMessage(String shortMessage, org.joda.time.DateTimeZone zone) throws DeliveryReceiptException
DeliveryReceiptExceptionpublic static DeliveryReceipt parseShortMessage(String shortMessage, org.joda.time.DateTimeZone zone, boolean checkMissingFields) throws DeliveryReceiptException
shortMessage - zone - DeliveryReceiptExceptionpublic static byte toState(String stateText)
public static String toStateText(byte state)
public static String toMessageIdAsHexString(long value)
value - public static long toMessageIdAsLong(String value) throws NumberFormatException
value - NumberFormatExceptionCopyright © 2009-2014 Cloudhopper by Twitter. All Rights Reserved.