Interface ExecutionPlanBuilder
-
@ProviderType public interface ExecutionPlanBuilder
Helps to construct an execution plan that can be serialized and given to the packaging backend for execution.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PackageTaskBuilderaddTask()Adds a new task to this builder.ExecutionPlanexecute()builds an executes the plan synchronously.ExecutionPlanBuilderload(InputStream in)Loads the tasks from a serialized plan and replaces the plans already in this builder.Set<PackageId>preview()Triggers Validation and returns PackageIds of all packages to be installed by this builderExecutionPlanBuildersave(OutputStream out)Serializes the tasks of this plan.ExecutionPlanBuildervalidate()Validates this plan.ExecutionPlanBuilderwith(Set<PackageId> externalPackages)Sets packages handled externally ahead of execution for prevalidation of planExecutionPlanBuilderwith(Session session)Sets the JCR session for this execution plan.ExecutionPlanBuilderwith(ProgressTrackerListener listener)Sets the progress tracker listener for this plan.
-
-
-
Method Detail
-
load
@Nonnull ExecutionPlanBuilder load(@Nonnull InputStream in) throws IOException
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
@Nonnull ExecutionPlanBuilder save(@Nonnull 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
@Nonnull PackageTaskBuilder addTask()
Adds a new task to this builder.- Returns:
- an package task builder that helps to assemble the task.
-
validate
@Nonnull ExecutionPlanBuilder validate() throws IOException, PackageException
Validates this plan.- Returns:
- this.
- Throws:
IOException- if an I/O error occurrs.PackageException- if the plan is not valid.
-
with
@Nonnull ExecutionPlanBuilder with(@Nonnull Session session)
Sets the JCR session for this execution plan.- Parameters:
session- the session- Returns:
- this.
-
with
@Nonnull ExecutionPlanBuilder with(@Nonnull ProgressTrackerListener listener)
Sets the progress tracker listener for this plan.- Parameters:
listener- the listener- Returns:
- this.
-
with
@Nonnull ExecutionPlanBuilder with(@Nonnull Set<PackageId> externalPackages)
Sets packages handled externally ahead of execution for prevalidation of plan- Parameters:
externalPackages- Set of package ids handled by other builder- Returns:
- this.
-
preview
@Nonnull Set<PackageId> preview() throws IOException, PackageException
Triggers Validation and returns PackageIds 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 occurrs.PackageException- if the plan is not valid.
-
execute
@Nonnull ExecutionPlan execute() throws IOException, PackageException
builds an executes the plan synchronously.- Returns:
- the execution plan.
- Throws:
IOException- if an I/O error occurrs.PackageException- if a package operation fails.
-
-