Package com.dnanexus

Class DXExecution

  • Direct Known Subclasses:
    DXAnalysis, DXJob

    public abstract class DXExecution
    extends DXObject
    An execution (job or analysis).
    • Field Detail

      • cachedDescribe

        protected final com.fasterxml.jackson.databind.JsonNode cachedDescribe
    • 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 a DXExecution corresponding to an existing execution with the specified ID.
        Parameters:
        executionId - DNAnexus execution id
        Returns:
        a DXExecution handle to the specified object
      • getInstanceWithEnvironment

        public static DXExecution getInstanceWithEnvironment​(String executionId,
                                                             DXEnvironment env)
        Returns a DXExecution corresponding to an existing execution with the specified ID, using the specified environment.
        Parameters:
        executionId - DNAnexus execution id
        env - environment to use to make subsequent API requests
        Returns:
        a DXExecution handle to the specified object
      • checkCachedDescribeAvailable

        protected void checkCachedDescribeAvailable()
                                             throws IllegalStateException
        Verifies 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 Describe containing execution metadata
      • 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.