Package com.nexmo.client.sms.messages
Class Message
- java.lang.Object
-
- com.nexmo.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 Nexmo 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
All Methods Instance Methods Concrete Methods 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()
Get the value of the 'status-report-req' parameter.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)
-
-
-
Constructor Detail
-
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 sentfrom
- 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
-
-
Method Detail
-
getType
public Message.MessageType getType()
- Returns:
- int the type of message will influence the makeup of the request we post to the Nexmo server, and also the action taken by the Nexmo server in response to this message
-
getFrom
public java.lang.String getFrom()
- Returns:
- String 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 11 chars)
-
getTo
public java.lang.String getTo()
- Returns:
- String the phone number of the handset that you wish to send the message to
-
getClientReference
public java.lang.String getClientReference()
- Returns:
- String A user definable value that will be stored in the Nexmo sms records. It will be available in detailed reporting & analytics in order to help with reconciliation of messages
-
setClientReference
public void setClientReference(java.lang.String clientReference)
-
getMessageClass
public Message.MessageClass getMessageClass()
- Returns:
- com.nexmo.sms.verify.messages.parameters.MessageClass The message class that is to be applied to this message.
-
setMessageClass
public void setMessageClass(Message.MessageClass messageClass)
-
getTimeToLive
public java.lang.Long getTimeToLive()
-
setTimeToLive
public void setTimeToLive(java.lang.Long timeToLive)
-
getCallbackUrl
public java.lang.String getCallbackUrl()
-
setCallbackUrl
public void setCallbackUrl(java.lang.String callbackUrl)
-
getStatusReportRequired
public boolean getStatusReportRequired()
Get the value of the 'status-report-req' parameter.
-
setStatusReportRequired
public void setStatusReportRequired(boolean statusReportRequired)
Set the value of the 'status-report-req' parameter. If set to 'true', Nexmo will call 'callbackUrl' with status updates about the delivery of this message. If this value is set to 'true', then 'callbackUrl' should also be set to a URL that is configured to receive these status updates.- Parameters:
statusReportRequired
- 'true' if status reports are desired, 'false' otherwise.
-
addParams
public void addParams(org.apache.http.client.methods.RequestBuilder request)
-
-