public class WhatsAppJmsExternalConversationSystemAdapter extends Object implements WhatsAppExternalConversationSystemAdapter
Modifier and Type | Field and Description |
---|---|
protected JmsMessageOperations |
jmsMessagingOperations |
protected int |
maximumMessageSize |
protected com.fasterxml.jackson.databind.ObjectMapper |
objectMapper |
protected String |
outboundMessageDestination |
Constructor and Description |
---|
WhatsAppJmsExternalConversationSystemAdapter(JmsMessageOperations jmsMessagingOperations,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
String outboundMessageDestination,
int maximumMessageSize) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkMessageSize(String content) |
String |
convertAndCheckMessageSize(String message) |
WhatsAppContactVerificationQuery |
createContactVerificationQuery()
Create the verification query for WhatsApp contacts.
|
WhatsAppInteractiveMessageBuilder |
createInteractiveMessageBuilder()
Create a message builder for the WhatsApp interactive message.
|
ExternalMessageBuilder |
createMessageBuilder()
Creates the
ExternalMessageBuilder that is responsible for constructing the external message
for the give external user id. |
WhatsAppTemplateMessageBuilder |
createTemplateMessageBuilder()
Create a message builder for the WhatsApp template message.
|
String |
getExternalSystemId()
Returns the id of the external system implemented by this adapter.
|
void |
markMessageAsRead(String whatsAppMessageId,
String businessAccountId)
Mark a WhatsApp message as read with the given business account.
|
protected void |
send(Object payload,
String type) |
void |
sendMessageDuringCommitting(OutboundMessageDto outboundMessage) |
void |
sendOutboundMessage(OutboundMessageDto outboundMessage) |
void |
validateMessageContent(String messageContent,
String messageCategory)
Validates the content of the message.
|
void |
verifyContact(WhatsAppContactVerificationRequest payload) |
protected final JmsMessageOperations jmsMessagingOperations
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
protected final String outboundMessageDestination
protected final int maximumMessageSize
public WhatsAppJmsExternalConversationSystemAdapter(JmsMessageOperations jmsMessagingOperations, com.fasterxml.jackson.databind.ObjectMapper objectMapper, String outboundMessageDestination, int maximumMessageSize)
public String getExternalSystemId()
ExternalConversationSystemAdapter
getExternalSystemId
in interface ExternalConversationSystemAdapter
public ExternalMessageBuilder createMessageBuilder()
ExternalConversationSystemAdapter
ExternalMessageBuilder
that is responsible for constructing the external message
for the give external user id.
This is invoked by the engage system when sending out outbound messages.createMessageBuilder
in interface ExternalConversationSystemAdapter
ExternalMessageBuilder
public WhatsAppInteractiveMessageBuilder createInteractiveMessageBuilder()
WhatsAppExternalConversationSystemAdapter
createInteractiveMessageBuilder
in interface WhatsAppExternalConversationSystemAdapter
public WhatsAppTemplateMessageBuilder createTemplateMessageBuilder()
WhatsAppExternalConversationSystemAdapter
createTemplateMessageBuilder
in interface WhatsAppExternalConversationSystemAdapter
public WhatsAppContactVerificationQuery createContactVerificationQuery()
WhatsAppExternalConversationSystemAdapter
createContactVerificationQuery
in interface WhatsAppExternalConversationSystemAdapter
public void markMessageAsRead(String whatsAppMessageId, String businessAccountId)
WhatsAppExternalConversationSystemAdapter
markMessageAsRead
in interface WhatsAppExternalConversationSystemAdapter
whatsAppMessageId
- The id of the message in WhatsApp that should be marked as readbusinessAccountId
- The business account id for which the message should be marked as readpublic void validateMessageContent(String messageContent, String messageCategory)
ExternalConversationSystemAdapter
validateMessageContent
in interface ExternalConversationSystemAdapter
messageContent
- the content of the message that should be validatedmessageCategory
- the message categoryprotected boolean checkMessageSize(String content)
public void sendOutboundMessage(OutboundMessageDto outboundMessage)
public void sendMessageDuringCommitting(OutboundMessageDto outboundMessage)
public void verifyContact(WhatsAppContactVerificationRequest payload)