Package org.frankframework.batch
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 Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.logging.log4j.Logger
protected ParameterList
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
close()
void
closeDocument
(PipeLineSession session, String streamId) void
Configure this component.boolean
boolean
void
open()
void
openDocument
(PipeLineSession session, String streamId) Called once, before the first record of a stream is presented to handleResult.void
setBlockByRecordType
(boolean b) When set totrue
(default), every group of records, as indicated byRecordHandler.newRecordType
, is handled as a block.void
setDefault
(boolean isDefault) if set totrue
, this resultHandler is the default for allflow
s that do not have a handler specifiedvoid
The functional name of the object.void
setPipe
(AbstractPipe pipe) void
Deprecated.void
Deprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
Methods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoader
Methods inherited from interface org.frankframework.batch.IResultHandler
closeBlock, closeRecordType, finalizeResult, handleResult, isBlockByRecordType, openBlock, openRecordType
-
Field Details
-
log
protected org.apache.logging.log4j.Logger log -
paramList
-
-
Constructor Details
-
AbstractResultHandler
public AbstractResultHandler()
-
-
Method Details
-
configure
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 thisIConfigurable
. 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 theconfigure()
, to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configure
in interfaceIConfigurable
- Throws:
ConfigurationException
- in case it was not able to configure the component.
-
open
- Specified by:
open
in interfaceIResultHandler
- Throws:
SenderException
-
close
- Specified by:
close
in interfaceIResultHandler
- Throws:
SenderException
-
openDocument
Description copied from interface:IResultHandler
Called once, before the first record of a stream is presented to handleResult.- Specified by:
openDocument
in interfaceIResultHandler
- Parameters:
session
- current PipeLineSessionstreamId
- identification of the original file/stream/message- Throws:
Exception
-
closeDocument
- Specified by:
closeDocument
in interfaceIResultHandler
-
addParameter
- Specified by:
addParameter
in interfaceIWithParameters
-
getParameterList
- Specified by:
getParameterList
in interfaceIWithParameters
-
setPipe
- Specified by:
setPipe
in interfaceIResultHandler
-
setName
Description copied from interface:NameAware
The functional name of the object. -
setPrefix
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 interfaceIResultHandler
-
setSuffix
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 totrue
, this resultHandler is the default for allflow
s that do not have a handler specified- Specified by:
setDefault
in interfaceIResultHandler
- Default value
- false
-
isDefault
public boolean isDefault()- Specified by:
isDefault
in interfaceIResultHandler
- 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 totrue
(default), every group of records, as indicated byRecordHandler.newRecordType
, is handled as a block.- Default value
- true
-