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 Link icon

    • RekenBoxCaller Link icon

      public RekenBoxCaller()
  • Method Details Link icon

    • configure Link icon

      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 Link icon

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

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

      public String getBaseFileName()
    • doPipe Link icon

      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 Link icon

      @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 Link icon

      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 Link icon

      public String getRekenBoxName()
    • setRunPath Link icon

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

      public String getRunPath()
    • setTemplateDir Link icon

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

      public String getTemplateDir()
    • setInputOutputDirectory Link icon

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

      public String getInputOutputDirectory()
    • setCommandLineType Link icon

      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 Link icon

      public String getCommandLineType()
    • setExecutableExtension Link icon

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

      public String getExecutableExtension()
    • setCleanup Link icon

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

      public boolean isCleanup()
    • setRekenboxSessionKey Link icon

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

      public String getRekenboxSessionKey()
    • setDataFilenamePrefix Link icon

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

      public String getDataFilenamePrefix()
    • setMaxRequestNumber Link icon

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

      public long getMaxRequestNumber()