Class TaskContextImpl

java.lang.Object
fr.ens.biologie.genomique.eoulsan.core.workflow.TaskContextImpl
All Implemented Interfaces:
StepConfigurationContext, TaskContext, Serializable

public class TaskContextImpl extends Object implements TaskContext, Serializable
This class define a task context.
Since:
2.0
Author:
Laurent Jourdren
See Also:
  • Method Details

    • getId

      public int getId()
    • getContextName

      public String getContextName()
      Description copied from interface: TaskContext
      Get the context name.
      Specified by:
      getContextName in interface TaskContext
      Returns:
      a String with the context name
    • getLocalWorkingPathname

      public DataFile getLocalWorkingPathname()
      Get the local working directory.
      Returns:
      Returns the local working directory
    • getHadoopWorkingPathname

      public DataFile getHadoopWorkingPathname()
      Get the Hadoop working directory.
      Returns:
      Returns the Hadoop working directory
    • getJobDirectory

      public DataFile getJobDirectory()
      Get the job directory.
      Specified by:
      getJobDirectory in interface StepConfigurationContext
      Returns:
      Returns the job directory
    • getTaskOutputDirectory

      public DataFile getTaskOutputDirectory()
      Get the task output directory.
      Returns:
      Returns the task output directory
    • getDataRepositoryDirectory

      public DataFile getDataRepositoryDirectory()
      Get the data repository directory.
      Returns:
      Returns the data repository directory
    • getOutputDirectory

      public DataFile getOutputDirectory()
      Description copied from interface: StepConfigurationContext
      Get the output path.
      Specified by:
      getOutputDirectory in interface StepConfigurationContext
      Returns:
      Returns the output Path
    • getStepOutputDirectory

      public DataFile getStepOutputDirectory()
      Description copied from interface: StepConfigurationContext
      Get the step working directory.
      Specified by:
      getStepOutputDirectory in interface StepConfigurationContext
      Returns:
      Returns the step working directory
    • getJobId

      public String getJobId()
      Description copied from interface: StepConfigurationContext
      Get the job id.
      Specified by:
      getJobId in interface StepConfigurationContext
      Returns:
      the job id
    • getJobHost

      public String getJobHost()
      Description copied from interface: StepConfigurationContext
      Get the host of the job.
      Specified by:
      getJobHost in interface StepConfigurationContext
      Returns:
      a string with the host of the job
    • getContextCreationTime

      public long getContextCreationTime()
      Description copied from interface: TaskContext
      Get the creation time of the context.
      Specified by:
      getContextCreationTime in interface TaskContext
      Returns:
      the creation time of the context in milliseconds since epoch (1.1.1970)
    • getDesignFile

      public DataFile getDesignFile()
      Description copied from interface: StepConfigurationContext
      Get the design file path.
      Specified by:
      getDesignFile in interface StepConfigurationContext
      Returns:
      the design file path
    • getWorkflowFile

      public DataFile getWorkflowFile()
      Description copied from interface: StepConfigurationContext
      Get the workflow file path.
      Specified by:
      getWorkflowFile in interface StepConfigurationContext
      Returns:
      the workflow file path
    • getJarPathname

      public DataFile getJarPathname()
      Get the application jar path.
      Returns:
      Returns the jar path
    • getJobUUID

      public String getJobUUID()
      Description copied from interface: StepConfigurationContext
      Get the UUID of the job.
      Specified by:
      getJobUUID in interface StepConfigurationContext
      Returns:
      the job UUID
    • getJobDescription

      public String getJobDescription()
      Description copied from interface: StepConfigurationContext
      Get the job description.
      Specified by:
      getJobDescription in interface StepConfigurationContext
      Returns:
      the job description
    • getJobEnvironment

      public String getJobEnvironment()
      Description copied from interface: StepConfigurationContext
      Get the job environment.
      Specified by:
      getJobEnvironment in interface StepConfigurationContext
      Returns:
      the job environment
    • getCommandName

      public String getCommandName()
      Description copied from interface: StepConfigurationContext
      Get the command name.
      Specified by:
      getCommandName in interface StepConfigurationContext
      Returns:
      the command name
    • getCommandDescription

      public String getCommandDescription()
      Description copied from interface: StepConfigurationContext
      Get command description.
      Specified by:
      getCommandDescription in interface StepConfigurationContext
      Returns:
      the command description
    • getCommandAuthor

      public String getCommandAuthor()
      Description copied from interface: StepConfigurationContext
      Get the command author.
      Specified by:
      getCommandAuthor in interface StepConfigurationContext
      Returns:
      the command author
    • getWorkflow

      public Workflow getWorkflow()
      Description copied from interface: TaskContext
      Get the workflow description
      Specified by:
      getWorkflow in interface TaskContext
      Returns:
      the workflow description
    • getCurrentStep

      public Step getCurrentStep()
      Description copied from interface: StepConfigurationContext
      Get the current step.
      Specified by:
      getCurrentStep in interface StepConfigurationContext
      Returns:
      the current Step or null if no Step is currently running.
    • setContextName

      public void setContextName(String contextName)
      Description copied from interface: TaskContext
      Set the context name.
      Specified by:
      setContextName in interface TaskContext
      Parameters:
      contextName - the name of the context
    • getRuntime

      public AbstractEoulsanRuntime getRuntime()
      Description copied from interface: StepConfigurationContext
      Get EoulsanRuntime.
      Specified by:
      getRuntime in interface StepConfigurationContext
      Returns:
      the EoulsanRuntime
    • getSettings

      public Settings getSettings()
      Description copied from interface: StepConfigurationContext
      Get Eoulsan settings.
      Specified by:
      getSettings in interface StepConfigurationContext
      Returns:
      the Settings
    • getLogger

      public Logger getLogger()
      Description copied from interface: StepConfigurationContext
      Get the logger.
      Specified by:
      getLogger in interface StepConfigurationContext
      Returns:
      the logger
    • getGenericLogger

      public fr.ens.biologie.genomique.kenetre.log.GenericLogger getGenericLogger()
      Description copied from interface: StepConfigurationContext
      Get the generic logger.
      Specified by:
      getGenericLogger in interface StepConfigurationContext
      Returns:
      the generic logger
    • getInputData

      public Data getInputData(String portName)
      Description copied from interface: TaskContext
      Get the input data for a port name and a Sample.
      Specified by:
      getInputData in interface TaskContext
      Parameters:
      portName - the name of the port
      Returns:
      a String with the pathname
    • getInputData

      public Data getInputData(DataFormat format)
      Description copied from interface: TaskContext
      Get the input data for an input DataType and a Sample.
      Specified by:
      getInputData in interface TaskContext
      Parameters:
      format - the DataFormat of the source
      Returns:
      a String with the pathname
    • getOutputData

      public Data getOutputData(String portName, String dataName)
      Description copied from interface: TaskContext
      Get the output data for a port name and a Sample.
      Specified by:
      getOutputData in interface TaskContext
      Parameters:
      portName - the name of the port
      dataName - the name of the data
      Returns:
      a String with the pathname
    • getOutputData

      public Data getOutputData(String portName, String dataName, int part)
      Description copied from interface: TaskContext
      Get the output data for a port name and a Sample.
      Specified by:
      getOutputData in interface TaskContext
      Parameters:
      portName - the name of the port
      dataName - the name of the data
      part - data part
      Returns:
      a String with the pathname
    • getOutputData

      public Data getOutputData(String portName, Data origin)
      Description copied from interface: TaskContext
      Get the output data for a port name and a Sample.
      Specified by:
      getOutputData in interface TaskContext
      Parameters:
      portName - the name of the port
      origin - origin of the new data
      Returns:
      a String with the pathname
    • getOutputData

      public Data getOutputData(DataFormat format, String dataName)
      Description copied from interface: TaskContext
      Get the output data for an input DataType and a Sample.
      Specified by:
      getOutputData in interface TaskContext
      Parameters:
      format - the DataFormat of the source
      dataName - the name of the data
      Returns:
      a String with the pathname
    • getOutputData

      public Data getOutputData(DataFormat format, String dataName, int part)
      Description copied from interface: TaskContext
      Get the output data for an input DataType and a Sample.
      Specified by:
      getOutputData in interface TaskContext
      Parameters:
      format - the DataFormat of the source
      dataName - the name of the data
      part - data part
      Returns:
      a String with the pathname
    • getOutputData

      public Data getOutputData(DataFormat format, Data origin)
      Description copied from interface: TaskContext
      Get the output data for an input DataType and a Sample.
      Specified by:
      getOutputData in interface TaskContext
      Parameters:
      format - the DataFormat of the source
      origin - origin of the new data
      Returns:
      a String with the pathname
    • getLocalTempDirectory

      public File getLocalTempDirectory()
      Description copied from interface: StepConfigurationContext
      Get local temporary directory.
      Specified by:
      getLocalTempDirectory in interface StepConfigurationContext
      Returns:
      the local temporary directory
    • getTaskFilePrefix

      public String getTaskFilePrefix()
      Create the prefix of a related task file.
      Returns:
      a string with the prefix of the task file
    • getInputData

      public Data getInputData(InputPort port)
      Get raw access to input data stored in the object.
      Parameters:
      port - name of the input port
      Returns:
      a Data object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • serialize

      public void serialize(Path file) throws IOException
      Serialize the TaskContext object.
      Parameters:
      file - output DataFile
      Throws:
      IOException - if an error occurs while creating the file
    • serialize

      public void serialize(File file) throws IOException
      Serialize the TaskContext object.
      Parameters:
      file - output DataFile
      Throws:
      IOException - if an error occurs while creating the file
    • serialize

      public void serialize(DataFile file) throws IOException
      Serialize the TaskContext object.
      Parameters:
      file - output DataFile
      Throws:
      IOException - if an error occurs while creating the file
    • serialize

      public void serialize(OutputStream out) throws IOException
      Serialize the TaskContext object.
      Parameters:
      out - output stream
      Throws:
      IOException - if an error occurs while creating the file
    • deserialize

      public static TaskContextImpl deserialize(Path file) throws IOException
      Deserialize the TaskContext object. Warning: this method update the values of the settings of the Eoulsan runtime.
      Parameters:
      file - input DataFile
      Returns:
      a deserialized TaskContextImpl object
      Throws:
      IOException - if an error occurs while reading the file
    • deserialize

      public static TaskContextImpl deserialize(File file) throws IOException
      Deserialize the TaskContext object. Warning: this method update the values of the settings of the Eoulsan runtime.
      Parameters:
      file - input DataFile
      Returns:
      a deserialized TaskContextImpl object
      Throws:
      IOException - if an error occurs while reading the file
    • deserialize

      public static TaskContextImpl deserialize(DataFile file) throws IOException
      Deserialize the TaskContext object. Warning: this method update the values of the settings of the Eoulsan runtime.
      Parameters:
      file - input DataFile
      Returns:
      a deserialized TaskContextImpl object
      Throws:
      IOException - if an error occurs while reading the file
    • deserialize

      public static TaskContextImpl deserialize(InputStream in) throws IOException
      Deserialize the TaskContext object. Warning: this method update the values of the settings of the Eoulsan runtime.
      Parameters:
      in - input stream
      Returns:
      a deserialized TaskContextImpl object
      Throws:
      IOException - if an error occurs while reading the file
    • serializeOutputData

      public void serializeOutputData(Path file) throws IOException
      Serialize output data.
      Parameters:
      file - output file
      Throws:
      IOException - if an error occurs while creating the file
    • serializeOutputData

      public void serializeOutputData(File file) throws IOException
      Serialize output data.
      Parameters:
      file - output file
      Throws:
      IOException - if an error occurs while creating the file
    • serializeOutputData

      public void serializeOutputData(DataFile file) throws IOException
      Serialize output data.
      Parameters:
      file - output DataFile
      Throws:
      IOException - if an error occurs while creating the file
    • serializeOutputData

      public void serializeOutputData(OutputStream out) throws IOException
      Serialize output data.
      Parameters:
      out - output stream
      Throws:
      IOException - if an error occurs while creating the file
    • deserializeOutputData

      public void deserializeOutputData(DataFile file) throws IOException
      Deserialize output data.
      Parameters:
      file - input datafile
      Throws:
      IOException - if an error occurs while reading the file
    • deserializeOutputData

      public void deserializeOutputData(Path file) throws IOException
      Deserialize output data.
      Parameters:
      file - input file
      Throws:
      IOException - if an error occurs while reading the file
    • deserializeOutputData

      public void deserializeOutputData(File file) throws IOException
      Deserialize output data.
      Parameters:
      file - input file
      Throws:
      IOException - if an error occurs while reading the file
    • deserializeOutputData

      public void deserializeOutputData(InputStream in) throws IOException
      Deserialize output data.
      Parameters:
      in - input stream
      Throws:
      IOException - if an error occurs while reading the file