Interface ExecutionPlanBuilder
- All Known Implementing Classes:
ExecutionPlanBuilderImpl
@ProviderType
public interface ExecutionPlanBuilder
Helps to construct an execution plan that can be serialized and given to the packaging backend for execution.
-
Method Summary
Modifier and TypeMethodDescription@NotNull PackageTaskBuilderaddTask()Adds a new task to this builder.@NotNull ExecutionPlanexecute()Builds an executes the plan synchronously.@NotNull ExecutionPlanBuilderload(@NotNull InputStream in) Loads the tasks from a serialized plan and replaces the plans already in this builder.preview()Triggers validation and returnsPackageIds of all packages to be installed by this builder@NotNull ExecutionPlanBuildersave(@NotNull OutputStream out) Serializes the tasks of this plan.@NotNull ExecutionPlanBuildervalidate()Validates this plan.@NotNull ExecutionPlanBuilderSets packages handled externally ahead of execution for prevalidation of plan@NotNull ExecutionPlanBuilderSets the JCR session for this execution plan.@NotNull ExecutionPlanBuilderwith(@NotNull ProgressTrackerListener listener) Sets the progress tracker listener for this plan.
-
Method Details
-
load
Loads the tasks from a serialized plan and replaces the plans already in this builder.- Parameters:
in- input stream to the data.- Returns:
- this
- Throws:
IOException- if an I/O error occurrs.
-
save
@NotNull @NotNull ExecutionPlanBuilder save(@NotNull @NotNull OutputStream out) throws IOException, PackageException Serializes the tasks of this plan.- Parameters:
out- the output stream- Returns:
- this
- Throws:
IOException- if an I/O error occurrs.PackageException- if this builder does not have valid tasks.
-
addTask
Adds a new task to this builder.- Returns:
- an package task builder that helps to assemble the task.
-
validate
Validates this plan.- Returns:
- this
- Throws:
IOException- if an I/O error occurrs.PackageException- if the plan is not valid.
-
with
Sets the JCR session for this execution plan.- Parameters:
session- the session- Returns:
- this
-
with
Sets the progress tracker listener for this plan.- Parameters:
listener- the listener- Returns:
- this
-
with
Sets packages handled externally ahead of execution for prevalidation of plan- Parameters:
externalPackages- Set of package ids handled by other builder- Returns:
- this
-
preview
Triggers validation and returnsPackageIds of all packages to be installed by this builder- Returns:
- Set of packages to be installed by this builder.
- Throws:
IOException- if an I/O error occurs.PackageException- if the plan is not valid.
-
execute
Builds an executes the plan synchronously. Does not throw an exception in case one or multiple task executions fail, therefore the caller should checkExecutionPlan.hasErrors()after calling this method.- Returns:
- the execution plan.
- Throws:
IOException- if an I/O error occurs.PackageException- if the plan contains an unsupported task.
-