Package step.core.plans.runner
Class PlanRunnerResult
- java.lang.Object
-
- step.core.plans.runner.PlanRunnerResult
-
- Direct Known Subclasses:
RemoteExecutionFuture
,RemotePlanRunner.RemotePlanRunnerResult
public class PlanRunnerResult extends java.lang.Object
This class provides an API for the manipulation of plan executions
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
executionId
protected ReportTreeAccessor
reportTreeAccessor
protected ResourceManager
resourceManager
protected java.lang.String
rootReportNodeId
-
Constructor Summary
Constructors Constructor Description PlanRunnerResult(java.lang.String executionId, java.lang.String rootReportNodeId, ReportTreeAccessor reportTreeAccessor)
PlanRunnerResult(java.lang.String executionId, java.lang.String rootReportNodeId, ReportTreeAccessor reportTreeAccessor, ResourceManager resourceManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getExecutionId()
ReportTreeAccessor
getReportTreeAccessor()
protected ReportTreeVisitor
getReportTreeVisitor()
ReportNodeStatus
getResult()
java.lang.String
getTreeAsString()
PlanRunnerResult
printTree()
Prints the result tree to the standard outputPlanRunnerResult
printTree(java.io.Writer writer)
Prints the result tree to theWriter
provided as inputPlanRunnerResult
printTree(java.io.Writer writer, boolean printAttachments)
Prints the result tree to theWriter
provided as inputPlanRunnerResult
visitReportNodes(java.util.function.Consumer<ReportNode> consumer)
Visits the report tree of the execution using theConsumer
ofReportNode
PlanRunnerResult
visitReportTree(java.util.function.Consumer<ReportTreeVisitor.ReportNodeEvent> consumer)
Visits the report tree of the execution using theConsumer
ofReportTreeVisitor.ReportNodeEvent
PlanRunnerResult
waitForExecutionToTerminate()
Wait indefinitely for an the execution to terminatePlanRunnerResult
waitForExecutionToTerminate(long timeout)
Wait for an the execution to terminatePlanRunnerResult
writeReport(ReportWriter reportWriter, java.io.File outputFile)
Writes a report of the execution using the providedReportWriter
-
-
-
Field Detail
-
executionId
protected final java.lang.String executionId
-
rootReportNodeId
protected final java.lang.String rootReportNodeId
-
reportTreeAccessor
protected final ReportTreeAccessor reportTreeAccessor
-
resourceManager
protected final ResourceManager resourceManager
-
-
Constructor Detail
-
PlanRunnerResult
public PlanRunnerResult(java.lang.String executionId, java.lang.String rootReportNodeId, ReportTreeAccessor reportTreeAccessor)
-
PlanRunnerResult
public PlanRunnerResult(java.lang.String executionId, java.lang.String rootReportNodeId, ReportTreeAccessor reportTreeAccessor, ResourceManager resourceManager)
-
-
Method Detail
-
getResult
public ReportNodeStatus getResult()
-
getExecutionId
public java.lang.String getExecutionId()
-
getReportTreeAccessor
public ReportTreeAccessor getReportTreeAccessor()
-
visitReportNodes
public PlanRunnerResult visitReportNodes(java.util.function.Consumer<ReportNode> consumer)
Visits the report tree of the execution using theConsumer
ofReportNode
- Parameters:
consumer
-- Returns:
-
visitReportTree
public PlanRunnerResult visitReportTree(java.util.function.Consumer<ReportTreeVisitor.ReportNodeEvent> consumer)
Visits the report tree of the execution using theConsumer
ofReportTreeVisitor.ReportNodeEvent
- Parameters:
consumer
-- Returns:
-
getReportTreeVisitor
protected ReportTreeVisitor getReportTreeVisitor()
-
waitForExecutionToTerminate
public PlanRunnerResult waitForExecutionToTerminate(long timeout) throws java.util.concurrent.TimeoutException, java.lang.InterruptedException
Wait for an the execution to terminate- Parameters:
timeout
- the timeout in ms- Returns:
- Throws:
java.util.concurrent.TimeoutException
java.lang.InterruptedException
-
waitForExecutionToTerminate
public PlanRunnerResult waitForExecutionToTerminate() throws java.util.concurrent.TimeoutException, java.lang.InterruptedException
Wait indefinitely for an the execution to terminate- Returns:
- Throws:
java.util.concurrent.TimeoutException
java.lang.InterruptedException
-
printTree
public PlanRunnerResult printTree() throws java.io.IOException
Prints the result tree to the standard output- Returns:
- Throws:
java.io.IOException
-
printTree
public PlanRunnerResult printTree(java.io.Writer writer) throws java.io.IOException
Prints the result tree to theWriter
provided as input- Parameters:
writer
-- Returns:
- Throws:
java.io.IOException
-
printTree
public PlanRunnerResult printTree(java.io.Writer writer, boolean printAttachments) throws java.io.IOException
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:
- Throws:
java.io.IOException
-
getTreeAsString
public java.lang.String getTreeAsString() throws java.io.IOException
- Throws:
java.io.IOException
-
writeReport
public PlanRunnerResult writeReport(ReportWriter reportWriter, java.io.File outputFile) throws java.io.IOException
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:
java.io.IOException
- if an exception occurs while writing the report
-
-