Class Message

java.lang.Object
com.vonage.client.sms.messages.Message
Direct Known Subclasses:
BinaryMessage, TextMessage, WapPushMessage

public abstract class Message
extends java.lang.Object
Represents the details common to any message that is to be submitted to the Vonage SMS API.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  Message.MessageClass
    An enum of the valid values that may be supplied to as the message-class parameter of a rest submission.
    static class  Message.MessageType  
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected Message​(Message.MessageType type, java.lang.String from, java.lang.String to)  
    protected Message​(Message.MessageType type, java.lang.String from, java.lang.String to, boolean statusReportRequired)
    Abstract type for more specific SMS message types.
    This constructor exposes the full range of possible parameters and is not for general use Instead, it is accessed via super() in the constructors of various sub-classes that expose a relevant sub-set of the available parameters
  • Method Summary

    Modifier and Type Method Description
    void addParams​(org.apache.http.client.methods.RequestBuilder request)  
    java.lang.String getCallbackUrl()  
    java.lang.String getClientReference()  
    java.lang.String getFrom()  
    Message.MessageClass getMessageClass()  
    boolean getStatusReportRequired()  
    java.lang.Long getTimeToLive()  
    java.lang.String getTo()  
    Message.MessageType getType()  
    void setCallbackUrl​(java.lang.String callbackUrl)  
    void setClientReference​(java.lang.String clientReference)  
    void setMessageClass​(Message.MessageClass messageClass)  
    void setStatusReportRequired​(boolean statusReportRequired)
    Set the value of the 'status-report-req' parameter.
    void setTimeToLive​(java.lang.Long timeToLive)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Message

      protected Message​(Message.MessageType type, java.lang.String from, java.lang.String to)
    • Message

      protected Message​(Message.MessageType type, java.lang.String from, java.lang.String to, boolean statusReportRequired)
      Abstract type for more specific SMS message types.
      This constructor exposes the full range of possible parameters and is not for general use Instead, it is accessed via super() in the constructors of various sub-classes that expose a relevant sub-set of the available parameters
      Parameters:
      type - the type of SMS message to be sent
      from - the 'from' address that will be seen on the handset when this message arrives, typically either a valid short-code / long code that can be replied to, or a short text description of the application sending the message (Max 15 chars)
      to - the phone number of the handset you wish to send the message to
      statusReportRequired - if set to true, status updates about the delivery of this message will be returned.
  • Method Details