Class DomainTransformerPipe

All Implemented Interfaces:
FrankElement, HasApplicationContext, HasName, HasTransactionAttribute, IConfigurable, IForwardTarget, IPipe, IScopeProvider, IWithParameters, NameAware, EventThrowing, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle

@EnterpriseIntegrationPattern(TRANSLATOR) public class DomainTransformerPipe extends FixedForwardPipe
Pipe that performs domain transforming on the basis of a database table. Every string that equals "%![DT{label,valueIn,type}]" will be replaced by valueOut. The field type, which is optional, indicates the format of valueIn. Currently, the following types are supported:
  • string (default): the method setString() is used.
  • number: the method setDouble() is used.
Since:
4.9
Author:
Peter Leeuwenburgh
  • Constructor Details

    • DomainTransformerPipe

      public DomainTransformerPipe()
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      Description copied from class: FixedForwardPipe
      Checks for correct configuration of forward.
      Specified by:
      configure in interface IConfigurable
      Overrides:
      configure in class FixedForwardPipe
      Throws:
      ConfigurationException - in case it was not able to configure the component.
    • doPipe

      public PipeRunResult doPipe(Message invoer, PipeLineSession session) throws PipeRunException
      Description copied from interface: IPipe
      This is where the action takes place. Pipes may only throw a PipeRunException, to be handled by the caller of this object. Implementations must either consume the message, or pass it on to the next Pipe in the PipeRunResult.
      Throws:
      PipeRunException
    • getValueOut

      public String getValueOut(String label, String valueIn, String type, PreparedStatement stmt) throws SQLException
      Throws:
      SQLException
    • start

      public void start()
      Description copied from interface: IPipe
      Perform necessary action to start the pipe. This method is executed after the IConfigurable.configure() method, for each start and stop command of the adapter.
      Specified by:
      start in interface IPipe
      Specified by:
      start in interface org.springframework.context.Lifecycle
      Overrides:
      start in class AbstractPipe
    • stop

      public void stop()
      Description copied from interface: IPipe
      Perform necessary actions to stop the Pipe.
      For instance, closing JMS connections, DBMS connections etc.
      Specified by:
      stop in interface IPipe
      Specified by:
      stop in interface org.springframework.context.Lifecycle
      Overrides:
      stop in class AbstractPipe
    • setDatasourceName

      public void setDatasourceName(String datasourceName)
    • setTableName

      public void setTableName(String tableName)
      The name of the table that contains the mapping.
      Default value
      mapping
    • setLabelField

      public void setLabelField(String labelField)
      The name of the column labels are stored in.
      Default value
      label
    • setValueInField

      public void setValueInField(String valueInField)
      The name of the column source values are stored in.
      Default value
      valuein
    • setValueOutField

      public void setValueOutField(String valueOutField)
      The name of the column destination values are stored in.
      Default value
      valueout