Class TaskResultImpl
- java.lang.Object
-
- fr.ens.biologie.genomique.eoulsan.core.workflow.TaskResultImpl
-
- All Implemented Interfaces:
TaskResult
,Serializable
public class TaskResultImpl extends Object implements TaskResult, Serializable
This class define a result for a task context.- Since:
- 2.0
- Author:
- Laurent Jourdren
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TaskResultImpl(TaskContextImpl context, Date startTime, Date endTime, long duration, Throwable exception, String errorMessage)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TaskResultImpl
deserialize(DataFile file)
Deserialize the TaskResult object.static TaskResultImpl
deserialize(File file)
Deserialize the TaskResult object.static TaskResultImpl
deserialize(InputStream in)
Deserialize the TaskResult object.long
getDuration()
Get the duration of the step.String
getErrorMessage()
Get the error message.Throwable
getException()
Get the exception.boolean
isSuccess()
Test the result of the step is successful.void
serialize(DataFile file)
Serialize the TaskResult object.void
serialize(File file)
Serialize the TaskResult object.void
serialize(OutputStream out)
Serialize the TaskResult object.
-
-
-
Constructor Detail
-
TaskResultImpl
public TaskResultImpl(TaskContextImpl context, Date startTime, Date endTime, long duration, Throwable exception, String errorMessage)
-
-
Method Detail
-
getDuration
public long getDuration()
Description copied from interface:TaskResult
Get the duration of the step.- Specified by:
getDuration
in interfaceTaskResult
- Returns:
- duration in milliseconds
-
isSuccess
public boolean isSuccess()
Description copied from interface:TaskResult
Test the result of the step is successful.- Specified by:
isSuccess
in interfaceTaskResult
- Returns:
- Returns the success
-
getException
public Throwable getException()
Description copied from interface:TaskResult
Get the exception.- Specified by:
getException
in interfaceTaskResult
- Returns:
- Returns the exception
-
getErrorMessage
public String getErrorMessage()
Description copied from interface:TaskResult
Get the error message.- Specified by:
getErrorMessage
in interfaceTaskResult
- Returns:
- Returns the errorMessage
-
serialize
public void serialize(File file) throws IOException
Serialize the TaskResult 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 TaskResult object.- Parameters:
file
- output DataFile- Throws:
IOException
- if an error occurs while creating the file
-
serialize
public final void serialize(OutputStream out) throws IOException
Serialize the TaskResult object.- Parameters:
out
- output stream- Throws:
IOException
- if an error occurs while creating the file
-
deserialize
public static TaskResultImpl deserialize(File file) throws IOException
Deserialize the TaskResult object.- Parameters:
file
- input DataFile- Throws:
IOException
- if an error occurs while reading the file
-
deserialize
public static TaskResultImpl deserialize(DataFile file) throws IOException
Deserialize the TaskResult object.- Parameters:
file
- input DataFile- Throws:
IOException
- if an error occurs while reading the file
-
deserialize
public static TaskResultImpl deserialize(InputStream in) throws IOException
Deserialize the TaskResult object.- Parameters:
in
- input stream- Throws:
IOException
- if an error occurs while reading the file
-
-