Package org.frankframework.core
Class AbstractResponseValidatorWrapper<V extends AbstractValidator>
java.lang.Object
org.frankframework.core.AbstractResponseValidatorWrapper<V>
- All Implemented Interfaces:
IConfigurable
,IConfigurationAware
,IForwardTarget
,INamedObject
,IPipe
,IScopeProvider
,IValidator
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
AbstractValidator.ResponseValidatorWrapper
,XmlValidator.ResponseValidatorWrapper
public abstract class AbstractResponseValidatorWrapper<V extends AbstractValidator>
extends Object
implements IValidator
Wrapper for the response validator. It has its own name and forwards, but delegates the actual work to the original validator.
It overrides the stop and start method to prevent the original validator from being started and stopped.
-
Field Summary
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
addForward
(PipeForward forward) Register a PipeForward object to this Pipe.void
boolean
consumesSessionVariable
(String sessionKey) returnstrue
if the pipe or one of its children use the named session variable.doPipe
(Message message, PipeLineSession session) This is where the action takes place.org.springframework.context.ApplicationContext
This ClassLoader is set upon creation of the object, used to retrieve resources configured by the Ibis application.long
Get pipe forwards.int
Indicates the maximum number of threads that may calldoPipe()
simultaneously.getName()
boolean
boolean
boolean
boolean
void
registerEvent
(String description) Register an event for flexible monitoring.void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setChompCharSize
(String string) If set (>=0) and the character data length inside a xml element exceeds this size, the character data is chomped (with a clear comment)void
setDurationThreshold
(long maxDuration) If durationThreshold >=0 and the duration of the message processing exceeded the value specified (in milliseconds) the message is logged informatory to be analyzedvoid
setElementToMove
(String string) If set, the character data in this element is stored under a session key and in the message replaced by a reference to this session key: {sessionKey: +elementToMoveSessionKey
+ }void
setElementToMoveChain
(String string) LikeelementToMove
but element is preceded with all ancestor elements and separated by semicolons (e.g.void
setElementToMoveSessionKey
(String string) (Only used whenelementToMove
is set) Name of the session key under which the character data is storedvoid
setEmptyInputReplacement
(String string) If set and the input is empty, this fixed value is taken as inputvoid
setGetInputFromFixedValue
(String string) If set, this fixed value is taken as input, instead of regular inputvoid
setGetInputFromSessionKey
(String string) If set, input is taken from this session key, instead of regular inputvoid
setHideRegex
(String hideRegex) Regular expression to mask strings in the log.void
Optional Locker, to avoid parallel execution of the Pipe by multiple threads or servers.void
setLogIntermediaryResults
(String string) when set, the value in AppConstants is overwritten (for this pipe only)void
The functional name of this pipe, is not required when used as a Validatorvoid
setPipeLine
(PipeLine pipeline) Allowing pipe to register things at Configuration time.void
setPreserveInput
(boolean preserveInput) If settrue
, the result of the pipe is replaced with the original input (i.e. the input before configured replacements ofgetInputFromSessionKey
,getInputFromFixedValue
oremptyInputReplacement
)void
setRemoveCompactMsgNamespaces
(boolean b) void
setRestoreMovedElements
(boolean restoreMovedElements) If settrue
, compacted messages in the result are restored to their original format (see alsoIPipe.setElementToMove(java.lang.String)
)void
setSecLogSessionKeys
(String string) (Only used whenwritetoseclog=true
) Comma separated list of keys of session variables that is appended to the security log recordvoid
setStoreResultInSessionKey
(String string) If set, the result (before replacing whentrue
) is stored under this session keyvoid
setWriteToSecLog
(boolean b) boolean
void
start()
Perform necessary action to start the pipe.void
stop()
Perform necessary actions to stop thePipe
.
For instance, closing JMS connections, DBMS connections etc.void
throwEvent
(String event, Message eventMessage) validate
(Message message, PipeLineSession session, String messageRoot) 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
-
Field Details
-
owner
-
-
Constructor Details
-
AbstractResponseValidatorWrapper
-
-
Method Details
-
configure
Description copied from interface:IPipe
configure()
is called once after thePipeLine
is registered at theAdapter
. Purpose of this method is to reduce creating connections to databases etc. in thedoPipe()
method. As much as possible class-instantiating should take place in theconfigure()
method, to improve performance.- Specified by:
configure
in interfaceIConfigurable
- Specified by:
configure
in interfaceIPipe
- 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.- Specified by:
doPipe
in interfaceIPipe
- Throws:
PipeRunException
-
validate
public PipeRunResult validate(Message message, PipeLineSession session, String messageRoot) throws PipeRunException - Specified by:
validate
in interfaceIValidator
- Throws:
PipeRunException
-
getMaxThreads
public int getMaxThreads()Description copied from interface:IPipe
Indicates the maximum number of threads that may calldoPipe()
simultaneously. A value of 0 indicates an unlimited number of threads. Pipe implementations that are not thread-safe, i.e. wheredoPipe()
may only be called by one thread at a time, should make sure getMaxThreads always returns a value of 1.- Specified by:
getMaxThreads
in interfaceIPipe
-
getForwards
Description copied from interface:IPipe
Get pipe forwards.- Specified by:
getForwards
in interfaceIPipe
-
addForward
Description copied from interface:IPipe
Register a PipeForward object to this Pipe. Global Forwards are added by the PipeLine. If a forward is already registered, it logs a warning.- Specified by:
addForward
in interfaceIPipe
- See Also:
-
start
Description copied from interface:IPipe
Perform necessary action to start the pipe. This method is executed after theIPipe.configure()
method, for each start and stop command of the adapter.- Specified by:
start
in interfaceIPipe
- Throws:
PipeStartException
-
stop
public void stop()Description copied from interface:IPipe
Perform necessary actions to stop thePipe
.
For instance, closing JMS connections, DBMS connections etc. -
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()- Specified by:
getApplicationContext
in interfaceIConfigurationAware
-
getConfigurationClassLoader
Description copied from interface:IScopeProvider
This ClassLoader is set upon creation of the object, used to retrieve resources configured by the Ibis application.- Specified by:
getConfigurationClassLoader
in interfaceIScopeProvider
- Returns:
- returns the ClassLoader created by the
ClassLoaderManager
.
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-
consumesSessionVariable
Description copied from interface:IPipe
returnstrue
if the pipe or one of its children use the named session variable. Callers can use this to determine if a message needs to be preserved.- Specified by:
consumesSessionVariable
in interfaceIPipe
-
setPipeLine
Description copied from interface:IPipe
Allowing pipe to register things at Configuration time. Must be set before calling configure()- Specified by:
setPipeLine
in interfaceIPipe
-
setGetInputFromSessionKey
Description copied from interface:IPipe
If set, input is taken from this session key, instead of regular input- Specified by:
setGetInputFromSessionKey
in interfaceIPipe
-
getGetInputFromSessionKey
- Specified by:
getGetInputFromSessionKey
in interfaceIPipe
-
setGetInputFromFixedValue
Description copied from interface:IPipe
If set, this fixed value is taken as input, instead of regular input- Specified by:
setGetInputFromFixedValue
in interfaceIPipe
-
getGetInputFromFixedValue
- Specified by:
getGetInputFromFixedValue
in interfaceIPipe
-
setEmptyInputReplacement
Description copied from interface:IPipe
If set and the input is empty, this fixed value is taken as input- Specified by:
setEmptyInputReplacement
in interfaceIPipe
-
getEmptyInputReplacement
- Specified by:
getEmptyInputReplacement
in interfaceIPipe
-
setPreserveInput
public void setPreserveInput(boolean preserveInput) Description copied from interface:IPipe
If settrue
, the result of the pipe is replaced with the original input (i.e. the input before configured replacements ofgetInputFromSessionKey
,getInputFromFixedValue
oremptyInputReplacement
)- Specified by:
setPreserveInput
in interfaceIPipe
-
isPreserveInput
public boolean isPreserveInput()- Specified by:
isPreserveInput
in interfaceIPipe
-
setStoreResultInSessionKey
Description copied from interface:IPipe
If set, the result (before replacing whentrue
) is stored under this session key- Specified by:
setStoreResultInSessionKey
in interfaceIPipe
-
getStoreResultInSessionKey
- Specified by:
getStoreResultInSessionKey
in interfaceIPipe
-
setChompCharSize
Description copied from interface:IPipe
If set (>=0) and the character data length inside a xml element exceeds this size, the character data is chomped (with a clear comment)- Specified by:
setChompCharSize
in interfaceIPipe
-
getChompCharSize
- Specified by:
getChompCharSize
in interfaceIPipe
-
setElementToMove
Description copied from interface:IPipe
If set, the character data in this element is stored under a session key and in the message replaced by a reference to this session key: {sessionKey: +elementToMoveSessionKey
+ }- Specified by:
setElementToMove
in interfaceIPipe
-
getElementToMove
- Specified by:
getElementToMove
in interfaceIPipe
-
setElementToMoveSessionKey
Description copied from interface:IPipe
(Only used whenelementToMove
is set) Name of the session key under which the character data is stored- Specified by:
setElementToMoveSessionKey
in interfaceIPipe
-
getElementToMoveSessionKey
- Specified by:
getElementToMoveSessionKey
in interfaceIPipe
-
setElementToMoveChain
Description copied from interface:IPipe
LikeelementToMove
but element is preceded with all ancestor elements and separated by semicolons (e.g. 'adapter;pipeline;pipe')- Specified by:
setElementToMoveChain
in interfaceIPipe
-
getElementToMoveChain
- Specified by:
getElementToMoveChain
in interfaceIPipe
-
setRemoveCompactMsgNamespaces
public void setRemoveCompactMsgNamespaces(boolean b) - Specified by:
setRemoveCompactMsgNamespaces
in interfaceIPipe
-
isRemoveCompactMsgNamespaces
public boolean isRemoveCompactMsgNamespaces()- Specified by:
isRemoveCompactMsgNamespaces
in interfaceIPipe
-
setRestoreMovedElements
public void setRestoreMovedElements(boolean restoreMovedElements) Description copied from interface:IPipe
If settrue
, compacted messages in the result are restored to their original format (see alsoIPipe.setElementToMove(java.lang.String)
)- Specified by:
setRestoreMovedElements
in interfaceIPipe
-
isRestoreMovedElements
public boolean isRestoreMovedElements()- Specified by:
isRestoreMovedElements
in interfaceIPipe
-
setDurationThreshold
public void setDurationThreshold(long maxDuration) Description copied from interface:IPipe
If durationThreshold >=0 and the duration of the message processing exceeded the value specified (in milliseconds) the message is logged informatory to be analyzed- Specified by:
setDurationThreshold
in interfaceIPipe
-
getDurationThreshold
public long getDurationThreshold()- Specified by:
getDurationThreshold
in interfaceIPipe
-
setLocker
Description copied from interface:IPipe
Optional Locker, to avoid parallel execution of the Pipe by multiple threads or servers. An exception is thrown when the lock cannot be obtained, e.g. in case another thread, may be in another server, holds the lock and does not release it in a timely manner. -
getLocker
-
setWriteToSecLog
public void setWriteToSecLog(boolean b) - Specified by:
setWriteToSecLog
in interfaceIPipe
-
isWriteToSecLog
public boolean isWriteToSecLog()- Specified by:
isWriteToSecLog
in interfaceIPipe
-
setSecLogSessionKeys
Description copied from interface:IPipe
(Only used whenwritetoseclog=true
) Comma separated list of keys of session variables that is appended to the security log record- Specified by:
setSecLogSessionKeys
in interfaceIPipe
-
getSecLogSessionKeys
- Specified by:
getSecLogSessionKeys
in interfaceIPipe
-
registerEvent
Description copied from interface:IPipe
Register an event for flexible monitoring.- Specified by:
registerEvent
in interfaceIPipe
-
throwEvent
- Specified by:
throwEvent
in interfaceIPipe
-
sizeStatisticsEnabled
public boolean sizeStatisticsEnabled()- Specified by:
sizeStatisticsEnabled
in interfaceIPipe
-
setHideRegex
Description copied from interface:IPipe
Regular expression to mask strings in the log. For example, the regular expression(?<=<password>).*?(?=</password>)
will replace every character between keys '<password>' and '</password>'. note: this feature is used at adapter level, so ahideRegex
set on one pipe affects all pipes in the pipeline (and multiple values in different pipes are combined into a single regex). The regular expressions are matched against part of the log lines. SeeStringUtil.hideAll(String, Collection, int)
withmode = 0
for how regular expressions are matched and replaced.- Specified by:
setHideRegex
in interfaceIPipe
-
getHideRegex
- Specified by:
getHideRegex
in interfaceIPipe
-
setLogIntermediaryResults
Description copied from interface:IPipe
when set, the value in AppConstants is overwritten (for this pipe only)- Specified by:
setLogIntermediaryResults
in interfaceIPipe
-
getLogIntermediaryResults
- Specified by:
getLogIntermediaryResults
in interfaceIPipe
-
getName
Description copied from interface:IForwardTarget
The part of the object that identifies its destination: Thename
of the Pipe or thepath
of the PipeLineExit.- Specified by:
getName
in interfaceIConfigurationAware
- Specified by:
getName
in interfaceIForwardTarget
- Specified by:
getName
in interfaceINamedObject
-
setName
Description copied from interface:IValidator
The functional name of this pipe, is not required when used as a Validator- Specified by:
setName
in interfaceINamedObject
- Specified by:
setName
in interfaceIValidator
-