public class Job extends Object implements Comparable<Job>
| Modifier and Type | Class and Description |
|---|---|
static class |
Job.Priority |
static class |
Job.Status |
| Constructor and Description |
|---|
Job()
Create an empty representation of a job.
|
Job(Node jobXml)
Parse the job described by the provided XML document/node.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Job o) |
Argument |
getArgument(String name) |
List<Argument> |
getArguments()
Get all arguments, both inputs and outputs.
|
String |
getBatchId() |
List<Callback> |
getCallback() |
String |
getDescription() |
String |
getHref() |
String |
getId() |
List<Argument> |
getInputs() |
JobStorage |
getJobStorage() |
String |
getLogHref() |
List<Message> |
getMessages()
Get a list of all messages for the job.
|
String |
getNicename() |
List<Argument> |
getOutputs() |
Job.Priority |
getPriority() |
Result |
getResult()
Get the main Result object.
|
Result |
getResult(String argumentName)
Get the Result representing the argument with the given name.
|
Result |
getResult(String argumentName,
String href)
Get the Result representing the file with the given name from the argument with the given name.
|
static Result |
getResultFromHref(Node resultsXml,
String href)
Given the absolute href for the result, get the result without parsing the entire jobXml.
|
Result |
getResultFromHref(String href)
Get a result object for the result with the given absolute or relative href.
|
SortedMap<Result,List<Result>> |
getResults()
Get a map of all the Result objects.
|
List<Result> |
getResults(String argumentName)
Get the list of Results for the argument with the given name.
|
Script |
getScript() |
String |
getScriptHref() |
Job.Status |
getStatus() |
static List<Job> |
parseJobsXml(Node jobsXml)
Parse the list of jobs described by the provided XML document/node.
|
void |
setBatchId(String batchId) |
void |
setCallback(List<Callback> callback) |
void |
setDescription(String description) |
void |
setHref(String href) |
void |
setId(String id) |
void |
setInputs(List<Argument> argumentInputs) |
void |
setJobStorage(JobStorage storage) |
void |
setJobXml(Node jobXml)
Set job XML and re-enable lazy loading for the new XML.
|
void |
setLogHref(String logHref) |
void |
setMessages(List<Message> messages) |
void |
setNicename(String nicename) |
void |
setOutputs(List<Argument> argumentOutputs) |
void |
setPriority(Job.Priority priority) |
void |
setResults(Result result,
SortedMap<Result,List<Result>> results) |
void |
setScript(Script script) |
void |
setScriptHref(String scriptHref) |
void |
setStatus(Job.Status status) |
Document |
toJobRequestXml(boolean absoluteUris)
Create jobRequest XML.
|
Document |
toXml() |
String |
validate()
Check that all the inputs and options is filled out properly.
|
String |
validate(String name)
Check that the argument with then provided name is filled out properly.
|
public Job()
public Job(Node jobXml) throws Pipeline2Exception
jobXml - Pipeline2Exceptionpublic static Result getResultFromHref(Node resultsXml, String href)
resultsXml - href - base - Pipeline2ExceptionURISyntaxExceptionpublic Result getResult()
public Result getResult(String argumentName)
argumentName - public Result getResult(String argumentName, String href)
argumentName - href - filename with path relative to the argument.public List<Result> getResults(String argumentName)
argumentName - public SortedMap<Result,List<Result>> getResults()
public static List<Job> parseJobsXml(Node jobsXml) throws Pipeline2Exception
response - Pipeline2Exceptionpublic String validate()
public String validate(String name)
public String getId()
public String getHref()
public String getScriptHref()
public Script getScript()
public Job.Status getStatus()
public String getLogHref()
public String getNicename()
public String getDescription()
public String getBatchId()
public Job.Priority getPriority()
public JobStorage getJobStorage()
public void setId(String id)
public void setNicename(String nicename)
public void setDescription(String description)
public void setBatchId(String batchId)
public void setPriority(Job.Priority priority)
public void setJobStorage(JobStorage storage)
public void setHref(String href)
public void setStatus(Job.Status status)
public void setScriptHref(String scriptHref)
public void setScript(Script script)
public void setLogHref(String logHref)
public void setJobXml(Node jobXml)
public int compareTo(Job o)
compareTo in interface Comparable<Job>public Result getResultFromHref(String href)
href - if relative, must be relative to the top-level `…/results/` URL segment.public Document toXml()
public Document toJobRequestXml(boolean absoluteUris)
absoluteUris - base directory for filesCopyright © 2012–2016 The DAISY Consortium. All rights reserved.