Package org.citrusframework.message
Class AbstractMessageProcessor
java.lang.Object
org.citrusframework.message.AbstractMessageProcessor
- All Implemented Interfaces:
MessageDirectionAware,MessageProcessor,MessageTransformer,MessageTypeSelector
public abstract class AbstractMessageProcessor
extends Object
implements MessageProcessor, MessageDirectionAware, MessageTypeSelector
Abstract message processor is message direction aware and automatically applies message type selector.
Subclasses can modify payload and/or headers of the processed message.
- Author:
- Christoph Deppisch
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.citrusframework.message.MessageProcessor
MessageProcessor.Builder<T extends MessageProcessor,B extends MessageProcessor.Builder<T, B>> -
Field Summary
Fields inherited from interface org.citrusframework.message.MessageProcessor
RESOURCE_PATH, TYPE_RESOLVER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIndicates the direction of messages this processor should apply to.protected StringgetName()Gets this processors name.voidprocess(Message message, TestContext context) Process message with given test context.protected voidprocessMessage(Message message, TestContext context) Subclasses may overwrite this method in order to modify payload and/or headers of the processed message.voidsetDirection(MessageDirection direction) Sets the processor direction (inbound, outbound, unbound).booleansupportsMessageType(String messageType) Checks if this message processor is capable of handling the given message type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.citrusframework.message.MessageProcessor
transform
-
Constructor Details
-
AbstractMessageProcessor
public AbstractMessageProcessor()
-
-
Method Details
-
process
Description copied from interface:MessageProcessorProcess message with given test context. Processors can change the message payload and headers.- Specified by:
processin interfaceMessageProcessor- Parameters:
message- the message to process.context- the current test context.
-
processMessage
Subclasses may overwrite this method in order to modify payload and/or headers of the processed message.- Parameters:
message- the message to process.context- the current test context.
-
supportsMessageType
Description copied from interface:MessageTypeSelectorChecks if this message processor is capable of handling the given message type.- Specified by:
supportsMessageTypein interfaceMessageTypeSelector- Parameters:
messageType- the message type representation as String (e.g. xml, json, csv, plaintext).- Returns:
- true if this component supports the message type.
-
getName
Gets this processors name.- Returns:
-
getDirection
Description copied from interface:MessageDirectionAwareIndicates the direction of messages this processor should apply to.- Specified by:
getDirectionin interfaceMessageDirectionAware- Returns:
-
setDirection
Sets the processor direction (inbound, outbound, unbound).- Parameters:
direction-
-