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 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.
      • 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
                                  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.