Package com.dnanexus
Class DXJob
- java.lang.Object
-
- com.dnanexus.DXObject
-
- com.dnanexus.DXExecution
-
- com.dnanexus.DXJob
-
public final class DXJob extends DXExecution
A job object (a specific instantiation of an app or applet).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDXJob.DescribeContains metadata about a job.static classDXJob.StateTransitionA event where a job transitioned from one state to another.
-
Field Summary
-
Fields inherited from class com.dnanexus.DXExecution
cachedDescribe
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DXJob.Describedescribe()Obtains metadata about the execution.DXJob.DescribegetCachedDescribe()Returns metadata about the data object, likeDXExecution.describe(), but without making an API call.static DXJobgetInstance(String jobId)Returns aDXJobrepresenting the specified job.static DXJobgetInstanceWithEnvironment(String jobId, DXEnvironment env)Returns aDXJobrepresenting the specified job using the specified environment.<T> TgetOutput(Class<T> outputClass)Returns the output of the execution, deserialized to the specified class.voidterminate()Terminates the execution.DXJobwaitUntilDone()Waits until the job has successfully completed and is in the DONE state.-
Methods inherited from class com.dnanexus.DXExecution
checkCachedDescribeAvailable
-
Methods inherited from class com.dnanexus.DXObject
apiCallOnObject, apiCallOnObject, equals, getId, hashCode, toString
-
-
-
-
Method Detail
-
getInstance
public static DXJob getInstance(String jobId)
Returns aDXJobrepresenting the specified job.- Parameters:
jobId- Job ID, of the form"job-xxxx"- Returns:
- a
DXJob - Throws:
NullPointerException- IfjobIdis null
-
getInstanceWithEnvironment
public static DXJob getInstanceWithEnvironment(String jobId, DXEnvironment env)
Returns aDXJobrepresenting the specified job using the specified environment.- Parameters:
jobId- Job ID, of the form"job-xxxx"env- environment to use for making subsequent API calls- Returns:
- a
DXJob - Throws:
NullPointerException- IfjobIdorenvis null
-
describe
public DXJob.Describe describe()
Description copied from class:DXExecutionObtains metadata about the execution.- Specified by:
describein classDXExecution- Returns:
- a
Describecontaining execution metadata
-
getCachedDescribe
public DXJob.Describe getCachedDescribe()
Description copied from class:DXExecutionReturns metadata about the data object, likeDXExecution.describe(), but without making an API call.This cached describe info is only available if this object appears in the result of a
DXSearch.findExecutions()call that specifiedDXSearch.FindExecutionsRequestBuilder.includeDescribeOutput(). The describe info that is returned reflects the state of the object at the time that the search was performed.- Specified by:
getCachedDescribein classDXExecution- Returns:
- a
Describecontaining the execution's metadata
-
getOutput
public <T> T getOutput(Class<T> outputClass) throws IllegalStateException
Description copied from class:DXExecutionReturns the output of the execution, deserialized to the specified class.- Specified by:
getOutputin classDXExecution- Parameters:
outputClass- class to deserialize to- Returns:
- execution output
- Throws:
IllegalStateException- if the execution is not in the DONE state.
-
terminate
public void terminate()
Description copied from class:DXExecutionTerminates the execution.- Specified by:
terminatein classDXExecution
-
waitUntilDone
public DXJob waitUntilDone() throws IllegalStateException
Waits until the job has successfully completed and is in the DONE state.- Specified by:
waitUntilDonein classDXExecution- Returns:
- the same DXJob object
- Throws:
IllegalStateException- if the job reaches the FAILED or TERMINATED state
-
-