Class TaskStatusImpl
- java.lang.Object
-
- fr.ens.biologie.genomique.eoulsan.core.workflow.TaskStatusImpl
-
- All Implemented Interfaces:
Progress
,TaskStatus
public class TaskStatusImpl extends Object implements TaskStatus
This class define a task status.- Since:
- 2.0
- Author:
- Laurent Jourdren
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TaskResult
createTaskResult()
Create a TaskResult object for a successful result.TaskResult
createTaskResult(boolean success)
Create a TaskResult object.TaskResult
createTaskResult(Throwable exception)
Create a TaskResult object.TaskResult
createTaskResult(Throwable exception, String exceptionMessage)
Create a TaskResult object.String
getCommandLine()
Get the context command line.Map<String,Long>
getCounters()
Get the sample counters.String
getDescription()
Get the context description.double
getProgress()
Get the progress of the context processing.String
getProgressMessage()
Get the progress message.void
setCommandLine(String commandLine)
Set the context command line.void
setCounters(fr.ens.biologie.genomique.kenetre.util.Reporter reporter, String counterGroup)
Set the context counters.void
setDescription(String description)
Set the context description.void
setProgress(double progress)
Set the progress of the processing.void
setProgress(int min, int max, int value)
Set the progress of the processing.void
setProgressMessage(String message)
Set the progress message.
-
-
-
Method Detail
-
getProgressMessage
public String getProgressMessage()
Description copied from interface:Progress
Get the progress message.- Specified by:
getProgressMessage
in interfaceProgress
- Returns:
- the message for the context
-
getCounters
public Map<String,Long> getCounters()
Description copied from interface:TaskStatus
Get the sample counters.- Specified by:
getCounters
in interfaceTaskStatus
- Returns:
- the sample counters as a map
-
getDescription
public String getDescription()
Description copied from interface:TaskStatus
Get the context description.- Specified by:
getDescription
in interfaceTaskStatus
- Returns:
- a String with the context description
-
getCommandLine
public String getCommandLine()
Description copied from interface:TaskStatus
Get the context command line.- Specified by:
getCommandLine
in interfaceTaskStatus
- Returns:
- a String with the context command line
-
getProgress
public double getProgress()
Description copied from interface:Progress
Get the progress of the context processing.- Specified by:
getProgress
in interfaceProgress
- Returns:
- the progress of the processing of the sample as percent (between 0.0 and 1.0)
-
setProgressMessage
public void setProgressMessage(String message)
Description copied from interface:Progress
Set the progress message.- Specified by:
setProgressMessage
in interfaceProgress
- Parameters:
message
- the message to set
-
setDescription
public void setDescription(String description)
Description copied from interface:TaskStatus
Set the context description.- Specified by:
setDescription
in interfaceTaskStatus
- Parameters:
description
- the description to set
-
setCommandLine
public void setCommandLine(String commandLine)
Description copied from interface:TaskStatus
Set the context command line.- Specified by:
setCommandLine
in interfaceTaskStatus
- Parameters:
commandLine
- the command line to set
-
setCounters
public void setCounters(fr.ens.biologie.genomique.kenetre.util.Reporter reporter, String counterGroup)
Description copied from interface:TaskStatus
Set the context counters.- Specified by:
setCounters
in interfaceTaskStatus
- Parameters:
reporter
- the reportercounterGroup
- counter group to use with the reporter
-
setProgress
public void setProgress(int min, int max, int value)
Description copied from interface:Progress
Set the progress of the processing.- Specified by:
setProgress
in interfaceProgress
- Parameters:
min
- minimal value of the progressmax
- maximal value of the progressvalue
- current value of the progress
-
setProgress
public void setProgress(double progress)
Description copied from interface:Progress
Set the progress of the processing.- Specified by:
setProgress
in interfaceProgress
- Parameters:
progress
- value of the progress. This value must be greater or equals to 0 and lower or equals to 1.0
-
createTaskResult
public TaskResult createTaskResult()
Description copied from interface:TaskStatus
Create a TaskResult object for a successful result.- Specified by:
createTaskResult
in interfaceTaskStatus
-
createTaskResult
public TaskResult createTaskResult(boolean success)
Description copied from interface:TaskStatus
Create a TaskResult object.- Specified by:
createTaskResult
in interfaceTaskStatus
- Parameters:
success
- true if the task is successful
-
createTaskResult
public TaskResult createTaskResult(Throwable exception, String exceptionMessage)
Description copied from interface:TaskStatus
Create a TaskResult object.- Specified by:
createTaskResult
in interfaceTaskStatus
- Parameters:
exception
- exception of the errorexceptionMessage
- Error message
-
createTaskResult
public TaskResult createTaskResult(Throwable exception)
Description copied from interface:TaskStatus
Create a TaskResult object.- Specified by:
createTaskResult
in interfaceTaskStatus
- Parameters:
exception
- exception of the error
-
-