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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull PackageTaskBuilder
addTask()
Adds a new task to this builder.@NotNull ExecutionPlan
execute()
Builds an executes the plan synchronously.@NotNull ExecutionPlanBuilder
load(@NotNull InputStream in)
Loads the tasks from a serialized plan and replaces the plans already in this builder.@NotNull Set<PackageId>
preview()
Triggers validation and returnsPackageId
s of all packages to be installed by this builder@NotNull ExecutionPlanBuilder
save(@NotNull OutputStream out)
Serializes the tasks of this plan.@NotNull ExecutionPlanBuilder
validate()
Validates this plan.@NotNull ExecutionPlanBuilder
with(@NotNull Set<PackageId> externalPackages)
Sets packages handled externally ahead of execution for prevalidation of plan@NotNull ExecutionPlanBuilder
with(@NotNull Session session)
Sets the JCR session for this execution plan.@NotNull ExecutionPlanBuilder
with(@NotNull ProgressTrackerListener listener)
Sets the progress tracker listener for this plan.
-
-
-
Method Detail
-
load
@NotNull @NotNull ExecutionPlanBuilder load(@NotNull @NotNull 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
@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
@NotNull @NotNull PackageTaskBuilder addTask()
Adds a new task to this builder.- Returns:
- an package task builder that helps to assemble the task.
-
validate
@NotNull @NotNull 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
@NotNull @NotNull ExecutionPlanBuilder with(@NotNull @NotNull Session session)
Sets the JCR session for this execution plan.- Parameters:
session
- the session- Returns:
- this
-
with
@NotNull @NotNull ExecutionPlanBuilder with(@NotNull @NotNull ProgressTrackerListener listener)
Sets the progress tracker listener for this plan.- Parameters:
listener
- the listener- Returns:
- this
-
with
@NotNull @NotNull ExecutionPlanBuilder with(@NotNull @NotNull 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
@NotNull @NotNull Set<PackageId> preview() throws IOException, PackageException
Triggers validation and returnsPackageId
s 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
@NotNull @NotNull ExecutionPlan execute() throws IOException, PackageException
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.
-
-