public abstract class ExecuteSendMessageCommandAction<T extends MessageCommandEvent> extends BaseEventBotAction
messageIsSentToRemoteNode, which defaults to true is used
to determine if response listeners for a response from the remote node are to be registeredlogger| Modifier | Constructor and Description |
|---|---|
|
ExecuteSendMessageCommandAction(EventListenerContext eventListenerContext) |
protected |
ExecuteSendMessageCommandAction(EventListenerContext eventListenerContext,
boolean messageIsSentToRemoteNode) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract MessageCommandFailureEvent |
createLocalNodeFailureEvent(T originalCommand,
WonMessage messageSent,
FailureResponseEvent failureResponseEvent)
Implementations can choose to return null here if they do not want an event published.
|
protected abstract MessageCommandSuccessEvent |
createLocalNodeSuccessEvent(T originalCommand,
WonMessage messageSent,
SuccessResponseEvent successResponseEvent)
Implementations can choose to return null here if they do not want an event published.
|
protected abstract MessageCommandNotSentEvent |
createMessageNotSentEvent(T originalCommand,
java.lang.String message)
Implementations can choose to return null here if they do not want an event published.
|
protected abstract MessageCommandFailureEvent |
createRemoteNodeFailureEvent(T originalCommand,
WonMessage messageSent,
FailureResponseEvent failureResponseEvent)
Implementations can choose to return null here if they do not want an event published.
|
protected abstract MessageCommandSuccessEvent |
createRemoteNodeSuccessEvent(T originalCommand,
WonMessage messageSent,
SuccessResponseEvent successResponseEvent)
Implementations can choose to return null here if they do not want an event published.
|
protected abstract WonMessage |
createWonMessage(T messageCommandEvent)
Implementations must return a valid WoNMessage here or perform adequate logging and publish an MessageCommandFailureEvent and return null.
|
void |
doRun(Event event,
EventListener executingListener)
Constructs the message via
createWonMessage and registers a listener for the response from the
local WoN node and, if messageIsSenttoRemoteNode is true, a listener for the response from the
remote WoN node. |
getActionTask, getEventListenerContextprotected ExecuteSendMessageCommandAction(EventListenerContext eventListenerContext, boolean messageIsSentToRemoteNode)
public ExecuteSendMessageCommandAction(EventListenerContext eventListenerContext)
public final void doRun(Event event, EventListener executingListener)
createWonMessage and registers a listener for the response from the
local WoN node and, if messageIsSenttoRemoteNode is true, a listener for the response from the
remote WoN node.doRun in class BaseEventBotActionevent - executingListener - protected abstract MessageCommandFailureEvent createRemoteNodeFailureEvent(T originalCommand, WonMessage messageSent, FailureResponseEvent failureResponseEvent)
protected abstract MessageCommandSuccessEvent createRemoteNodeSuccessEvent(T originalCommand, WonMessage messageSent, SuccessResponseEvent successResponseEvent)
protected abstract MessageCommandFailureEvent createLocalNodeFailureEvent(T originalCommand, WonMessage messageSent, FailureResponseEvent failureResponseEvent)
protected abstract MessageCommandSuccessEvent createLocalNodeSuccessEvent(T originalCommand, WonMessage messageSent, SuccessResponseEvent successResponseEvent)
protected abstract MessageCommandNotSentEvent createMessageNotSentEvent(T originalCommand, java.lang.String message)
protected abstract WonMessage createWonMessage(T messageCommandEvent) throws WonMessageBuilderException
WonMessageBuilderExceptionCopyright © 2018. All Rights Reserved.