Package step.core.plans.runner
Class PlanRunnerResult
java.lang.Object
step.core.plans.runner.PlanRunnerResult
- Direct Known Subclasses:
RemoteExecutionFuture
,RemotePlanRunner.RemotePlanRunnerResult
This class provides an API for the manipulation of plan executions
-
Field Summary
Modifier and TypeFieldDescriptionprotected final String
protected final ReportTreeAccessor
protected final ResourceManager
protected final String
-
Constructor Summary
ConstructorDescriptionPlanRunnerResult
(String executionId, String rootReportNodeId, ReportTreeAccessor reportTreeAccessor) PlanRunnerResult
(String executionId, String rootReportNodeId, ReportTreeAccessor reportTreeAccessor, ResourceManager resourceManager) -
Method Summary
Modifier and TypeMethodDescriptiongetErrorCodes
(int limit) Stream<step.core.reports.Error>
protected ReportTreeVisitor
Prints the result tree to the standard outputPrints the result tree to theWriter
provided as inputPrints the result tree to theWriter
provided as inputPrints the result tree to theWriter
provided as inputvisitReportNodes
(Consumer<ReportNode> consumer) Visits the report tree of the execution using theConsumer
ofReportNode
Visits the report tree of the execution using theConsumer
ofReportTreeVisitor.ReportNodeEvent
Wait indefinitely for an the execution to terminatewaitForExecutionToTerminate
(long timeout) Wait for an the execution to terminatewriteReport
(ReportWriter reportWriter, File outputFile) Writes a report of the execution using the providedReportWriter
-
Field Details
-
executionId
-
rootReportNodeId
-
reportTreeAccessor
-
resourceManager
-
-
Constructor Details
-
PlanRunnerResult
public PlanRunnerResult(String executionId, String rootReportNodeId, ReportTreeAccessor reportTreeAccessor) -
PlanRunnerResult
public PlanRunnerResult(String executionId, String rootReportNodeId, ReportTreeAccessor reportTreeAccessor, ResourceManager resourceManager)
-
-
Method Details
-
getResult
-
getRootReportNode
-
getReportNodesWithErrors
- Returns:
- a stream of all report nodes with errors that caused this execution to fail.
This returns only the so-called contributing errors according to following definition
ReportNode.getContributingError()
-
getErrors
- Returns:
- a stream of all errors that caused this execution to fail.
This returns only the so-called contributing errors according to following definition
ReportNode.getContributingError()
-
getErrorSummary
- Returns:
- a concatenation of the first 10 error messages that caused this execution to fail.
This considers only the so-called contributing errors according to following definition
ReportNode.getContributingError()
-
getErrorCodes
- Parameters:
limit
- the max errors to be scanned- Returns:
- a
Set
containing the error codes of the first n errors where n is set by the limit parameter.
-
getExecutionId
-
getReportTreeAccessor
-
visitReportNodes
Visits the report tree of the execution using theConsumer
ofReportNode
- Parameters:
consumer
- the visitor- Returns:
- this instance
-
visitReportTree
Visits the report tree of the execution using theConsumer
ofReportTreeVisitor.ReportNodeEvent
- Parameters:
consumer
- the visitor- Returns:
- this instance
-
getReportTreeVisitor
-
waitForExecutionToTerminate
public PlanRunnerResult waitForExecutionToTerminate(long timeout) throws TimeoutException, InterruptedException Wait for an the execution to terminate- Parameters:
timeout
- the timeout in ms- Returns:
- this instance
- Throws:
TimeoutException
InterruptedException
-
waitForExecutionToTerminate
Wait indefinitely for an the execution to terminate- Returns:
- this instance
- Throws:
TimeoutException
InterruptedException
-
printTree
Prints the result tree to the standard output- Returns:
- this instance
- Throws:
IOException
-
printTree
Prints the result tree to theWriter
provided as input- Parameters:
writer
-- Returns:
- this instance
- Throws:
IOException
-
printTree
Prints the result tree to theWriter
provided as input- Parameters:
writer
-printAttachments
- if the attachments of the report nodes have to be printed out (currently restricted to attachments called "exception.log")- Returns:
- this instance
- Throws:
IOException
-
printTree
public PlanRunnerResult printTree(Writer writer, boolean printNodeDetails, boolean printAttachments) throws IOException Prints the result tree to theWriter
provided as input- Parameters:
writer
-printNodeDetails
- if the details of the report nodes should be printed outprintAttachments
- if the attachments of the report nodes have to be printed out (currently restricted to attachments called "exception.log")- Returns:
- this instance
- Throws:
IOException
-
getTreeAsString
- Throws:
IOException
-
writeReport
Writes a report of the execution using the providedReportWriter
- Parameters:
reportWriter
- theReportWriter
to be used to write the reportoutputFile
- the output file of the report- Returns:
- this instance
- Throws:
IOException
- if an exception occurs while writing the report
-