Class StepResult
java.lang.Object
fr.ens.biologie.genomique.eoulsan.core.workflow.StepResult
This class define a step result.
- Since:
- 2.0
- Author:
- Laurent Jourdren
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResult(TaskContextImpl context, TaskResultImpl result) Add a task result to the step result.getContextCounters(int contextId) Get the contextName counters.getContextMessage(int contextId) Get a context message.longGet the duration of the step.Get the error message.Get the exception.Get the step counters.Get step message.booleanTest if the object immutable.booleanTest if the step result is a success.voidRead a step result file.voidread(InputStream in) Read a step result file.voidSet the object immutable.Get a representation of the result in the old Eoulsan format.toJSON()Convert the object to JSONvoidWrite the result.voidwrite(OutputStream out, boolean oldFormat) Write the result.
-
Constructor Details
-
StepResult
Constructor.- Parameters:
step- the step
-
-
Method Details
-
getStepMessage
Get step message.- Returns:
- the step message in a String
-
getStepCounters
Get the step counters.- Returns:
- the step counters in a map
-
getContextMessage
Get a context message.- Parameters:
contextId- context id- Returns:
- the message for the context
-
getContextCounters
Get the contextName counters.- Parameters:
contextId- context id- Returns:
- the contextName counters as a map
-
isImmutable
public boolean isImmutable()Test if the object immutable.- Returns:
- true if the object is immutable
-
isSuccess
public boolean isSuccess()Test if the step result is a success.- Returns:
- true if the step result is a success
-
getException
Get the exception.- Returns:
- an Exception object or null if the step has not returned an Exception
-
getErrorMessage
Get the error message.- Returns:
- the error message
-
getDuration
public long getDuration()Get the duration of the step.- Returns:
- the duration of the step in milliseconds
-
setImmutable
public void setImmutable()Set the object immutable. -
addResult
Add a task result to the step result.- Parameters:
context- the context to executeresult- the result to add
-
toJSON
Convert the object to JSON- Returns:
- a string with the object content at the JSON format
-
toEoulsanLogV1
Get a representation of the result in the old Eoulsan format.- Returns:
- a String with the result
-
read
Read a step result file.- Parameters:
file- the file to read- Throws:
IOException- if an error occurs while reading the file
-
read
Read a step result file.- Parameters:
in- the input stream to read
-
write
Write the result.- Parameters:
file- output fileoldFormat- write the result in old Eoulsan format instead of JSON- Throws:
IOException- if an error occurs while writing result
-
write
Write the result.- Parameters:
out- output streamoldFormat- write the result in old Eoulsan format instead of JSON- Throws:
IOException- if an error occurs while writing result
-