SMSLib 3.5.3

org.smslib
Class OutboundMessage

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

public class OutboundMessage
extends Message

Class representing an outbound sms message.

See Also:
Serialized Form

Nested Class Summary
static class OutboundMessage.FailureCauses
          Enumeration representing the failure reasons of a failed outbound message.
static class OutboundMessage.MessageStatuses
          Class representing the status of an outbound message.
 
Nested classes/interfaces inherited from class org.smslib.Message
Message.MessageClasses, Message.MessageEncodings, Message.MessageTypes
 
Constructor Summary
OutboundMessage()
          Outbound message constructor.
OutboundMessage(java.lang.String myRecipient, java.lang.String text)
          Outbound message constructor.
 
Method Summary
 long getDeliveryDelay()
           
 java.util.Date getDispatchDate()
          Returns the dispatch date of this message.
 java.lang.String getErrorMessage()
          Returns the error message associated with the failure of this outbound message to be sent out.
 OutboundMessage.FailureCauses getFailureCause()
           
 boolean getFlashSms()
          Returns true if this message is to be sent out as a flash SMS.
 java.lang.String getFrom()
          Receives the custom originator string.
 OutboundMessage.MessageStatuses getMessageStatus()
          Returns the message status.
 java.util.List<java.lang.String> getPdus(java.lang.String smscNumber, int mpRefNo)
           
 java.lang.String getPduUserData()
           
 java.lang.String getPduUserDataHeader()
           
 int getPriority()
          Returns the priority of the message.
 java.lang.String getRecipient()
          Returns the recipient of this outbound message.
 java.lang.String getRefNo()
          Returns the message Reference Number.
 int getRetryCount()
          Return value of internal sending retry counter.
 java.util.Date getScheduledDeliveryDate()
           
 boolean getStatusReport()
          Returns true if a status/delivery report will be asked for this message.
 int getValidityPeriod()
          Returns the message validity period (in hours).
 void setDeliveryDelay(long deliveryDelay)
           
 void setDispatchDate(java.util.Date myDispatchDate)
           
 void setEncoding(Message.MessageEncodings encoding)
          Sets the message encoding to the specified one.
 void setErrorMessage(java.lang.String errorMessage)
           
 void setFailureCause(OutboundMessage.FailureCauses myFailureCause)
          Mark message as failed and set cause of failure.
 void setFlashSms(boolean flashSms)
          Set the flash message indication.
 void setFrom(java.lang.String myFrom)
          Sets the custom originator string.
 void setMessageStatus(OutboundMessage.MessageStatuses myMessageStatus)
           
 void setPriority(int myPriority)
          Sets the priority of the message.
 void setRecipient(java.lang.String myRecipient)
          Set the recipient of the message.
 void setRefNo(java.lang.String myRefNo)
           
 void setRetryCount(int myRetryCount)
           
 void setScheduledDeliveryDate(java.util.Date scheduledDeliveryDate)
           
 void setStatusReport(boolean myStatusReport)
          Sets the status report request.
 void setValidityPeriod(int myValidityPeriod)
          Sets the message validity period.
 java.lang.String toString()
           
 
Methods inherited from class org.smslib.Message
addText, getDate, getDCSMessageClass, getDstPort, getEncoding, getGatewayId, getId, getMessageId, getSrcPort, getText, getType, getUuid, setDate, setDCSMessageClass, setDstPort, setGatewayId, setId, setSrcPort, setText
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OutboundMessage

public OutboundMessage()
Outbound message constructor. This parameterless constructor creates an empty outbound message.

See Also:
OutboundMessage(String, String)

OutboundMessage

public OutboundMessage(java.lang.String myRecipient,
                       java.lang.String text)
Outbound message constructor.

Parameters:
myRecipient - The recipient of the message.
text - The text of the message.
Method Detail

getRecipient

public java.lang.String getRecipient()
Returns the recipient of this outbound message.

Returns:
The recipient of the message.
See Also:
setRecipient(String)

setRecipient

public void setRecipient(java.lang.String myRecipient)
Set the recipient of the message.

Parameters:
myRecipient - The recipient of the message.
See Also:
getRecipient()

getDispatchDate

public java.util.Date getDispatchDate()
Returns the dispatch date of this message. If the message has not been sent yet, the dispatch date is null.

Returns:
The message dispatch date.

setDispatchDate

public void setDispatchDate(java.util.Date myDispatchDate)

