Package org.frankframework.pipes
Class FixedResultPipe
java.lang.Object
org.frankframework.core.TransactionAttributes
org.frankframework.pipes.AbstractPipe
org.frankframework.pipes.FixedForwardPipe
org.frankframework.pipes.FixedResultPipe
- All Implemented Interfaces:
HasTransactionAttribute
,IConfigurable
,IConfigurationAware
,IForwardTarget
,INamedObject
,IPipe
,IScopeProvider
,IWithParameters
,EventThrowing
,HasStatistics
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
FixedResult
Produces a fixed result that does not depend on the input message. It may return the contents of a file
when
Using parameters and the attributes of this pipe, it is possible to substitute values. This pipe performs the following steps:
Many attributes of this pipe reference file names. If a file is referenced by a relative path, the path is relative to the configuration's root directory.
filename
or filenameSessionKey
is specified. Otherwise the
value of attribute returnString
is returned.
Using parameters and the attributes of this pipe, it is possible to substitute values. This pipe performs the following steps:
- During execution, this pipe first obtains a string based on attributes
returnString
,filename
orfilenameSessionKey
. - The resulting string is transformed according to attributes
replaceFrom
andreplaceTo
if set. Please note that the plain value of attributereplaceFrom
is matched, no${...}
here. - The resulting string is substituted based on the parameters of this pipe. This step depends on attribute
replaceFixedParams
. Assume that there is a parameter with namexyz
. IfreplaceFixedParams
isfalse
, then each occurrence of${xyz}
is replaced by the parameter's value. Otherwise, the textxyz
is substituted. SeeParameter
to see how parameter values are determined. - If attribute
substituteVars
istrue
, then expressions${...}
are substituted using system properties, pipelinesession variables and application properties. Please note that no${...}
patterns are left if the initial string came from attributereturnString
, because any${...}
pattern in attributereturnString
is substituted when the configuration is loaded. - If attribute
styleSheetName
is set, then the referenced XSLT stylesheet is applied to the resulting string.
Many attributes of this pipe reference file names. If a file is referenced by a relative path, the path is relative to the configuration's root directory.
- Author:
- Johan Verrips
- Parameters
- Used for substitution. For a parameter named
xyz
, the string${xyz}
orxyz
(ifreplaceFixedParams
is true) is substituted by the parameter's value.
-
Field Summary
Fields inherited from class org.frankframework.pipes.AbstractPipe
parameterNamesMustBeUnique
Fields inherited from class org.frankframework.core.TransactionAttributes
log
Fields inherited from interface org.frankframework.core.IPipe
LONG_DURATION_MONITORING_EVENT, MESSAGE_SIZE_MONITORING_EVENT, PIPE_EXCEPTION_MONITORING_EVENT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checks for correct configuration, and translates the filename to a file, to check existence.doPipe
(Message message, PipeLineSession session) This is where the action takes place.boolean
boolean
void
setFilename
(String filename) Name of the file containing the result message.void
setFilenameSessionKey
(String filenameSessionKey) Name of the session key containing the file name of the file containing the result message.void
setReplaceFixedParams
(boolean b) When settrue
, parameter replacement matchesname-of-parameter
, not${name-of-parameter}
void
setReplaceFrom
(String replaceFrom) If set, every occurrence of this attribute's value is replaced by the value ofreplaceTo
.void
setReplaceTo
(String replaceTo) SeereplaceFrom
.void
setReturnString
(String returnString) Returned message.void
setStyleSheetName
(String styleSheetName) File name of XSLT stylesheet to apply.void
setSubstituteVars
(boolean substitute) Should values between ${ and } be resolved.Methods inherited from class org.frankframework.pipes.FixedForwardPipe
getIfParam, getIfValue, getOnlyIfSessionKey, getOnlyIfValue, getParameterValue, getSuccessForward, getUnlessSessionKey, getUnlessValue, isSkipOnEmptyInput, setIfParam, setIfValue, setOnlyIfSessionKey, setOnlyIfValue, setSkipOnEmptyInput, setUnlessSessionKey, setUnlessValue, skipPipe
Methods inherited from class org.frankframework.pipes.AbstractPipe
addParameter, consumesSessionVariable, createBean, findForward, getAdapter, getApplicationContext, getChompCharSize, getConfigurationClassLoader, getDurationThreshold, getElementToMove, getElementToMoveChain, getElementToMoveSessionKey, getEmptyInputReplacement, getEventSourceName, getForwards, getGetInputFromFixedValue, getGetInputFromSessionKey, getHideRegex, getLocker, getLogIntermediaryResults, getMaxThreads, getName, getParameterList, getPipeLine, getSecLogSessionKeys, getStoreResultInSessionKey, isPreserveInput, isRemoveCompactMsgNamespaces, isRestoreMovedElements, isWriteToSecLog, registerEvent, registerForward, setApplicationContext, setChompCharSize, setDurationThreshold, setElementToMove, setElementToMoveChain, setElementToMoveSessionKey, setEmptyInputReplacement, setEventPublisher, setGetInputFromFixedValue, setGetInputFromSessionKey, setHideRegex, setLocker, setLogIntermediaryResults, setMaxThreads, setName, setPipeLine, setPreserveInput, setRemoveCompactMsgNamespaces, setRestoreMovedElements, setSecLogSessionKeys, setSizeStatistics, setStoreResultInSessionKey, setWriteToSecLog, sizeStatisticsEnabled, start, stop, throwEvent
Methods inherited from class org.frankframework.core.TransactionAttributes
configureTransactionAttributes, getTransactionAttribute, getTransactionTimeout, getTxDef, isTransacted, isTransacted, setTransacted, setTransactionAttribute, setTransactionTimeout
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.frankframework.core.IPipe
throwEvent
-
Constructor Details
-
FixedResultPipe
public FixedResultPipe()
-
-
Method Details
-
configure
checks for correct configuration, and translates the filename to a file, to check existence. If a filename or filenameSessionKey was specified, the contents of the file is put in thereturnString
, so that thereturnString
may always be returned.- Specified by:
configure
in interfaceIConfigurable
- Specified by:
configure
in interfaceIPipe
- Overrides:
configure
in classFixedForwardPipe
- Throws:
ConfigurationException
-
doPipe
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. If the result of the Pipe does not depend on the input, like for theFixedResultPipe
, the Pipe can schedule the input to be closed at session exit, by callingMessage.closeOnCloseOf(PipeLineSession, String)
This allows the previous Pipe to release any resources (e.g. connections) that it might have kept open until the message was consumed. Doing so avoids connections leaking from pools, while it enables efficient streaming processing of data while it is being read from a stream.- Throws:
PipeRunException
-
setSubstituteVars
public void setSubstituteVars(boolean substitute) Should values between ${ and } be resolved. If true, the search order of replacement values is: system properties (1), pipelinesession variables (2), application properties (3).- Default value
- false
-
setFilename
Name of the file containing the result message. -
setFilenameSessionKey
Name of the session key containing the file name of the file containing the result message. -
setReturnString
Returned message. -
setReplaceFrom
If set, every occurrence of this attribute's value is replaced by the value ofreplaceTo
. -
setReplaceTo
SeereplaceFrom
. -
setStyleSheetName
File name of XSLT stylesheet to apply. -
setReplaceFixedParams
public void setReplaceFixedParams(boolean b) When settrue
, parameter replacement matchesname-of-parameter
, not${name-of-parameter}
- Default value
- false
-
getFilename
-
getFilenameSessionKey
-
getReturnString
-
isSubstituteVars
public boolean isSubstituteVars() -
getReplaceFrom
-
getReplaceTo
-
getStyleSheetName
-
isReplaceFixedParams
public boolean isReplaceFixedParams()
-