Class ExecuteProcessSupport


  • public class ExecuteProcessSupport
    extends java.lang.Object
    This support class encapsulates the information about a process launched natively on a target system. This class is used by the SystemUtilService.executeProcess() method and stores process execution status, return code, and user credentials
    • Constructor Detail

      • ExecuteProcessSupport

        public ExecuteProcessSupport​(java.lang.String command,
                                     java.lang.String[] args)
      • ExecuteProcessSupport

        public ExecuteProcessSupport​(java.lang.String command,
                                     java.lang.String[] args,
                                     java.lang.String stdOutDestination,
                                     java.lang.String stdErrDestination)
    • Method Detail

      • getCommand

        public java.lang.String getCommand()
      • getArguments

        public java.lang.String[] getArguments()
      • getArgumentString

        public java.lang.String getArgumentString()
      • getStdOutDestination

        public java.lang.String getStdOutDestination()
      • getStdErrDestination

        public java.lang.String getStdErrDestination()
      • getUsername

        public java.lang.String getUsername()
      • setUsername

        public void setUsername​(java.lang.String username)
      • getPassword

        public java.lang.String getPassword()
      • setPassword

        public void setPassword​(java.lang.String password)
      • getWorkgroup

        public java.lang.String getWorkgroup()
      • setWorkgroup

        public void setWorkgroup​(java.lang.String workgroup)
      • isRunNatively

        public boolean isRunNatively()
      • setRunNatively

        public void setRunNatively​(boolean runAsDifferentUser)
      • isProcessStarted

        public boolean isProcessStarted()
      • setProcessStarted

        public void setProcessStarted()
      • isProcessFinished

        public boolean isProcessFinished()
      • setProcessFinished

        public void setProcessFinished()
      • setProcessError

        public void setProcessError()
      • isProcessError

        public boolean isProcessError()
      • getProcessReturnCode

        public int getProcessReturnCode()
        Returns the external process (or command's) exit code. This value will be set by the native process execution routine.
        Returns:
      • setProcessReturnCode

        public void setProcessReturnCode​(int exitCode)
        Sets the return code. The native process execution routine will write this value from the launched process.
        Parameters:
        exitCode -
      • getStdErrorStream

        public java.io.PipedOutputStream getStdErrorStream()
        Returns the OutputStream cooresponding to stderr. The native process execution routine will write the standard error from the launched process to this OutputStream.
        Returns:
        OutputStream - The stream that cooresponds to stderr.
      • getStdOutputStream

        public java.io.PipedOutputStream getStdOutputStream()
        Returns the OutputStream cooresponding to stdout. The native process execution routine will write the standard output from the launched process to this OutputStream.
        Returns:
        OutputStream - The stream that cooresponds to stdout.
      • addCreatedFileOrDirectory

        public void addCreatedFileOrDirectory​(java.lang.String entry)
        Adds an entry to the internal collection of files or directories created by running the native process execution routine. This is used to removed created files and dirs when the uninstaller is run
        Parameters:
        entry - - A file or directory path
      • addCreatedFilesOrDirectories

        public void addCreatedFilesOrDirectories​(java.lang.String[] entries)
        Adds the array of entries to the internal collection of files and directories created by running the native process execution routine.
        Parameters:
        entries - - An array of files or directories
      • getCreatedFilesOrDirectories

        public java.lang.String[] getCreatedFilesOrDirectories()
        Returns an array of files and/or directories created by running the native process execution routine.
        Returns:
        String[] The files and/or directories created
      • setProcessOutputHandler

        public void setProcessOutputHandler​(ProcessOutputHandler procOutHandler)
        Sets the ProcessOutputHandler that will process the stdout or stderr streams from the launched process.
        Parameters:
        procOutHandler - - ProcessOutputHandler The handler for the stdout or stderr stream for the launched process
        See Also:
        ProcessOutputHandler
      • getProcessOutputHandler

        public ProcessOutputHandler getProcessOutputHandler()
        Returns the ProcessOutputHandler that will process the stdout or stderr streams from the launched process.
        Returns:
        ProcessOutputHandler
        See Also:
        ProcessOutputHandler