Package com.dnanexus
Class DXExecution
- java.lang.Object
-
- com.dnanexus.DXObject
-
- com.dnanexus.DXExecution
-
- Direct Known Subclasses:
DXAnalysis,DXJob
public abstract class DXExecution extends DXObject
An execution (job or analysis).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDXExecution.DescribeContains metadata about an execution.protected static classDXExecution.DescribeResponseHashDeserialized output from the /analysis-xxxx/describe or /job-xxxx/describe route (fields common to all executions only).
-
Field Summary
Fields Modifier and Type Field Description protected com.fasterxml.jackson.databind.JsonNodecachedDescribe
-
Constructor Summary
Constructors Modifier Constructor Description protectedDXExecution(String dxId, String className, DXEnvironment env)Initializes a new execution with the specified execution ID and environment.protectedDXExecution(String dxId, String className, DXEnvironment env, com.fasterxml.jackson.databind.JsonNode cachedDescribe)Initializes a new execution with the specified execution ID, environment, and cached describe data.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckCachedDescribeAvailable()Verifies that this object carries cached describe data.abstract DXExecution.Describedescribe()Obtains metadata about the execution.abstract DXExecution.DescribegetCachedDescribe()Returns metadata about the data object, likedescribe(), but without making an API call.static DXExecutiongetInstance(String executionId)Returns aDXExecutioncorresponding to an existing execution with the specified ID.static DXExecutiongetInstanceWithEnvironment(String executionId, DXEnvironment env)Returns aDXExecutioncorresponding to an existing execution with the specified ID, using the specified environment.abstract <T> TgetOutput(Class<T> outputClass)Returns the output of the execution, deserialized to the specified class.abstract voidterminate()Terminates the execution.abstract DXExecutionwaitUntilDone()Waits until the execution has successfully completed and is in the DONE state.-
Methods inherited from class com.dnanexus.DXObject
apiCallOnObject, apiCallOnObject, equals, getId, hashCode, toString
-
-
-
-
Constructor Detail
-
DXExecution
protected DXExecution(String dxId, String className, DXEnvironment env)
Initializes a new execution with the specified execution ID and environment.- Parameters:
className- class name that should prefix the ID
-
DXExecution
protected DXExecution(String dxId, String className, DXEnvironment env, com.fasterxml.jackson.databind.JsonNode cachedDescribe)
Initializes a new execution with the specified execution ID, environment, and cached describe data.- Parameters:
className- class name that should prefix the ID
-
-
Method Detail
-
getInstance
public static DXExecution getInstance(String executionId)
Returns aDXExecutioncorresponding to an existing execution with the specified ID.- Parameters:
executionId- DNAnexus execution id- Returns:
- a
DXExecutionhandle to the specified object
-
getInstanceWithEnvironment
public static DXExecution getInstanceWithEnvironment(String executionId, DXEnvironment env)
Returns aDXExecutioncorresponding to an existing execution with the specified ID, using the specified environment.- Parameters:
executionId- DNAnexus execution idenv- environment to use to make subsequent API requests- Returns:
- a
DXExecutionhandle to the specified object
-
checkCachedDescribeAvailable
protected void checkCachedDescribeAvailable() throws IllegalStateExceptionVerifies that this object carries cached describe data.- Throws:
IllegalStateException- if cachedDescribe is not set
-
describe
public abstract DXExecution.Describe describe()
Obtains metadata about the execution.- Returns:
- a
Describecontaining execution metadata
-
getCachedDescribe
public abstract DXExecution.Describe getCachedDescribe()
Returns metadata about the data object, likedescribe(), 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.- Returns:
- a
Describecontaining the execution's metadata - Throws:
IllegalStateException- if no cached describe info is available
-
getOutput
public abstract <T> T getOutput(Class<T> outputClass) throws IllegalStateException
Returns the output of the execution, deserialized to the specified class.- Parameters:
outputClass- class to deserialize to- Returns:
- execution output
- Throws:
IllegalStateException- if the execution is not in the DONE state.
-
terminate
public abstract void terminate()
Terminates the execution.
-
waitUntilDone
public abstract DXExecution waitUntilDone() throws IllegalStateException
Waits until the execution has successfully completed and is in the DONE state.- Returns:
- the same DXExecution object
- Throws:
IllegalStateException- if the execution reaches the FAILED or TERMINATED state.
-
-