public class TlvMessagePayloadMessagePreparator extends BaseMessagePreparator
SubmitSm
s and places the message into the
Tlv
"message_payload"
parameter.
This preparator detects which charset should be used to encode message string
and splits it if needed. It also converts PhoneNumber
to
AddressedPhoneNumber
.
Constructor and Description |
---|
TlvMessagePayloadMessagePreparator(MessageSplitter messageSplitter,
DataCodingProvider dataCodingProvider)
The preparator can split messages and provide data coding information.
|
TlvMessagePayloadMessagePreparator(MessageSplitter messageSplitter,
DataCodingProvider dataCodingProvider,
PhoneNumberTranslator phoneNumberTranslator)
Initializes the preparator with message splitter, data coding provider
and phone number translator.
|
Modifier and Type | Method and Description |
---|---|
protected void |
fill(Sms originalMessage,
com.cloudhopper.smpp.pdu.SubmitSm submit,
Segment part)
Fill the
SubmitSm with the message content. |
prepareMessages
public TlvMessagePayloadMessagePreparator(MessageSplitter messageSplitter, DataCodingProvider dataCodingProvider)
The phone number won't be translated meaning that if phone number is not
already converted to AddressedPhoneNumber
then an
IllegalStateException
is thrown.
messageSplitter
- Split message in several parts if neededdataCodingProvider
- Determines the data coding to use according to encodingpublic TlvMessagePayloadMessagePreparator(MessageSplitter messageSplitter, DataCodingProvider dataCodingProvider, PhoneNumberTranslator phoneNumberTranslator)
messageSplitter
- Split message in several parts if neededdataCodingProvider
- Determines the data coding to use according to encodingphoneNumberTranslator
- Fallback phone translator to handle addressing policyprotected void fill(Sms originalMessage, com.cloudhopper.smpp.pdu.SubmitSm submit, Segment part) throws MessagePreparationException
BaseMessagePreparator
SubmitSm
with the message content.fill
in class BaseMessagePreparator
originalMessage
- the SMS that is about to be sentsubmit
- the submit to fillpart
- the message contentMessagePreparationException
- when message couldn't be prepared correctlyCopyright © 2021. All rights reserved.