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 TaskResultImpldeserialize(DataFile file)Deserialize the TaskResult object.static TaskResultImpldeserialize(File file)Deserialize the TaskResult object.static TaskResultImpldeserialize(InputStream in)Deserialize the TaskResult object.longgetDuration()Get the duration of the step.StringgetErrorMessage()Get the error message.ThrowablegetException()Get the exception.booleanisSuccess()Test the result of the step is successful.voidserialize(DataFile file)Serialize the TaskResult object.voidserialize(File file)Serialize the TaskResult object.voidserialize(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:TaskResultGet the duration of the step.- Specified by:
getDurationin interfaceTaskResult- Returns:
- duration in milliseconds
-
isSuccess
public boolean isSuccess()
Description copied from interface:TaskResultTest the result of the step is successful.- Specified by:
isSuccessin interfaceTaskResult- Returns:
- Returns the success
-
getException
public Throwable getException()
Description copied from interface:TaskResultGet the exception.- Specified by:
getExceptionin interfaceTaskResult- Returns:
- Returns the exception
-
getErrorMessage
public String getErrorMessage()
Description copied from interface:TaskResultGet the error message.- Specified by:
getErrorMessagein 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
-
-