Class WhatsAppJmsExternalConversationSystemAdapter
java.lang.Object
com.flowable.engage.external.system.whatsapp.WhatsAppJmsExternalConversationSystemAdapter
- All Implemented Interfaces:
ExternalConversationSystemAdapter
,WhatsAppExternalConversationSystemAdapter
public class WhatsAppJmsExternalConversationSystemAdapter extends java.lang.Object implements WhatsAppExternalConversationSystemAdapter
-
Field Summary
Fields Modifier and Type Field Description protected org.springframework.jms.core.JmsMessageOperations
jmsMessagingOperations
protected int
maximumMessageSize
protected com.fasterxml.jackson.databind.ObjectMapper
objectMapper
protected java.lang.String
outboundMessageDestination
-
Constructor Summary
Constructors Constructor Description WhatsAppJmsExternalConversationSystemAdapter(org.springframework.jms.core.JmsMessageOperations jmsMessagingOperations, com.fasterxml.jackson.databind.ObjectMapper objectMapper, java.lang.String outboundMessageDestination, int maximumMessageSize)
-
Method Summary
Modifier and Type Method Description protected boolean
checkMessageSize(java.lang.String content)
java.lang.String
convertAndCheckMessageSize(java.lang.String message)
WhatsAppContactVerificationQuery
createContactVerificationQuery()
Create the verification query for WhatsApp contacts.ExternalMessageBuilder
createMessageBuilder()
Creates theExternalMessageBuilder
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.java.lang.String
getExternalSystemId()
Returns the id of the external system implemented by this adapter.void
markMessageAsRead(java.lang.String whatsAppMessageId, java.lang.String businessAccountId)
Mark a WhatsApp message as read with the given business account.protected void
send(java.lang.Object payload, java.lang.String type)
void
sendMessageDuringCommitting(OutboundMessageDto outboundMessage)
void
sendOutboundMessage(OutboundMessageDto outboundMessage)
void
validateMessageContent(java.lang.String messageContent)
Validates the content of the message.void
verifyContact(WhatsAppContactVerificationRequest payload)
-
Field Details
-
jmsMessagingOperations
protected final org.springframework.jms.core.JmsMessageOperations jmsMessagingOperations -
objectMapper
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper -
outboundMessageDestination
protected final java.lang.String outboundMessageDestination -
maximumMessageSize
protected final int maximumMessageSize
-
-
Constructor Details
-
WhatsAppJmsExternalConversationSystemAdapter
public WhatsAppJmsExternalConversationSystemAdapter(org.springframework.jms.core.JmsMessageOperations jmsMessagingOperations, com.fasterxml.jackson.databind.ObjectMapper objectMapper, java.lang.String outboundMessageDestination, int maximumMessageSize)
-
-
Method Details
-
getExternalSystemId
public java.lang.String getExternalSystemId()Description copied from interface:ExternalConversationSystemAdapter
Returns the id of the external system implemented by this adapter.- Specified by:
getExternalSystemId
in interfaceExternalConversationSystemAdapter
- Returns:
- the external system id implemented by this adapter
-
createMessageBuilder
Description copied from interface:ExternalConversationSystemAdapter
Creates theExternalMessageBuilder
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.- Specified by:
createMessageBuilder
in interfaceExternalConversationSystemAdapter
- Returns:
- the
ExternalMessageBuilder
-
createTemplateMessageBuilder
Description copied from interface:WhatsAppExternalConversationSystemAdapter
Create a message builder for the WhatsApp template message.- Specified by:
createTemplateMessageBuilder
in interfaceWhatsAppExternalConversationSystemAdapter
- Returns:
- the template message builder
-
createContactVerificationQuery
Description copied from interface:WhatsAppExternalConversationSystemAdapter
Create the verification query for WhatsApp contacts.- Specified by:
createContactVerificationQuery
in interfaceWhatsAppExternalConversationSystemAdapter
- Returns:
- the verification query
-
markMessageAsRead
public void markMessageAsRead(java.lang.String whatsAppMessageId, java.lang.String businessAccountId)Description copied from interface:WhatsAppExternalConversationSystemAdapter
Mark a WhatsApp message as read with the given business account.- Specified by:
markMessageAsRead
in interfaceWhatsAppExternalConversationSystemAdapter
- Parameters:
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 read
-
validateMessageContent
public void validateMessageContent(java.lang.String messageContent)Description copied from interface:ExternalConversationSystemAdapter
Validates the content of the message. If the content is invalid an exception should be thrown.- Specified by:
validateMessageContent
in interfaceExternalConversationSystemAdapter
- Parameters:
messageContent
- the content of the message that should be validated
-
convertAndCheckMessageSize
public java.lang.String convertAndCheckMessageSize(java.lang.String message) -
checkMessageSize
protected boolean checkMessageSize(java.lang.String content) -
sendOutboundMessage
-
sendMessageDuringCommitting
-
verifyContact
-
send
protected void send(java.lang.Object payload, java.lang.String type)
-