Class UnixRecord


  • public class UnixRecord
    extends Record
    A record to store information about executing a z/OS UNIX command.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  UnixRecord.OutputInfo
      OutputInfo represents an output file and its associated deploy type
    • Constructor Summary

      Constructors 
      Constructor Description
      UnixRecord()
      Construct a record with a default ID.
      UnixRecord​(java.lang.String id)
      Construct a record with the supplied ID.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addLogFile​(java.io.File logFile)
      Add a log file for this command execution.
      void addOutput​(java.lang.String rootDir, java.lang.String file, java.lang.String deployType)
      Associate an output file to the build report.
      java.lang.String getCommand()
      Returns the command for this execution.
      java.util.Map<java.lang.String,​java.lang.String> getEnvironment()
      Get the environment used to execute this command
      java.lang.String getFile()
      Get the source file associated with this command.
      java.util.List<java.io.File> getLogFiles()
      Get the logs associated with this command execution
      java.util.List<java.lang.String> getOptions()
      Get the arguments passed to this command
      java.util.List<UnixRecord.OutputInfo> getOutputs()
      Get the list of outputs for this build report
      int getRc()
      Get the return code from the command execution
      java.lang.String getWorkingDirectory()
      Get the working directory for this command execution
      UnixRecord parse​(com.google.gson.JsonObject jsonObject)
      Create a UnixRecord from JSON.
      void setCommand​(java.lang.String command)
      Set the command to be stored in the build report.
      void setEnvironment​(java.util.Map<java.lang.String,​java.lang.String> environment)
      Sets the execution environment for this command execution in the build report.
      void setFile​(java.lang.String file)
      Set the source file associated with this command.
      void setLogFiles​(java.util.List<java.io.File> logFiles)
      Add a list of log files to the build report.
      void setOptions​(java.util.List<java.lang.String> options)
      Set the options used by the command to be stored in the build report.
      void setRc​(int rc)
      Set the return code from the command execution.
      void setWorkingDirectory​(java.lang.String directory)
      Set the directory in which this command should execute.
      com.google.gson.JsonObject toJSON()
      Returns the record in JSON format.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UnixRecord

        public UnixRecord()
        Construct a record with a default ID.
      • UnixRecord

        public UnixRecord​(java.lang.String id)
        Construct a record with the supplied ID.
        Parameters:
        id - the id of the record.
    • Method Detail

      • setFile

        public void setFile​(java.lang.String file)
        Set the source file associated with this command.
        Parameters:
        file - the source file path
      • getFile

        public java.lang.String getFile()
        Get the source file associated with this command.
        Returns:
        the source file path
      • addLogFile

        public void addLogFile​(java.io.File logFile)
        Add a log file for this command execution.
        Parameters:
        logFile - the log file to add
      • addOutput

        public void addOutput​(java.lang.String rootDir,
                              java.lang.String file,
                              java.lang.String deployType)
        Associate an output file to the build report.
        Parameters:
        rootDir - The root directory of the file, or null if file is an absolute file path.
        file - Absolute or local path of the output file
        deployType - the deploy type of this output file
      • getOutputs

        public java.util.List<UnixRecord.OutputInfo> getOutputs()
        Get the list of outputs for this build report
        Returns:
        a list of output files and associated deploy types
      • getCommand

        public java.lang.String getCommand()
        Returns the command for this execution.
        Returns:
        the name of the command
      • setCommand

        public void setCommand​(java.lang.String command)
        Set the command to be stored in the build report.
        Parameters:
        command - the command to be stored in the report
      • getOptions

        public java.util.List<java.lang.String> getOptions()
        Get the arguments passed to this command
        Returns:
        list of command arguments
      • setOptions

        public void setOptions​(java.util.List<java.lang.String> options)
        Set the options used by the command to be stored in the build report.
        Parameters:
        options - the options used by the command
      • getRc

        public int getRc()
        Get the return code from the command execution
        Returns:
        the return code
      • setRc

        public void setRc​(int rc)
        Set the return code from the command execution.
        Parameters:
        rc - the RC from the command execution
      • getLogFiles

        public java.util.List<java.io.File> getLogFiles()
        Get the logs associated with this command execution
        Returns:
        the list of log files
      • setLogFiles

        public void setLogFiles​(java.util.List<java.io.File> logFiles)
        Add a list of log files to the build report.
        Parameters:
        logFiles - a list of log files to add
      • getEnvironment

        public java.util.Map<java.lang.String,​java.lang.String> getEnvironment()
        Get the environment used to execute this command
        Returns:
        the execution environment
      • setEnvironment

        public void setEnvironment​(java.util.Map<java.lang.String,​java.lang.String> environment)
        Sets the execution environment for this command execution in the build report.
        Parameters:
        environment - a set of key/value pairs describing the execution environment
      • getWorkingDirectory

        public java.lang.String getWorkingDirectory()
        Get the working directory for this command execution
        Returns:
        the working directory path
      • setWorkingDirectory

        public void setWorkingDirectory​(java.lang.String directory)
        Set the directory in which this command should execute.
        Parameters:
        directory - the directory path
      • toJSON

        public com.google.gson.JsonObject toJSON()
        Returns the record in JSON format.
        Overrides:
        toJSON in class Record
        Returns:
        the JSON format of this record.
      • parse

        public UnixRecord parse​(com.google.gson.JsonObject jsonObject)
                         throws ParseException
        Create a UnixRecord from JSON.
        Overrides:
        parse in class Record
        Parameters:
        jsonObject - the JSON representation of a UnixRecord
        Returns:
        a UnixRecord respresenting the supplied JSON content
        Throws:
        ParseException