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 Details

  • Constructor Details

    • AbstractResponseValidatorWrapper

      protected AbstractResponseValidatorWrapper(V owner)
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      Description copied from interface: IPipe
      configure() is called once after the PipeLine is registered at the Adapter. Purpose of this method is to reduce creating connections to databases etc. in the doPipe() method. As much as possible class-instantiating should take place in the configure() method, to improve performance.
      Specified by:
      configure in interface IConfigurable
      Specified by:
      configure in interface IPipe
      Throws:
      ConfigurationException
    • doPipe

      public PipeRunResult doPipe(Message message, PipeLineSession session) throws PipeRunException
      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 the FixedResultPipe, the Pipe can schedule the input to be closed at session exit, by calling Message.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 interface IPipe
      Throws:
      PipeRunException
    • validate

      public PipeRunResult validate(Message message, PipeLineSession session, String messageRoot) throws PipeRunException
      Specified by:
      validate in interface IValidator
      Throws:
      PipeRunException
    • getMaxThreads

      public int getMaxThreads()
      Description copied from interface: IPipe
      Indicates the maximum number of threads that may call doPipe() simultaneously. A value of 0 indicates an unlimited number of threads. Pipe implementations that are not thread-safe, i.e. where doPipe() may only be called by one thread at a time, should make sure getMaxThreads always returns a value of 1.
      Specified by:
      getMaxThreads in interface IPipe
    • getForwards

      public Map<String,PipeForward> getForwards()
      Description copied from interface: IPipe
      Get pipe forwards.
      Specified by:
      getForwards in interface IPipe
    • addForward

      public void addForward(PipeForward forward)
      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 interface IPipe
      See Also:
    • start

      public void start() throws PipeStartException
      Description copied from interface: IPipe
      Perform necessary action to start the pipe. This method is executed after the IPipe.configure() method, for each start and stop command of the adapter.
      Specified by:
      start in interface IPipe
      Throws:
      PipeStartException
    • stop

      public void stop()
      Description copied from interface: IPipe
      Perform necessary actions to stop the Pipe.
      For instance, closing JMS connections, DBMS connections etc.
      Specified by:
      stop in interface IPipe
    • getApplicationContext

      public org.springframework.context.ApplicationContext getApplicationContext()
      Specified by:
      getApplicationContext in interface IConfigurationAware
    • getConfigurationClassLoader

      public ClassLoader 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 interface IScopeProvider
      Returns:
      returns the ClassLoader created by the ClassLoaderManager.
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
    • consumesSessionVariable

      public boolean consumesSessionVariable(String sessionKey)
      Description copied from interface: IPipe
      returns true 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 interface IPipe
    • setPipeLine

      public void setPipeLine(PipeLine pipeline)
      Description copied from interface: IPipe
      Allowing pipe to register things at Configuration time. Must be set before calling configure()
      Specified by:
      setPipeLine in interface IPipe
    • setGetInputFromSessionKey

      public void setGetInputFromSessionKey(String string)
      Description copied from interface: IPipe
      If set, input is taken from this session key, instead of regular input
      Specified by:
      setGetInputFromSessionKey in interface IPipe
    • getGetInputFromSessionKey

      public String getGetInputFromSessionKey()
      Specified by:
      getGetInputFromSessionKey in interface IPipe
    • setGetInputFromFixedValue

      public void setGetInputFromFixedValue(String string)
      Description copied from interface: IPipe
      If set, this fixed value is taken as input, instead of regular input
      Specified by:
      setGetInputFromFixedValue in interface IPipe
    • getGetInputFromFixedValue

      public String getGetInputFromFixedValue()
      Specified by:
      getGetInputFromFixedValue in interface IPipe
    • setEmptyInputReplacement

      public void setEmptyInputReplacement(String string)
      Description copied from interface: IPipe
      If set and the input is empty, this fixed value is taken as input
      Specified by:
      setEmptyInputReplacement in interface IPipe
    • getEmptyInputReplacement

      public String getEmptyInputReplacement()
      Specified by:
      getEmptyInputReplacement in interface IPipe
    • setPreserveInput

      public void setPreserveInput(boolean preserveInput)
      Description copied from interface: IPipe
      If set true, the result of the pipe is replaced with the original input (i.e. the input before configured replacements of getInputFromSessionKey, getInputFromFixedValue or emptyInputReplacement)
      Specified by:
      setPreserveInput in interface IPipe
    • isPreserveInput

      public boolean isPreserveInput()
      Specified by:
      isPreserveInput in interface IPipe
    • setStoreResultInSessionKey

      public void setStoreResultInSessionKey(String string)
      Description copied from interface: IPipe
      If set, the result (before replacing when true) is stored under this session key
      Specified by:
      setStoreResultInSessionKey in interface IPipe
    • getStoreResultInSessionKey

      public String getStoreResultInSessionKey()
      Specified by:
      getStoreResultInSessionKey in interface IPipe
    • setChompCharSize

      public void setChompCharSize(String string)
      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 interface IPipe
    • getChompCharSize

      public String getChompCharSize()
      Specified by:
      getChompCharSize in interface IPipe
    • setElementToMove

      public void setElementToMove(String string)
      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 interface IPipe
    • getElementToMove

      public String getElementToMove()
      Specified by:
      getElementToMove in interface IPipe
    • setElementToMoveSessionKey

      public void setElementToMoveSessionKey(String string)
      Description copied from interface: IPipe
      (Only used when elementToMove is set) Name of the session key under which the character data is stored
      Specified by:
      setElementToMoveSessionKey in interface IPipe
    • getElementToMoveSessionKey

      public String getElementToMoveSessionKey()
      Specified by:
      getElementToMoveSessionKey in interface IPipe
    • setElementToMoveChain

      public void setElementToMoveChain(String string)
      Description copied from interface: IPipe
      Like elementToMove but element is preceded with all ancestor elements and separated by semicolons (e.g. 'adapter;pipeline;pipe')
      Specified by:
      setElementToMoveChain in interface IPipe
    • getElementToMoveChain

      public String getElementToMoveChain()
      Specified by:
      getElementToMoveChain in interface IPipe
    • setRemoveCompactMsgNamespaces

      public void setRemoveCompactMsgNamespaces(boolean b)
      Specified by:
      setRemoveCompactMsgNamespaces in interface IPipe
    • isRemoveCompactMsgNamespaces

      public boolean isRemoveCompactMsgNamespaces()
      Specified by:
      isRemoveCompactMsgNamespaces in interface IPipe
    • setRestoreMovedElements

      public void setRestoreMovedElements(boolean restoreMovedElements)
      Description copied from interface: IPipe
      If set true, compacted messages in the result are restored to their original format (see also IPipe.setElementToMove(java.lang.String))
      Specified by:
      setRestoreMovedElements in interface IPipe
    • isRestoreMovedElements

      public boolean isRestoreMovedElements()
      Specified by:
      isRestoreMovedElements in interface IPipe
    • 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 interface IPipe
    • getDurationThreshold

      public long getDurationThreshold()
      Specified by:
      getDurationThreshold in interface IPipe
    • setLocker

      public void setLocker(Locker locker)
      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.
      Specified by:
      setLocker in interface IPipe
    • getLocker

      public Locker getLocker()
      Specified by:
      getLocker in interface IPipe
    • setWriteToSecLog

      public void setWriteToSecLog(boolean b)
      Specified by:
      setWriteToSecLog in interface IPipe
    • isWriteToSecLog

      public boolean isWriteToSecLog()
      Specified by:
      isWriteToSecLog in interface IPipe
    • setSecLogSessionKeys

      public void setSecLogSessionKeys(String string)
      Description copied from interface: IPipe
      (Only used when writetoseclog=true) Comma separated list of keys of session variables that is appended to the security log record
      Specified by:
      setSecLogSessionKeys in interface IPipe
    • getSecLogSessionKeys

      public String getSecLogSessionKeys()
      Specified by:
      getSecLogSessionKeys in interface IPipe
    • registerEvent

      public void registerEvent(String description)
      Description copied from interface: IPipe
      Register an event for flexible monitoring.
      Specified by:
      registerEvent in interface IPipe
    • throwEvent

      public void throwEvent(String event, Message eventMessage)
      Specified by:
      throwEvent in interface IPipe
    • sizeStatisticsEnabled

      public boolean sizeStatisticsEnabled()
      Specified by:
      sizeStatisticsEnabled in interface IPipe
    • setHideRegex

      public void setHideRegex(String hideRegex)
      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 a hideRegex 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. See StringUtil.hideAll(String, Collection, int) with mode = 0 for how regular expressions are matched and replaced.
      Specified by:
      setHideRegex in interface IPipe
    • getHideRegex

      public String getHideRegex()
      Specified by:
      getHideRegex in interface IPipe
    • setLogIntermediaryResults

      public void setLogIntermediaryResults(String string)
      Description copied from interface: IPipe
      when set, the value in AppConstants is overwritten (for this pipe only)
      Specified by:
      setLogIntermediaryResults in interface IPipe
    • getLogIntermediaryResults

      public String getLogIntermediaryResults()
      Specified by:
      getLogIntermediaryResults in interface IPipe
    • getName

      public String getName()
      Description copied from interface: IForwardTarget
      The part of the object that identifies its destination: The name of the Pipe or the path of the PipeLineExit.
      Specified by:
      getName in interface IConfigurationAware
      Specified by:
      getName in interface IForwardTarget
      Specified by:
      getName in interface INamedObject
    • setName

      public void setName(String name)
      Description copied from interface: IValidator
      The functional name of this pipe, is not required when used as a Validator
      Specified by:
      setName in interface INamedObject
      Specified by:
      setName in interface IValidator