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
  • Constructor Details

    • AbstractMessageProcessor

      public AbstractMessageProcessor()
  • Method Details

    • process

      public void process(Message message, TestContext context)
      Description copied from interface: MessageProcessor
      Process message with given test context. Processors can change the message payload and headers.
      Specified by:
      process in interface MessageProcessor
      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: MessageTypeSelector
      Checks if this message processor is capable of handling the given message type.
      Specified by:
      supportsMessageType in interface MessageTypeSelector
      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: MessageDirectionAware
      Indicates the direction of messages this processor should apply to.
      Specified by:
      getDirection in interface MessageDirectionAware
      Returns:
    • setDirection

      public void setDirection(MessageDirection direction)
      Sets the processor direction (inbound, outbound, unbound).
      Parameters:
      direction -