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)
ExternalMessageBuilder
externalUserId
in interface ExternalMessageBuilder
externalUserId
- the external user idpublic ExternalMessageBuilder businessAccountId(String businessAccountId)
ExternalMessageBuilder
businessAccountId
in interface ExternalMessageBuilder
businessAccountId
- the bussiness account idpublic ExternalMessageBuilder messageId(String messageId)
ExternalMessageBuilder
messageId
in interface ExternalMessageBuilder
messageId
- the message idpublic ExternalMessageBuilder message(String message)
ExternalMessageBuilder
message
in interface ExternalMessageBuilder
message
- the message contentpublic void sendMessage()
ExternalMessageBuilder
sendMessage
in interface ExternalMessageBuilder
public void sendMediaMessage(String mediaId)
ExternalMessageBuilder
sendMediaMessage
in interface ExternalMessageBuilder
mediaId
- 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.