Class AdapterSupport

java.lang.Object
org.openehealth.ipf.platform.camel.core.adapter.AdapterSupport
All Implemented Interfaces:
Adapter
Direct Known Subclasses:
AggregatorAdapter, DataFormatAdapter, PredicateAdapter, ProcessorAdapter

public abstract class AdapterSupport extends Object implements Adapter
Abstract base class for classes that adapt transform support library interfaces to Apache Camel interfaces.
Author:
Martin Krasser
  • Constructor Details

    • AdapterSupport

      public AdapterSupport()
      Creates an adapter that by default takes input data from the body of the in-message.
      See Also:
  • Method Details

    • input

      public Adapter input(Expression inputExpression)
      Description copied from interface: Adapter
      Sets an Expression for obtaining input data from an Exchange. Input data are passed to adapted modules API implementations.
      Specified by:
      input in interface Adapter
      Parameters:
      inputExpression - expression for obtaining input data.
      Returns:
      this object.
    • input

      public Adapter input(Closure inputExpressionLogic)
      Description copied from interface: Adapter
      Sets an expression Closure for obtaining input data from an Exchange. Input data are passed to adapted modules API implementations.
      Specified by:
      input in interface Adapter
      Parameters:
      inputExpressionLogic - expression for obtaining input data.
      Returns:
      this object.
    • params

      public Adapter params(Expression paramsExpression)
      Description copied from interface: Adapter
      Sets an Expression for obtaining input params from an Exchange. Input params are passed to adapted modules API implementations.
      Specified by:
      params in interface Adapter
      Parameters:
      paramsExpression - expression for obtaining input params.
      Returns:
      this object.
    • params

      public Adapter params(Closure paramsExpressionLogic)
      Description copied from interface: Adapter
      Sets an expression Closure for obtaining input params from an Exchange. Input params are passed to adapted modules API implementations.
      Specified by:
      params in interface Adapter
      Parameters:
      paramsExpressionLogic - expression for obtaining input params.
      Returns:
      this object.
    • staticParams

      public Adapter staticParams(Object... params)
      Description copied from interface: Adapter
      Configures this adapter to use the given params independent of the Exchange to be processed.
      Specified by:
      staticParams in interface Adapter
      Parameters:
      params - expression for obtaining input params.
      Returns:
      this object.
    • adaptInput

      protected Object adaptInput(Exchange exchange)
      Applies the Expression set by input(Expression) to obtain input data from the exchange.
      Parameters:
      exchange - message exchange.
      Returns:
      input data or null if the expression evaluates to null or the expression object is null.
    • adaptParams

      protected Object adaptParams(Exchange exchange)
      Applies the Expression set by params(Expression) (or implicitly set by staticParams(Object...)) to obtain input params from the exchange.
      Parameters:
      exchange - message exchange.
      Returns:
      input data or null if the expression evaluates to null or the expression object is null.