Package com.vonage.client.sms.messages
Class Message
java.lang.Object
com.vonage.client.sms.messages.Message
- All Implemented Interfaces:
QueryParamsRequest
- Direct Known Subclasses:
BinaryMessage,TextMessage
Represents the details common to any message that is to be submitted to the Vonage SMS API.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enum of the valid values that may be supplied to as the message-class parameter of a rest submission.static enum -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMessage(Message.MessageType type, String from, String to) protectedMessage(Message.MessageType type, String from, 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 TypeMethodDescriptiongetFrom()booleangetTo()getType()Internal method for serializing the fields of this class into query parameters.voidsetCallbackUrl(String callbackUrl) voidsetClientReference(String clientReference) voidsetContentId(String contentId) voidsetEntityId(String entityId) voidsetMessageClass(Message.MessageClass messageClass) voidsetStatusReportRequired(boolean statusReportRequired) Set the value of the 'status-report-req' parameter.voidsetTimeToLive(Long timeToLive)
-
Constructor Details
-
Message
-
Message
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 tostatusReportRequired- flag to enable status updates about the delivery of this message
-
-
Method Details
-
getType
- Returns:
- int the type of message will influence the makeup of the request we post to the Vonage server, and also the action taken by the Vonage server in response to this message
-
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
- Returns:
- String the phone number of the handset that you wish to send the message to
-
getClientReference
- Returns:
- String A user definable value that will be stored in the Vonage sms records. It will be available in detailed reporting and analytics in order to help with reconciliation of messages
-
setClientReference
-
getMessageClass
- Returns:
Message.MessageClassThe message class that is to be applied to this message.
-
setMessageClass
-
getTimeToLive
-
setTimeToLive
-
getCallbackUrl
-
setCallbackUrl
-
getEntityId
-
setEntityId
-
getContentId
-
setContentId
-
getStatusReportRequired
- Returns:
- get the value of the 'status-report-req' parameter.
-
setStatusReportRequired
Set the value of the 'status-report-req' parameter.If set to 'true', Vonage 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.
-
makeParams
Description copied from interface:QueryParamsRequestInternal method for serializing the fields of this class into query parameters. The Map should be mutable so that subclasses can add fields, otherwise the method or implementing class should be marked asfinal. Duplicate entries can be handled by mapping the key to a list of the entries.- Specified by:
makeParamsin interfaceQueryParamsRequest- Returns:
- The query parameters as unique key-value pairs.
-