Package com.consol.citrus.message
Class AbstractMessageProcessor
- java.lang.Object
-
- com.consol.citrus.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 com.consol.citrus.message.MessageProcessor
MessageProcessor.Builder<T extends MessageProcessor,B extends MessageProcessor.Builder<T,B>>
-
-
Field Summary
-
Fields inherited from interface com.consol.citrus.message.MessageProcessor
LOG, RESOURCE_PATH, TYPE_RESOLVER
-
-
Constructor Summary
Constructors Constructor Description AbstractMessageProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageDirectiongetDirection()Indicates 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, wait
-
Methods inherited from interface com.consol.citrus.message.MessageProcessor
transform
-
-
-
-
Method Detail
-
process
public void process(Message message, TestContext context)
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
protected void processMessage(Message message, TestContext context)
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
public boolean supportsMessageType(String messageType)
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
protected String getName()
Gets this processors name.- Returns:
-
getDirection
public MessageDirection getDirection()
Description copied from interface:MessageDirectionAwareIndicates the direction of messages this processor should apply to.- Specified by:
getDirectionin interfaceMessageDirectionAware- Returns:
-
setDirection
public void setDirection(MessageDirection direction)
Sets the processor direction (inbound, outbound, unbound).- Parameters:
direction-
-
-