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 PackageTaskBuilder
addTask()
Adds a new task to this builder.ExecutionPlan
execute()
builds an executes the plan synchronously.ExecutionPlanBuilder
load(java.io.InputStream in)
Loads the tasks from a serialized plan and replaces the plans already in this builder.java.util.Set<PackageId>
preview()
Triggers Validation and returns PackageIds of all packages to be installed by this builderExecutionPlanBuilder
save(java.io.OutputStream out)
Serializes the tasks of this plan.ExecutionPlanBuilder
validate()
Validates this plan.ExecutionPlanBuilder
with(java.util.Set<PackageId> externalPackages)
Sets packages handled externally ahead of execution for prevalidation of planExecutionPlanBuilder
with(Session session)
Sets the JCR session for this execution plan.ExecutionPlanBuilder
with(ProgressTrackerListener listener)
Sets the progress tracker listener for this plan.
-
-
-
Method Detail
-
load
@Nonnull ExecutionPlanBuilder load(@Nonnull java.io.InputStream in) throws java.io.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:
java.io.IOException
- if an I/O error occurrs.
-
save
@Nonnull ExecutionPlanBuilder save(@Nonnull java.io.OutputStream out) throws java.io.IOException, PackageException
Serializes the tasks of this plan.- Parameters:
out
- the output stream- Returns:
- this
- Throws:
java.io.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 java.io.IOException, PackageException
Validates this plan.- Returns:
- this.
- Throws:
java.io.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 java.util.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 java.util.Set<PackageId> preview() throws java.io.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:
java.io.IOException
- if an I/O error occurrs.PackageException
- if the plan is not valid.
-
execute
@Nonnull ExecutionPlan execute() throws java.io.IOException, PackageException
builds an executes the plan synchronously.- Returns:
- the execution plan.
- Throws:
java.io.IOException
- if an I/O error occurrs.PackageException
- if a package operation fails.
-
-