Package com.ibm.dbb.build.report.records
Class UnixRecord
- java.lang.Object
-
- com.ibm.dbb.build.report.records.Record
-
- com.ibm.dbb.build.report.records.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 classUnixRecord.OutputInfoOutputInfo represents an output file and its associated deploy type
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROP_COMMANDstatic java.lang.StringPROP_DEPLOY_TYPEstatic java.lang.StringPROP_ENVIRONMENTstatic java.lang.StringPROP_FILEstatic java.lang.StringPROP_fileSstatic java.lang.StringPROP_LOGSstatic java.lang.StringPROP_OPTIONSstatic java.lang.StringPROP_OUTPUT_FILEstatic java.lang.StringPROP_OUTPUTSstatic java.lang.StringPROP_RCstatic java.lang.StringPROP_ROOT_DIRstatic java.lang.StringPROP_WORKING_DIRECTORY
-
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 voidaddLogFile(java.io.File logFile)Add a log file for this command execution.voidaddOutput(java.lang.String rootDir, java.lang.String file, java.lang.String deployType)Associate an output file to the build report.java.lang.StringgetCommand()Returns the command for this execution.java.util.Map<java.lang.String,java.lang.String>getEnvironment()Get the environment used to execute this commandjava.lang.StringgetFile()Get the source file associated with this command.java.util.List<java.io.File>getLogFiles()Get the logs associated with this command executionjava.util.List<java.lang.String>getOptions()Get the arguments passed to this commandjava.util.List<UnixRecord.OutputInfo>getOutputs()Get the list of outputs for this build reportintgetRc()Get the return code from the command executionjava.lang.StringgetWorkingDirectory()Get the working directory for this command executionUnixRecordparse(com.google.gson.JsonObject jsonObject)Create a UnixRecord from JSON.voidsetCommand(java.lang.String command)Set the command to be stored in the build report.voidsetEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)Sets the execution environment for this command execution in the build report.voidsetFile(java.lang.String file)Set the source file associated with this command.voidsetLogFiles(java.util.List<java.io.File> logFiles)Add a list of log files to the build report.voidsetOptions(java.util.List<java.lang.String> options)Set the options used by the command to be stored in the build report.voidsetRc(int rc)Set the return code from the command execution.voidsetWorkingDirectory(java.lang.String directory)Set the directory in which this command should execute.com.google.gson.JsonObjecttoJSON()Returns the record in JSON format.
-
-
-
Field Detail
-
PROP_COMMAND
public static final java.lang.String PROP_COMMAND
- See Also:
- Constant Field Values
-
PROP_OPTIONS
public static final java.lang.String PROP_OPTIONS
- See Also:
- Constant Field Values
-
PROP_RC
public static final java.lang.String PROP_RC
- See Also:
- Constant Field Values
-
PROP_FILE
public static final java.lang.String PROP_FILE
- See Also:
- Constant Field Values
-
PROP_fileS
public static final java.lang.String PROP_fileS
- See Also:
- Constant Field Values
-
PROP_OUTPUTS
public static final java.lang.String PROP_OUTPUTS
- See Also:
- Constant Field Values
-
PROP_ROOT_DIR
public static final java.lang.String PROP_ROOT_DIR
- See Also:
- Constant Field Values
-
PROP_OUTPUT_FILE
public static final java.lang.String PROP_OUTPUT_FILE
- See Also:
- Constant Field Values
-
PROP_LOGS
public static final java.lang.String PROP_LOGS
- See Also:
- Constant Field Values
-
PROP_WORKING_DIRECTORY
public static final java.lang.String PROP_WORKING_DIRECTORY
- See Also:
- Constant Field Values
-
PROP_ENVIRONMENT
public static final java.lang.String PROP_ENVIRONMENT
- See Also:
- Constant Field Values
-
PROP_DEPLOY_TYPE
public static final java.lang.String PROP_DEPLOY_TYPE
- See Also:
- Constant Field Values
-
-
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 filedeployType- 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.
-
parse
public UnixRecord parse(com.google.gson.JsonObject jsonObject) throws ParseException
Create a UnixRecord from JSON.- Overrides:
parsein classRecord- Parameters:
jsonObject- the JSON representation of a UnixRecord- Returns:
- a UnixRecord respresenting the supplied JSON content
- Throws:
ParseException
-
-