Class ExecutionPlanBuilderImpl
- java.lang.Object
-
- org.apache.jackrabbit.vault.packaging.registry.impl.ExecutionPlanBuilderImpl
-
- All Implemented Interfaces:
ExecutionPlanBuilder
public class ExecutionPlanBuilderImpl extends Object implements ExecutionPlanBuilder
ExecutionPlanBuilderImpl
...
-
-
Field Summary
Fields Modifier and Type Field Description static double
SUPPORTED_VERSION
protected double
version
-
Method Summary
All Methods Instance Methods Concrete 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.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 Session session)
Sets the JCR session for this execution plan.@NotNull ExecutionPlanBuilder
with(@NotNull ProgressTrackerListener listener)
Sets the progress tracker listener for this plan.ExecutionPlanBuilder
with(Set<PackageId> externalPackages)
Sets packages handled externally ahead of execution for prevalidation of plan
-
-
-
Field Detail
-
SUPPORTED_VERSION
public static final double SUPPORTED_VERSION
- See Also:
- Constant Field Values
-
version
protected double version
-
-
Method Detail
-
save
@NotNull public @NotNull ExecutionPlanBuilder save(@NotNull @NotNull OutputStream out) throws IOException, PackageException
Description copied from interface:ExecutionPlanBuilder
Serializes the tasks of this plan.- Specified by:
save
in interfaceExecutionPlanBuilder
- Parameters:
out
- the output stream- Returns:
- this
- Throws:
IOException
- if an I/O error occurrs.PackageException
- if this builder does not have valid tasks.
-
load
@NotNull public @NotNull ExecutionPlanBuilder load(@NotNull @NotNull InputStream in) throws IOException
Description copied from interface:ExecutionPlanBuilder
Loads the tasks from a serialized plan and replaces the plans already in this builder.- Specified by:
load
in interfaceExecutionPlanBuilder
- Parameters:
in
- input stream to the data.- Returns:
- this
- Throws:
IOException
- if an I/O error occurrs.
-
addTask
@NotNull public @NotNull PackageTaskBuilder addTask()
Description copied from interface:ExecutionPlanBuilder
Adds a new task to this builder.- Specified by:
addTask
in interfaceExecutionPlanBuilder
- Returns:
- an package task builder that helps to assemble the task.
-
with
@NotNull public @NotNull ExecutionPlanBuilder with(@NotNull @NotNull Session session)
Description copied from interface:ExecutionPlanBuilder
Sets the JCR session for this execution plan.- Specified by:
with
in interfaceExecutionPlanBuilder
- Parameters:
session
- the session- Returns:
- this
-
with
@NotNull public @NotNull ExecutionPlanBuilder with(@NotNull @NotNull ProgressTrackerListener listener)
Description copied from interface:ExecutionPlanBuilder
Sets the progress tracker listener for this plan.- Specified by:
with
in interfaceExecutionPlanBuilder
- Parameters:
listener
- the listener- Returns:
- this
-
validate
@NotNull public @NotNull ExecutionPlanBuilder validate() throws IOException, PackageException
Description copied from interface:ExecutionPlanBuilder
Validates this plan.- Specified by:
validate
in interfaceExecutionPlanBuilder
- Returns:
- this
- Throws:
IOException
- if an I/O error occurrs.PackageException
- if the plan is not valid.
-
execute
@NotNull public @NotNull ExecutionPlan execute() throws IOException, PackageException
Description copied from interface:ExecutionPlanBuilder
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.- Specified by:
execute
in interfaceExecutionPlanBuilder
- Returns:
- the execution plan.
- Throws:
IOException
- if an I/O error occurs.PackageException
- if the plan contains an unsupported task.
-
with
public ExecutionPlanBuilder with(Set<PackageId> externalPackages)
Description copied from interface:ExecutionPlanBuilder
Sets packages handled externally ahead of execution for prevalidation of plan- Specified by:
with
in interfaceExecutionPlanBuilder
- Parameters:
externalPackages
- Set of package ids handled by other builder- Returns:
- this
-
preview
public Set<PackageId> preview() throws IOException, PackageException
Description copied from interface:ExecutionPlanBuilder
Triggers validation and returnsPackageId
s of all packages to be installed by this builder- Specified by:
preview
in interfaceExecutionPlanBuilder
- 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.
-
-