public class UnixRecord extends Record
Modifier and Type | Class and Description |
---|---|
static class |
UnixRecord.OutputInfo
OutputInfo represents an output file and its associated deploy type
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROP_COMMAND |
static java.lang.String |
PROP_DEPLOY_TYPE |
static java.lang.String |
PROP_ENVIRONMENT |
static java.lang.String |
PROP_FILE |
static java.lang.String |
PROP_fileS |
static java.lang.String |
PROP_LOGS |
static java.lang.String |
PROP_OPTIONS |
static java.lang.String |
PROP_OUTPUT_FILE |
static java.lang.String |
PROP_OUTPUTS |
static java.lang.String |
PROP_RC |
static java.lang.String |
PROP_ROOT_DIR |
static java.lang.String |
PROP_WORKING_DIRECTORY |
Constructor and Description |
---|
UnixRecord()
Construct a record with a default ID.
|
UnixRecord(java.lang.String id)
Construct a record with the supplied ID.
|
Modifier and Type | Method and 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.
|
public static final java.lang.String PROP_COMMAND
public static final java.lang.String PROP_OPTIONS
public static final java.lang.String PROP_RC
public static final java.lang.String PROP_FILE
public static final java.lang.String PROP_fileS
public static final java.lang.String PROP_OUTPUTS
public static final java.lang.String PROP_ROOT_DIR
public static final java.lang.String PROP_OUTPUT_FILE
public static final java.lang.String PROP_LOGS
public static final java.lang.String PROP_WORKING_DIRECTORY
public static final java.lang.String PROP_ENVIRONMENT
public static final java.lang.String PROP_DEPLOY_TYPE
public UnixRecord()
public UnixRecord(java.lang.String id)
id
- the id of the record.public void setFile(java.lang.String file)
file
- the source file pathpublic java.lang.String getFile()
public void addLogFile(java.io.File logFile)
logFile
- the log file to addpublic void addOutput(java.lang.String rootDir, java.lang.String file, java.lang.String deployType)
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 filepublic java.util.List<UnixRecord.OutputInfo> getOutputs()
public java.lang.String getCommand()
public void setCommand(java.lang.String command)
command
- the command to be stored in the reportpublic java.util.List<java.lang.String> getOptions()
public void setOptions(java.util.List<java.lang.String> options)
options
- the options used by the commandpublic int getRc()
public void setRc(int rc)
rc
- the RC from the command executionpublic java.util.List<java.io.File> getLogFiles()
public void setLogFiles(java.util.List<java.io.File> logFiles)
logFiles
- a list of log files to addpublic java.util.Map<java.lang.String,java.lang.String> getEnvironment()
public void setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
environment
- a set of key/value pairs describing the execution
environmentpublic java.lang.String getWorkingDirectory()
public void setWorkingDirectory(java.lang.String directory)
directory
- the directory pathpublic com.google.gson.JsonObject toJSON()
public UnixRecord parse(com.google.gson.JsonObject jsonObject) throws ParseException
parse
in class Record
jsonObject
- the JSON representation of a UnixRecordParseException
<IBM Copyright © 2018 IBM Corp. All Rights Reserved.