Interface DeploymentPlanningContext


  • public interface DeploymentPlanningContext
    Context that is passed along during the Planning stage of a Deployment. This can be used to add DeploymentStep to the current plan, or store and retrieve attributes to transfer knowledge between multiple Contributors/Processors.
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      void addCheckpoint​(Step step, Checkpoint checkpoint)
      Add a checkpoint so that the state after this step has been executed can be committed.
      void addCheckpoint​(Step step, Delta delta)
      Add a checkpoint so that the state after this step has been executed can be committed.
      void addCheckpoint​(Step step, Delta delta, Operation overrideOperation)
      Add a checkpoint so that the state after this step has been executed can be committed.
      void addCheckpoint​(Step step, java.lang.Iterable<Delta> deltas)
      Add a checkpoint so that the state after this step has been executed can be committed.
      void addStep​(DeploymentStep step)
      Deprecated.
      Use Step instead of DeploymentStep
      void addStep​(Step step)
      Add a step to the current plan.
      void addSteps​(DeploymentStep... steps)
      Deprecated.
      Use Step instead of DeploymentStep
      void addSteps​(Step... steps)
      Add multiple steps to the current plan.
      void addSteps​(java.lang.Iterable<Step> steps)
      Add multiple steps to the current plan.
      void addSteps​(java.util.Collection<DeploymentStep> steps)
      Deprecated.
      Use Step instead of DeploymentStep
      void addStepWithCheckpoint​(Step step, Checkpoint checkpoint)
      Add a step and register a checkpoint so that the state after this step has been executed can be committed.
      void addStepWithCheckpoint​(Step step, Delta delta)
      Add a step and register a checkpoint so that the state after this step has been executed can be committed.
      void addStepWithCheckpoint​(Step step, Delta delta, Operation overrideOperation)
      Add a step and register a checkpoint so that the state after this step has been executed can be committed.
      void addStepWithCheckpoint​(Step step, java.lang.Iterable<Delta> deltas)
      Add a step and register a checkpoint so that the state after this step has been executed can be committed.
      com.xebialabs.deployit.plugin.api.services.ArtifactTransformer getArtifactTransformer​(java.lang.String transformerName)
      Returns the artifact transformer for given name.
      java.lang.Object getAttribute​(java.lang.String name)
      Returns the planning context attribute with the given name, or null if there is no attribute by that name.
      DeployedApplication getDeployedApplication()
      Returns the DeployedApplication for which the plan is being created.
      DeployedApplication getPreviousDeployedApplication()
      Returns the DeploymentApplication of the previous deployment.
      Repository getRepository()
      Returns the repository where all the ConfigurationItems known in XL Deploy are stored.
      boolean isRollback()
      Whether the planning occurs as the result of a rollback of a previous deployment.
      java.io.InputStream patch​(java.io.InputStream content, ConfigurationItem ci)
      Applies patches to the content provided.
      java.lang.String patch​(java.lang.String content, ConfigurationItem ci)
      Applies patches to the content provided.
      void setAttribute​(java.lang.String name, java.lang.Object value)
      Stores an attribute in the planning context.
    • Method Detail

      • addStep

        @Deprecated
        void addStep​(DeploymentStep step)
        Deprecated.
        Use Step instead of DeploymentStep
        Add a step to the current plan.
        Parameters:
        step - the step to add.
      • addSteps

        @Deprecated
        void addSteps​(DeploymentStep... steps)
        Deprecated.
        Use Step instead of DeploymentStep
        Add multiple steps to the current plan.
        Parameters:
        steps - the steps to add.
      • addSteps

        @Deprecated
        void addSteps​(java.util.Collection<DeploymentStep> steps)
        Deprecated.
        Use Step instead of DeploymentStep
        Add multiple steps to the current plan.
        Parameters:
        steps - the steps to add.
      • addStep

        void addStep​(Step step)
        Add a step to the current plan.
        Parameters:
        step - the step to add.
      • addSteps

        void addSteps​(Step... steps)
        Add multiple steps to the current plan.
        Parameters:
        steps - the steps to add.
      • addSteps

        void addSteps​(java.lang.Iterable<Step> steps)
        Add multiple steps to the current plan.
        Parameters:
        steps - the steps to add.
      • addCheckpoint

        void addCheckpoint​(Step step,
                           Checkpoint checkpoint)
        Add a checkpoint so that the state after this step has been executed can be committed.

        N.B. This does not add the step to the planning context, use addStep(com.xebialabs.deployit.plugin.api.flow.Step).

        Parameters:
        step - The Step that needs to complete before we checkpoint
        checkpoint - The checkpoint to add.
      • addCheckpoint

        void addCheckpoint​(Step step,
                           Delta delta)
        Add a checkpoint so that the state after this step has been executed can be committed.

        N.B. This does not add the step to the planning context, use addStep(com.xebialabs.deployit.plugin.api.flow.Step).

        Parameters:
        step - The Step that needs to complete before we checkpoint
        delta - The Delta that needs to be checkpointed.
      • addCheckpoint

        void addCheckpoint​(Step step,
                           Delta delta,
                           Operation overrideOperation)
        Add a checkpoint so that the state after this step has been executed can be committed.

        N.B. This does not add the step to the planning context, use addStep(com.xebialabs.deployit.plugin.api.flow.Step).

        Parameters:
        step - The Step that needs to complete before we checkpoint
        delta - The Delta that needs to be checkpointed.
        overrideOperation - The operation that is actually performed on the Delta, useful in case of split implementations of Update Delta's (ie. DESTROY -> CREATE).
      • addCheckpoint

        void addCheckpoint​(Step step,
                           java.lang.Iterable<Delta> deltas)
        Add a checkpoint so that the state after this step has been executed can be committed.

        N.B. This does not add the step to the planning context, use addStep(com.xebialabs.deployit.plugin.api.flow.Step).

        Parameters:
        step - The Step that needs to complete before we checkpoint
        deltas - The Deltas that need to be checkpointed.
      • addStepWithCheckpoint

        void addStepWithCheckpoint​(Step step,
                                   Checkpoint checkpoint)
        Add a step and register a checkpoint so that the state after this step has been executed can be committed.

        Parameters:
        step - The Step that needs to complete before we checkpoint
        checkpoint - The checkpoint that needs to be committed
      • addStepWithCheckpoint

        void addStepWithCheckpoint​(Step step,
                                   Delta delta)
        Add a step and register a checkpoint so that the state after this step has been executed can be committed.

        Parameters:
        step - The Step that needs to complete before we checkpoint
        delta - The Delta that needs to be checkpointed.
      • addStepWithCheckpoint

        void addStepWithCheckpoint​(Step step,
                                   Delta delta,
                                   Operation overrideOperation)
        Add a step and register a checkpoint so that the state after this step has been executed can be committed.

        Parameters:
        step - The Step that needs to complete before we checkpoint
        delta - The Delta that needs to be checkpointed.
        overrideOperation - The operation that is actually performed on the Delta, useful in case of split implementations of Update Delta's (ie. DESTROY -> CREATE).
      • addStepWithCheckpoint

        void addStepWithCheckpoint​(Step step,
                                   java.lang.Iterable<Delta> deltas)
        Add a step and register a checkpoint so that the state after this step has been executed can be committed.

        Parameters:
        step - The Step that needs to complete before we checkpoint
        deltas - The Deltas that need to be checkpointed.
      • getAttribute

        java.lang.Object getAttribute​(java.lang.String name)
        Returns the planning context attribute with the given name, or null if there is no attribute by that name.
        Parameters:
        name - the name of the attribute
        Returns:
        the value of the attribute, or null if there is no attribute by that name.
      • setAttribute

        void setAttribute​(java.lang.String name,
                          java.lang.Object value)
        Stores an attribute in the planning context. This attribute will be available while the deployment plan is being created.
        Parameters:
        name - the name of the attribute
        value - the value of the attribute
      • getDeployedApplication

        DeployedApplication getDeployedApplication()
        Returns the DeployedApplication for which the plan is being created.
        Returns:
        the DeployedApplication for which the plan is being created.
      • getPreviousDeployedApplication

        DeployedApplication getPreviousDeployedApplication()
        Returns the DeploymentApplication of the previous deployment.
        Returns:
        Previous DeployedApplication. In case of new deployments returns null
      • getRepository

        Repository getRepository()
        Returns the repository where all the ConfigurationItems known in XL Deploy are stored. Note: This repository cannot be stored in a step and should only be used during planning. During execution you have access to the repository through the ExecutionContext.
        Returns:
        the repository
      • patch

        java.io.InputStream patch​(java.io.InputStream content,
                                  ConfigurationItem ci)
        Applies patches to the content provided.
        Parameters:
        content - the content that needs to be patched
        ci - the ci related to the content
        Returns:
        the patched string
      • patch

        java.lang.String patch​(java.lang.String content,
                               ConfigurationItem ci)
        Applies patches to the content provided.
        Parameters:
        content - the content that needs to be patched
        ci - the ci related to the content
        Returns:
        the patched string
      • getArtifactTransformer

        com.xebialabs.deployit.plugin.api.services.ArtifactTransformer getArtifactTransformer​(java.lang.String transformerName)
        Returns the artifact transformer for given name. If the transformer with given name is not registered an runtime exception will be thrown.
        Parameters:
        transformerName - the transformer name registered in system
        Returns:
        the corresponding artifact transformer
      • isRollback

        boolean isRollback()
        Whether the planning occurs as the result of a rollback of a previous deployment.
        Returns:
        true if this is a planning operation for a rollback deployment