public abstract class BaseExternalMessageBuilder extends Object implements ExternalMessageBuilder
| Modifier and Type | Field and Description |
|---|---|
protected String |
businessAccountId |
protected String |
externalUserId |
protected String |
message |
protected String |
messageId |
| Constructor and Description |
|---|
BaseExternalMessageBuilder() |
| Modifier and Type | Method and Description |
|---|---|
ExternalMessageBuilder |
businessAccountId(String businessAccountId)
The id of the business account for the external user
|
protected void |
checkBeforeSend(String type)
Perform certain checks before sending the message.
|
protected OutboundMessageDto |
createOutboundMessage(String type) |
ExternalMessageBuilder |
externalUserId(String externalUserId)
The id of the external user to which the message should be send to
|
ExternalMessageBuilder |
message(String message)
The contents of the message that needs to be send
|
ExternalMessageBuilder |
messageId(String messageId)
The id of the message being send (can be used for logging purposes)
|
void |
sendMediaMessage(String mediaId)
Perform sending of media message
|
void |
sendMessage()
Perform sending a normal text message
|
protected abstract void |
sendOutboundMessage(OutboundMessageDto outboundMessage) |
protected String |
validateAndCreateMessageContent(String type)
This method is invoked when the content for the outbound message is create.
|
protected String externalUserId
protected String businessAccountId
protected String messageId
protected String message
public ExternalMessageBuilder externalUserId(String externalUserId)
ExternalMessageBuilderexternalUserId in interface ExternalMessageBuilderexternalUserId - the external user idpublic ExternalMessageBuilder businessAccountId(String businessAccountId)
ExternalMessageBuilderbusinessAccountId in interface ExternalMessageBuilderbusinessAccountId - the bussiness account idpublic ExternalMessageBuilder messageId(String messageId)
ExternalMessageBuildermessageId in interface ExternalMessageBuildermessageId - the message idpublic ExternalMessageBuilder message(String message)
ExternalMessageBuildermessage in interface ExternalMessageBuildermessage - the message contentpublic void sendMessage()
ExternalMessageBuildersendMessage in interface ExternalMessageBuilderpublic void sendMediaMessage(String mediaId)
ExternalMessageBuildersendMediaMessage in interface ExternalMessageBuildermediaId - the id of the media that is being sentprotected void checkBeforeSend(String type)
externalUserId and messageId
have been set.type - the type of message that is being sendprotected abstract void sendOutboundMessage(OutboundMessageDto outboundMessage)
protected OutboundMessageDto createOutboundMessage(String type)
protected String validateAndCreateMessageContent(String type)
type - the type of the message for which the content is being createdCopyright © 2019. All rights reserved.