Package com.dnanexus

Class ExecutableRunner<T extends DXExecution>

  • Type Parameters:
    T - the type of the execution that will be produced

    public abstract class ExecutableRunner<T extends DXExecution>
    extends Object
    Collects parameters for a new run of an executable. To obtain an instance, call DXExecutable.newRun().
    • Field Detail

      • executableId

        protected final String executableId
      • MAPPER

        protected static final com.fasterxml.jackson.databind.ObjectMapper MAPPER
    • Method Detail

      • addTags

        public ExecutableRunner<T> addTags​(Collection<String> tags)
        Adds the specified tags to the resulting execution.
        Parameters:
        tags - tags to add
        Returns:
        the same runner object
      • delayWorkspaceDestruction

        public ExecutableRunner<T> delayWorkspaceDestruction()
        Delays the destruction of the workspace of the resulting job so it can be examined for debugging.
        Returns:
        the same runner object
      • dependsOn

        public ExecutableRunner<T> dependsOn​(DXDataObject dataObject)
        Makes the resulting execution depend on the specified data object, so that the execution will not begin until the data object is closed.
        Parameters:
        dataObject - data object to depend on
        Returns:
        the same runner object
      • dependsOn

        public ExecutableRunner<T> dependsOn​(DXExecution execution)
        Makes the resulting execution depend on the specified execution, so that the former will not begin until the latter has successfully completed.
        Parameters:
        execution - execution to depend on
        Returns:
        the same runner object
      • inFolder

        @Deprecated
        public ExecutableRunner<T> inFolder​(String folder)
        Deprecated.
        Use setFolder(String) instead
        Sets the folder in which the execution's outputs will be deposited.
        Parameters:
        folder - full path to folder (a String starting with "/")
        Returns:
        the same runner object
      • putAllProperties

        public ExecutableRunner<T> putAllProperties​(Map<String,​String> properties)
        Sets the specified properties on the execution to be created.
        Parameters:
        properties - Map containing non-null keys and values which will be set as property keys and values respectively
        Returns:
        the same Builder object
      • putProperty

        public ExecutableRunner<T> putProperty​(String key,
                                               String value)
        Sets the specified property on the execution to be created.
        Parameters:
        key - property key to set
        value - property value to set
        Returns:
        the same Builder object
      • run

        public abstract T run()
        Runs the executable.
        Returns:
        the resulting execution object
      • setDetails

        public ExecutableRunner<T> setDetails​(Object details)
        Sets the execution details to the JSON serialized value of the specified object.
        Parameters:
        details - user-supplied metadata
        Returns:
        the same runner object
      • setFolder

        public ExecutableRunner<T> setFolder​(String folder)
        Sets the folder in which the execution's outputs will be deposited.
        Parameters:
        folder - full path to folder (a String starting with "/")
        Returns:
        the same runner object
      • setInput

        public ExecutableRunner<T> setInput​(Object inputObject)
        Sets the input hash to the JSON serialized value of the specified object.
        Parameters:
        inputObject - object to be JSON serialized
        Returns:
        the same runner object
      • setName

        public ExecutableRunner<T> setName​(String name)
        Sets the name of the resulting execution.
        Parameters:
        name - job name
        Returns:
        the same runner object
      • setProject

        public ExecutableRunner<T> setProject​(DXProject project)
        Sets the project context of the resulting execution.
        Parameters:
        project - project in which the executable will be run
        Returns:
        the same runner object
      • setRawInput

        public ExecutableRunner<T> setRawInput​(com.fasterxml.jackson.databind.JsonNode inputHash)
        Sets the input hash to the specified JSON node.
        Parameters:
        inputHash -
        Returns:
        the same runner object
      • withDetails

        @Deprecated
        public ExecutableRunner<T> withDetails​(Object details)
        Deprecated.
        Use setDetails(Object) instead
        Sets the execution details to the JSON serialized value of the specified object.
        Parameters:
        details - user-supplied metadata
        Returns:
        the same runner object
      • withInput

        @Deprecated
        public ExecutableRunner<T> withInput​(Object inputObject)
        Deprecated.
        Use setInput(Object) instead
        Sets the input hash to the JSON serialized value of the specified object.
        Parameters:
        inputObject - object to be JSON serialized
        Returns:
        the same runner object
      • withRawInput

        @Deprecated
        public ExecutableRunner<T> withRawInput​(com.fasterxml.jackson.databind.JsonNode inputHash)
        Deprecated.
        Sets the input hash to the specified JSON node.
        Parameters:
        inputHash -
        Returns:
        the same runner object