Class AbstractResultHandler

java.lang.Object
org.frankframework.batch.AbstractResultHandler
All Implemented Interfaces:
IResultHandler, FrankElement, HasApplicationContext, HasName, IConfigurable, IScopeProvider, IWithParameters, NameAware, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
Direct Known Subclasses:
ResultWriter

public abstract class AbstractResultHandler extends Object implements IResultHandler, IWithParameters
Abstract class for resulthandlers (handler that handles the transformed record).
Author:
John Dekker
  • Field Details

    • log

      protected org.apache.logging.log4j.Logger log
    • paramList

      @Nonnull protected ParameterList paramList
  • Constructor Details

    • AbstractResultHandler

      public AbstractResultHandler()
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      Description copied from interface: IConfigurable
      Configure this component.

      configure() is called once at startup of the framework in the configure method of the owner of this IConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in the configure(), to improve performance.

      In the case of a container, this will propagate the configure signal to all components that apply.

      Specified by:
      configure in interface IConfigurable
      Throws:
      ConfigurationException - in case it was not able to configure the component.
    • open

      public void open() throws SenderException
      Specified by:
      open in interface IResultHandler
      Throws:
      SenderException
    • close

      public void close() throws SenderException
      Specified by:
      close in interface IResultHandler
      Throws:
      SenderException
    • openDocument

      public void openDocument(PipeLineSession session, String streamId) throws Exception
      Description copied from interface: IResultHandler
      Called once, before the first record of a stream is presented to handleResult.
      Specified by:
      openDocument in interface IResultHandler
      Parameters:
      session - current PipeLineSession
      streamId - identification of the original file/stream/message
      Throws:
      Exception
    • closeDocument

      public void closeDocument(PipeLineSession session, String streamId)
      Specified by:
      closeDocument in interface IResultHandler
    • addParameter

      public void addParameter(IParameter p)
      Specified by:
      addParameter in interface IWithParameters
    • getParameterList

      @Nonnull public ParameterList getParameterList()
      Specified by:
      getParameterList in interface IWithParameters
    • setPipe

      public void setPipe(AbstractPipe pipe)
      Specified by:
      setPipe in interface IResultHandler
    • setName

      public void setName(String string)
      Description copied from interface: NameAware
      The functional name of the object.
      Specified by:
      setName in interface NameAware
    • setPrefix

      @Deprecated public void setPrefix(String string)
      Deprecated.
      Prefix that has to be written before each record, if the record is in another block than the previous record
    • hasPrefix

      public boolean hasPrefix()
      Specified by:
      hasPrefix in interface IResultHandler
    • setSuffix

      @Deprecated public void setSuffix(String string)
      Deprecated.
      deprecated suffix that has to be written after the record, if the record is in another block than the next record.
      n.b. if a suffix is set without a prefix, it is only used at the end of processing (i.e. at the end of the file) as a final close
    • setDefault

      public void setDefault(boolean isDefault)
      if set to true, this resultHandler is the default for all flows that do not have a handler specified
      Specified by:
      setDefault in interface IResultHandler
      Default value
      false
    • isDefault

      public boolean isDefault()
      Specified by:
      isDefault in interface IResultHandler
      Returns:
      true if this resulthandler should be used for all flows if no resulthandler is specified for that flow
    • setBlockByRecordType

      public void setBlockByRecordType(boolean b)
      When set to true(default), every group of records, as indicated by RecordHandler.newRecordType, is handled as a block.
      Default value
      true