getFlashSms

public boolean getFlashSms()
Returns true if this message is to be sent out as a flash SMS. Otherwise, it returns false.

Returns:
True for a Flash message.
See Also:
setFlashSms(boolean)

setFlashSms

public void setFlashSms(boolean flashSms)
Set the flash message indication. Set this to true for this message to be sent as a flash message. Flash messages appear directly on the handset, so use this feature with care, because it may be a bit annoying. Furthermore, keep in mind that flash messaging is not supported on all phones.

The default is non-flash (false).

Parameters:
flashSms - True for a flash sms.

getStatusReport

public boolean getStatusReport()
Returns true if a status/delivery report will be asked for this message.

Returns:
True if a status report will be generated.

setStatusReport

public void setStatusReport(boolean myStatusReport)
Sets the status report request. If you set it to true, a status report message will be generated, otherwise no status report message will be generated.

The default is (false).

Parameters:
myStatusReport - The status report request status.

getValidityPeriod

public int getValidityPeriod()
Returns the message validity period (in hours).

Returns:
The message validity period.
See Also:
setValidityPeriod(int)

setValidityPeriod

public void setValidityPeriod(int myValidityPeriod)
Sets the message validity period.

Parameters:
myValidityPeriod - The message validity period in hours.
See Also:
getValidityPeriod()

getFrom

public java.lang.String getFrom()
Receives the custom originator string. Set it to empty string to leave the default behavior.

Returns:
The custom originator string.
See Also:
setFrom(String)

setFrom

public void setFrom(java.lang.String myFrom)
Sets the custom originator string. Some gateways allow you to define a custom string as the originator. When the message arrives at the recipient, the latter will not see your number but this string.

Note that this functionality is not supported on GSM modems / phones. It is supported on most bulk sms operators.

Parameters:
myFrom - The custom originator string.
See Also:
getFrom()

getMessageStatus

public OutboundMessage.MessageStatuses getMessageStatus()
Returns the message status.

Returns:
The message status.
See Also:
OutboundMessage.MessageStatuses

setMessageStatus

public void setMessageStatus(OutboundMessage.MessageStatuses myMessageStatus)

getFailureCause

public OutboundMessage.FailureCauses getFailureCause()

setFailureCause

public void setFailureCause(OutboundMessage.FailureCauses myFailureCause)
Mark message as failed and set cause of failure.

Parameters:
myFailureCause - Cause of failure

getRetryCount

public int getRetryCount()
Return value of internal sending retry counter.

Returns:
Number of sending message retries

setRetryCount

public void setRetryCount(int myRetryCount)

getPriority

public int getPriority()
Returns the priority of the message.

Returns:
The priority of the message.

setPriority

public void setPriority(int myPriority)
Sets the priority of the message.

Parameters:
myPriority - The new priority.

getRefNo

public java.lang.String getRefNo()
Returns the message Reference Number. The Reference Number comes into existence when the message is sent. Its format depends on the gateway: For modems, its a number. For bulk sms operators, this is a hex string. If the message has not been sent yet, the Reference number is blank.

Returns:
The message reference number.

setRefNo

public void setRefNo(java.lang.String myRefNo)

getErrorMessage

public java.lang.String getErrorMessage()
Returns the error message associated with the failure of this outbound message to be sent out.

Returns:
The error message.

setErrorMessage

public void setErrorMessage(java.lang.String errorMessage)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPdus

public java.util.List<java.lang.String> getPdus(java.lang.String smscNumber,
                                                int mpRefNo)

getPduUserData

public java.lang.String getPduUserData()
Specified by:
getPduUserData in class Message

getPduUserDataHeader

public java.lang.String getPduUserDataHeader()
Specified by:
getPduUserDataHeader in class Message

setEncoding

public void setEncoding(Message.MessageEncodings encoding)
Description copied from class: Message
Sets the message encoding to the specified one.

Overrides:
setEncoding in class Message
Parameters:
encoding - The message encoding.
See Also:
Message.getEncoding(), Message.MessageEncodings

setScheduledDeliveryDate

public void setScheduledDeliveryDate(java.util.Date scheduledDeliveryDate)

getScheduledDeliveryDate

public java.util.Date getScheduledDeliveryDate()

getDeliveryDelay

public long getDeliveryDelay()

setDeliveryDelay

public void setDeliveryDelay(long deliveryDelay)

SMSLib 3.5.3

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