public class SmesMessageSpecification
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static SmesMessageSpecification |
fromMessage(org.jsmpp.session.ClientSession smppSession,
org.springframework.messaging.Message<?> msg)
this method will take an inbound Spring Integration
Message
and map it to a SmesMessageSpecification
which we can use to send the SMS message. |
static SmesMessageSpecification |
newSmesMessageSpecification(org.jsmpp.session.ClientSession ss,
java.lang.String srcAddress,
java.lang.String destAddress,
java.lang.String txtMessage)
Conceptually, you could get away with just specifying these three parameters,
though I don't know how likely that is in practice.
|
protected SmesMessageSpecification |
reset()
Resets the thread local, pooled objects to a known state before reuse.
|
java.util.List<java.lang.String> |
send()
send the message on its way.
|
SmesMessageSpecification |
setDataCoding(org.jsmpp.bean.DataCoding dataCoding) |
SmesMessageSpecification |
setDestinationAddress(java.lang.String destinationAddr)
the 'to' phone number
|
SmesMessageSpecification |
setDestinationAddressNumberingPlanIndicator(org.jsmpp.bean.NumberingPlanIndicator destAddrNpi) |
SmesMessageSpecification |
setDestinationAddressTypeOfNumber(org.jsmpp.bean.TypeOfNumber destAddrTon) |
SmesMessageSpecification |
setEsmClass(org.jsmpp.bean.ESMClass esmClass) |
void |
setMaxLengthSmsMessages(int maxLengthSmsMessages)
this is a good value, but not strictly speaking universal.
|
SmesMessageSpecification |
setPriorityFlag(byte pf) |
SmesMessageSpecification |
setProtocolId(byte protocolId) |
SmesMessageSpecification |
setRegisteredDelivery(org.jsmpp.bean.RegisteredDelivery rd) |
SmesMessageSpecification |
setReplaceIfPresentFlag(byte replaceIfPresentFlag) |
SmesMessageSpecification |
setScheduleDeliveryTime(java.util.Date d) |
SmesMessageSpecification |
setServiceType(java.lang.String serviceType) |
SmesMessageSpecification |
setShortMessageUsingPayload(java.lang.String s)
Setting short message using message_payload (
OptionalParameter.Tag.MESSAGE_PAYLOAD)
optional parameter |
SmesMessageSpecification |
setShortTextMessage(java.lang.String s)
Setting short message.
|
SmesMessageSpecification |
setSmDefaultMsgId(byte smDefaultMsgId) |
SmesMessageSpecification |
setSourceAddress(java.lang.String sourceAddr) |
SmesMessageSpecification |
setSourceAddressIfRequired(java.lang.String defaultSourceAddress) |
SmesMessageSpecification |
setSourceAddressNumberingPlanIndicator(org.jsmpp.bean.NumberingPlanIndicator sourceAddrNpi) |
SmesMessageSpecification |
setSourceAddressTypeOfNumber(org.jsmpp.bean.TypeOfNumber sourceAddrTon) |
SmesMessageSpecification |
setSourceAddressTypeOfNumberIfRequired(org.jsmpp.bean.TypeOfNumber sourceAddressTypeOfNumberIfRequired)
Only sets the #sourceAddressTypeOfNumber if the current value is null, otherwise, it leaves it.
|
SmesMessageSpecification |
setTimeFormatter(org.jsmpp.util.TimeFormatter timeFormatter) |
SmesMessageSpecification |
setValidityPeriod(java.lang.String v)
When you submit a message to an SMSC, it is possible to sometimes specify a
validity period for the message.
|
static org.springframework.messaging.Message<?> |
toMessageFromSms(org.jsmpp.bean.DeliverSm dsm,
java.lang.String txtMessage)
This method takes an inbound SMS message and converts it to a Spring Integration message
|
protected void |
validate() |
public static org.springframework.messaging.Message<?> toMessageFromSms(org.jsmpp.bean.DeliverSm dsm,
java.lang.String txtMessage)
dsm - the DeliverSm from
AbstractReceivingMessageListener.onTextMessage(org.jsmpp.bean.DeliverSm, String)txtMessage - the String from
AbstractReceivingMessageListener.onTextMessage(org.jsmpp.bean.DeliverSm, String)public static SmesMessageSpecification fromMessage(org.jsmpp.session.ClientSession smppSession, org.springframework.messaging.Message<?> msg)
Message
and map it to a SmesMessageSpecification
which we can use to send the SMS message.msg - a new MessagesmppSession - the SMPPSessionSmesMessageSpecificationpublic static SmesMessageSpecification newSmesMessageSpecification(org.jsmpp.session.ClientSession ss, java.lang.String srcAddress, java.lang.String destAddress, java.lang.String txtMessage)
srcAddress - the source addressdestAddress - the destination addresstxtMessage - the message to send (must be no more than 140 charactersss - the SMPPSessionSmesMessageSpecificationpublic SmesMessageSpecification setSourceAddressTypeOfNumberIfRequired(org.jsmpp.bean.TypeOfNumber sourceAddressTypeOfNumberIfRequired)
sourceAddressTypeOfNumberIfRequired - the TypeOfNumberpublic java.util.List<java.lang.String> send()
throws java.lang.Exception
java.lang.Exception - the
SMPPSession.submitShortMessage(String, org.jsmpp.bean.TypeOfNumber,
org.jsmpp.bean.NumberingPlanIndicator, String, org.jsmpp.bean.TypeOfNumber,
org.jsmpp.bean.NumberingPlanIndicator, String, org.jsmpp.bean.ESMClass,
byte, byte, String, String, org.jsmpp.bean.RegisteredDelivery, byte,
org.jsmpp.bean.DataCoding, byte, byte[], org.jsmpp.bean.OptionalParameter...)
method throws lots of Exceptions, including IOExceptionprotected void validate()
public SmesMessageSpecification setSourceAddress(java.lang.String sourceAddr)
public SmesMessageSpecification setDestinationAddress(java.lang.String destinationAddr)
destinationAddr - the phone numberpublic SmesMessageSpecification setServiceType(java.lang.String serviceType)
public SmesMessageSpecification setSourceAddressTypeOfNumber(org.jsmpp.bean.TypeOfNumber sourceAddrTon)
public SmesMessageSpecification setSourceAddressNumberingPlanIndicator(org.jsmpp.bean.NumberingPlanIndicator sourceAddrNpi)
public SmesMessageSpecification setDestinationAddressTypeOfNumber(org.jsmpp.bean.TypeOfNumber destAddrTon)
public SmesMessageSpecification setDestinationAddressNumberingPlanIndicator(org.jsmpp.bean.NumberingPlanIndicator destAddrNpi)
public SmesMessageSpecification setEsmClass(org.jsmpp.bean.ESMClass esmClass)
public SmesMessageSpecification setProtocolId(byte protocolId)
public SmesMessageSpecification setPriorityFlag(byte pf)
public SmesMessageSpecification setValidityPeriod(java.lang.String v)
v - the period of validity. There are specific formats for this,
however this method provides no validation.
todo provide format validation if possiblepublic SmesMessageSpecification setScheduleDeliveryTime(java.util.Date d)
public SmesMessageSpecification setRegisteredDelivery(org.jsmpp.bean.RegisteredDelivery rd)
public SmesMessageSpecification setReplaceIfPresentFlag(byte replaceIfPresentFlag)
public SmesMessageSpecification setDataCoding(org.jsmpp.bean.DataCoding dataCoding)
public SmesMessageSpecification setSmDefaultMsgId(byte smDefaultMsgId)
public SmesMessageSpecification setTimeFormatter(org.jsmpp.util.TimeFormatter timeFormatter)
public SmesMessageSpecification setShortTextMessage(java.lang.String s)
dataCoding
or if maxLengthSmsMessages
is set through header to validate the maximum characters can be set.s - the text message bodypublic SmesMessageSpecification setShortMessageUsingPayload(java.lang.String s)
OptionalParameter.Tag.MESSAGE_PAYLOAD)
optional parameters - the text messages bodypublic void setMaxLengthSmsMessages(int maxLengthSmsMessages)
maxLengthSmsMessages - the length of sms messagessetShortTextMessage(String)protected SmesMessageSpecification reset()
SmesMessageSpecificationpublic SmesMessageSpecification setSourceAddressIfRequired(java.lang.String defaultSourceAddress)