Class RekenBoxCaller

All Implemented Interfaces:
FrankElement, HasApplicationContext, HasName, HasTransactionAttribute, IConfigurable, IForwardTarget, IPipe, IScopeProvider, IWithParameters, NameAware, EventThrowing, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.Lifecycle

@Category(NN_SPECIAL) public class RekenBoxCaller extends FixedForwardPipe
Perform a call to a RekenBox. The inputmessage is written to a temporary file and passed as inputfile to the rekenbox. The contents of the outputfile of the rekenbox is returned as output message. The name of the rekenbox, as determined from the inputfile, is optionally written to the pipeLineSession.

Note:
The rekenbox-name is currently determined from the first 8 characters of the file, or up to the first space (' ') or colon (':') character. Beware that if the first character of the file is a newline character or something similar, less characters are available to pass the rekenbox-name on. Especially if the inputmessages are constructed by means of an XSLT-stylesheet, messages often start with a newline character.

Author:
Gerrit van Brakel
  • Constructor Details

    • RekenBoxCaller

      public RekenBoxCaller()
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      Description copied from class: FixedForwardPipe
      Checks for correct configuration of forward.
      Specified by:
      configure in interface IConfigurable
      Overrides:
      configure in class FixedForwardPipe
      Throws:
      ConfigurationException - in case it was not able to configure the component.
    • inputFileExists

      protected boolean inputFileExists(long requestNumber, String extension)
    • makeFileName

      protected String makeFileName(long requestno, String extension)
    • getBaseFileName

      public String getBaseFileName()
    • doPipe

      public PipeRunResult doPipe(Message message, PipeLineSession session) throws PipeRunException
      positie 1 t/m 8 bepalen de naam van de executable, of tot aan de ':' (wat het eerst komt)
      Throws:
      PipeRunException
    • fileToString

      @Deprecated public static String fileToString(String fileName, String endOfLineString, boolean xmlEncode) throws IOException
      Deprecated.
      Please consider using StreamUtil.resourceToString(URL, String, boolean) instead of relying on files.
      Throws:
      IOException
    • setRekenBoxName

      public void setRekenBoxName(String string)
      Fixed name of the rekenbox (or wrapper) to be called. If empty, the name is determined from the request
    • getRekenBoxName

      public String getRekenBoxName()
    • setRunPath

      public void setRunPath(String newRunPath)
      Directory on server where rekenbox-executable can be found
    • getRunPath

      public String getRunPath()
    • setTemplateDir

      public void setTemplateDir(String newTemplateDir)
      Rekenbox template directory on server
    • getTemplateDir

      public String getTemplateDir()
    • setInputOutputDirectory

      public void setInputOutputDirectory(String newInputOutputDirectory)
      Directory on server where input and output files are (temporarily) stored
    • getInputOutputDirectory

      public String getInputOutputDirectory()
    • setCommandLineType

      public void setCommandLineType(String newCommandLineType)
      Format of commandline of rekenbox. Possible values "straight": rekenbox is called like: rekenbox.exe inputFileName outputFileName templateDir "switches": rekenbox is called like: rekenbox.exe /IinputFileName /UoutputFileName /PtemplateDir "redirected": rekenbox is called like: rekenbox.exe inputFileName templateDir > outputFileName; (This method has not been fully tested)
    • getCommandLineType

      public String getCommandLineType()
    • setExecutableExtension

      public void setExecutableExtension(String newExecutableExtension)
      Extension of rekenbox-executable
    • getExecutableExtension

      public String getExecutableExtension()
    • setCleanup

      public void setCleanup(boolean newCleanup)
      If true, input and output files are removed after the call to the rekenbox is finished
    • isCleanup

      public boolean isCleanup()
    • setRekenboxSessionKey

      public void setRekenboxSessionKey(String newRekenboxSessionKey)
      Key in pipeLineSession to store rekenbox name in
    • getRekenboxSessionKey

      public String getRekenboxSessionKey()
    • setDataFilenamePrefix

      public void setDataFilenamePrefix(String string)
      First part of filenames that communicate requests and replies to rekenbox
    • getDataFilenamePrefix

      public String getDataFilenamePrefix()
    • setMaxRequestNumber

      public void setMaxRequestNumber(long l)
      Maximal number that will be concatenated to dataFilenamePrefix
    • getMaxRequestNumber

      public long getMaxRequestNumber()