Class WeChatJmsExternalConversationSystemAdapter
- java.lang.Object
-
- com.flowable.engage.external.system.wechat.WeChatJmsExternalConversationSystemAdapter
-
- All Implemented Interfaces:
ExternalConversationSystemAdapter
,WeChatExternalConversationSystemAdapter
public class WeChatJmsExternalConversationSystemAdapter extends Object implements WeChatExternalConversationSystemAdapter
- Author:
- Filip Hrisafov
-
-
Field Summary
Fields Modifier and Type Field Description protected JmsMessageOperations
jmsMessagingOperations
protected int
maximumMessageSize
protected String
outboundMessageDestination
protected Collection<String>
supportedSendMessageTypes
protected WechatEmojiConverter
wechatEmojiConverter
-
Fields inherited from interface com.flowable.engage.external.system.api.ExternalConversationSystemAdapter
SEND_DOCUMENT, SEND_IMAGE, SEND_REPLY, SEND_VIDEO, SEND_VOICE
-
-
Constructor Summary
Constructors Constructor Description WeChatJmsExternalConversationSystemAdapter(JmsMessageOperations jmsMessagingOperations, String outboundMessageDestination, int maximumMessageSize, Collection<String> supportedSendMessageTypes, WechatEmojiConverter wechatEmojiConverter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkMessageSize(String content)
String
convertAndCheckMessageSize(String message)
ExternalMessageBuilder
createMessageBuilder()
Creates theExternalMessageBuilder
that is responsible for constructing the external message for the give external user id.WeChatTemplateMessageBuilder
createTemplateMessageBuilder()
Create a message builder for the WeChat template message.Collection<String>
fetchSupportedSendMessageTypes()
String
getExternalSystemId()
Returns the id of the external system implemented by this adapter.void
sendMessageDuringCommitting(OutboundMessageDto outboundMessage)
void
sendOutboundMessage(OutboundMessageDto outboundMessage)
void
validateMessageContent(String messageContent, String messageCategory)
Validates the content of the message.
-
-
-
Field Detail
-
jmsMessagingOperations
protected final JmsMessageOperations jmsMessagingOperations
-
outboundMessageDestination
protected final String outboundMessageDestination
-
maximumMessageSize
protected final int maximumMessageSize
-
wechatEmojiConverter
protected final WechatEmojiConverter wechatEmojiConverter
-
supportedSendMessageTypes
protected final Collection<String> supportedSendMessageTypes
-
-
Constructor Detail
-
WeChatJmsExternalConversationSystemAdapter
public WeChatJmsExternalConversationSystemAdapter(JmsMessageOperations jmsMessagingOperations, String outboundMessageDestination, int maximumMessageSize, Collection<String> supportedSendMessageTypes, WechatEmojiConverter wechatEmojiConverter)
-
-
Method Detail
-
getExternalSystemId
public 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
public ExternalMessageBuilder 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
public WeChatTemplateMessageBuilder createTemplateMessageBuilder()
Description copied from interface:WeChatExternalConversationSystemAdapter
Create a message builder for the WeChat template message.- Specified by:
createTemplateMessageBuilder
in interfaceWeChatExternalConversationSystemAdapter
- Returns:
- the template message builder
-
validateMessageContent
public void validateMessageContent(String messageContent, String messageCategory)
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 validatedmessageCategory
- the message category
-
fetchSupportedSendMessageTypes
public Collection<String> fetchSupportedSendMessageTypes()
- Specified by:
fetchSupportedSendMessageTypes
in interfaceExternalConversationSystemAdapter
- Returns:
- the types of messages that the adapter can send
-
checkMessageSize
protected boolean checkMessageSize(String content)
-
sendOutboundMessage
public void sendOutboundMessage(OutboundMessageDto outboundMessage)
-
sendMessageDuringCommitting
public void sendMessageDuringCommitting(OutboundMessageDto outboundMessage)
-
-