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.Loggerprotected ParameterList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()voidcloseDocument(PipeLineSession session, String streamId) voidConfigure this component.booleanbooleanvoidopen()voidopenDocument(PipeLineSession session, String streamId) Called once, before the first record of a stream is presented to handleResult.voidsetBlockByRecordType(boolean b) When set totrue(default), every group of records, as indicated byRecordHandler.newRecordType, is handled as a block.voidsetDefault(boolean isDefault) if set totrue, this resultHandler is the default for allflows that do not have a handler specifiedvoidThe functional name of the object.voidsetPipe(AbstractPipe pipe) voidDeprecated.voidDeprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface org.frankframework.core.FrankElement
addConfigWarningMethods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoaderMethods 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:IConfigurableConfigure 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:
configurein interfaceIConfigurable- Throws:
ConfigurationException- in case it was not able to configure the component.
-
open
- Specified by:
openin interfaceIResultHandler- Throws:
SenderException
-
close
- Specified by:
closein interfaceIResultHandler- Throws:
SenderException
-
openDocument
Description copied from interface:IResultHandlerCalled once, before the first record of a stream is presented to handleResult.- Specified by:
openDocumentin interfaceIResultHandler- Parameters:
session- current PipeLineSessionstreamId- identification of the original file/stream/message- Throws:
Exception
-
closeDocument
- Specified by:
closeDocumentin interfaceIResultHandler
-
addParameter
- Specified by:
addParameterin interfaceIWithParameters
-
getParameterList
- Specified by:
getParameterListin interfaceIWithParameters
-
setPipe
- Specified by:
setPipein interfaceIResultHandler
-
setName
Description copied from interface:NameAwareThe 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:
hasPrefixin 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 allflows that do not have a handler specified- Specified by:
setDefaultin interfaceIResultHandler- Default value
- false
-
isDefault
public boolean isDefault()- Specified by:
isDefaultin 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
-