public class InboundMessageRoutingServiceImpl extends Object implements InboundMessageRoutingService
Modifier and Type | Field and Description |
---|---|
protected boolean |
alwaysSendSystemEvent |
protected ConversationService |
conversationService |
static String |
EVENT_KEY_EXTERNAL_MESSAGE_RECEIVED |
protected EventRegistry |
eventRegistry |
protected ExternalSystemContentService |
externalSystemContentService |
protected InboundMessageEventPayloadExtractor |
inboundMessageEventPayloadExtractor |
protected MessageService |
messageService |
Constructor and Description |
---|
InboundMessageRoutingServiceImpl(MessageService messageService,
ConversationService conversationService,
ExternalSystemContentService externalSystemContentService,
EventRegistry eventRegistry,
InboundMessageEventPayloadExtractor inboundMessageEventPayloadExtractor) |
Modifier and Type | Method and Description |
---|---|
protected Collection<EventPayloadInstance> |
extractEventPayload(InboundMessage inboundMessage,
UserAccount userAccount,
Message message) |
protected Map<String,String> |
extractHints(InboundMessage inboundMessage) |
String |
findConversationForUserAccount(UserAccount userAccount)
Find the conversation id for the given
userAccount . |
protected Message |
getReplyToMessage(String externalSystemId,
String replyToExternalMessageId) |
boolean |
isAlwaysSendSystemEvent() |
protected boolean |
isDuplicateMessage(String externalId) |
void |
routeInboundMessage(InboundMessage inboundMessage,
UserAccount userAccount)
Route the inbound message to a conversation for the give
userAccount |
void |
setAlwaysSendSystemEvent(boolean alwaysSendSystemEvent) |
public static final String EVENT_KEY_EXTERNAL_MESSAGE_RECEIVED
protected final MessageService messageService
protected final ConversationService conversationService
protected final ExternalSystemContentService externalSystemContentService
protected final EventRegistry eventRegistry
protected final InboundMessageEventPayloadExtractor inboundMessageEventPayloadExtractor
protected boolean alwaysSendSystemEvent
public InboundMessageRoutingServiceImpl(MessageService messageService, ConversationService conversationService, ExternalSystemContentService externalSystemContentService, EventRegistry eventRegistry, InboundMessageEventPayloadExtractor inboundMessageEventPayloadExtractor)
public void routeInboundMessage(InboundMessage inboundMessage, UserAccount userAccount)
InboundMessageRoutingService
userAccount
routeInboundMessage
in interface InboundMessageRoutingService
inboundMessage
- the received message from the external systemuserAccount
- the user account that the message belongs toprotected Collection<EventPayloadInstance> extractEventPayload(InboundMessage inboundMessage, UserAccount userAccount, Message message)
protected Map<String,String> extractHints(InboundMessage inboundMessage)
public String findConversationForUserAccount(UserAccount userAccount)
InboundMessageRoutingService
userAccount
.
The conversation id is the if of the conversation that
can be used to route messages into.findConversationForUserAccount
in interface InboundMessageRoutingService
userAccount
- the user accountnull
protected boolean isDuplicateMessage(String externalId)
protected Message getReplyToMessage(String externalSystemId, String replyToExternalMessageId)
public boolean isAlwaysSendSystemEvent()
public void setAlwaysSendSystemEvent(boolean alwaysSendSystemEvent)