Interface DeploymentPlanBuilder

    • Method Detail

      • getLastAction

        DeploymentAction getLastAction()
        Gets the DeploymentAction most recently created as a result of builder operations.
        Returns:
        the last action or null if there have been no actions.
      • getDeploymentActions

        List<DeploymentAction> getDeploymentActions()
        Gets the list of DeploymentActions created as a recent of builder operations, in order of when they were created.
        Returns:
        the actions. Will not be null
      • isGlobalRollback

        boolean isGlobalRollback()
        Gets whether all deploy, undeploy, replace or remove operations associated with the deployment plan should be rolled back in case of a failure in any of them.
        Returns:
        true if all operations should be rolled back if any of them fail
      • isShutdown

        boolean isShutdown()
        Gets whether the builder will create a deployment plan organized around a shutdown of the server.
        Returns:
        true if the plan will be organized around a shutdown, false otherwise
      • isGracefulShutdown

        boolean isGracefulShutdown()
        Gets whether the builder will create a deployment plan organized around a graceful shutdown of the server, where potentially long-running in-process work is given time to complete before shutdown proceeds.
        Returns:
        true if the plan will be organized around a graceful shutdown, false otherwise
      • getGracefulShutdownTimeout

        long getGracefulShutdownTimeout()
        Gets the maximum period, in ms, the builder will configure the deployment plan to wait for potentially long-running in-process work ito complete before shutdown proceeds.
        Returns:
        the period in ms, or -1 if isGracefulShutdown() would return true
      • add

        AddDeploymentPlanBuilder add​(File file)
                              throws IOException
        Indicates the content of the specified file should be added to the content repository. The name of the deployment will be the value returned by file.getName().

        Note that this operation does not indicate the content should be deployed into the runtime. See AddDeploymentPlanBuilder.andDeploy().

        Parameters:
        file - file containing the new content
        Returns:
        a builder that can continue building the overall deployment plan
        Throws:
        IOException
      • add

        AddDeploymentPlanBuilder add​(URL url)
                              throws IOException
        Indicates the content at the specified URL should be added to the content repository. The name of the deployment will be the last segment of the value returned by url.getPath().

        Note that this operation does not indicate the content should be deployed into the runtime. See AddDeploymentPlanBuilder.andDeploy().

        Parameters:
        url - URL pointing to the new content
        Returns:
        a builder that can continue building the overall deployment plan
        Throws:
        IOException
      • add

        AddDeploymentPlanBuilder add​(String name,
                                     File file)
                              throws IOException
        Indicates the content of the specified file should be added to the content repository.

        Note that this operation does not indicate the content should be deployed into the runtime. See AddDeploymentPlanBuilder.andDeploy().

        Parameters:
        name - name that should be given to the new content to uniquely identify it within the server's management system. Must be different from the name given to an other deployment content presently available on the server
        file - file containing the new content
        Returns:
        a builder that can continue building the overall deployment plan
        Throws:
        IOException
      • add

        AddDeploymentPlanBuilder add​(String name,
                                     URL url)
                              throws IOException
        Indicates the content at the specified URL should be added to the content repository.

        Note that this operation does not indicate the content should be deployed into the runtime. See AddDeploymentPlanBuilder.andDeploy().

        Parameters:
        name - name that should be given to the new content to uniquely identify it within the server. Must be different from the name given to an other deployment content presently available on the server
        url - URL pointing to the new content
        Returns:
        a builder that can continue building the overall deployment plan
        Throws:
        IOException
      • add

        AddDeploymentPlanBuilder add​(String name,
                                     InputStream stream)
        Indicates the content readable from the specified InputStream should be added to the content repository.

        Note that this operation does not indicate the content should be deployed into the runtime. See AddDeploymentPlanBuilder.andDeploy().

        Parameters:
        name - name that should be given to the new content to uniquely identify it within the server's management system. Must be different from the name given to an other deployment content presently available on the server
        stream - InputStream from which the new content should be read This stream has to be closed by the caller.
        Returns:
        a builder that can continue building the overall deployment plan
      • add

        AddDeploymentPlanBuilder add​(String name,
                                     String commonName,
                                     InputStream stream)
                              throws IOException
        Indicates the content readable from the specified InputStream should be added to the content repository.

        Note that this operation does not indicate the content should be deployed into the runtime. See AddDeploymentPlanBuilder.andDeploy().

        Parameters:
        name - name that should be given to the new content to uniquely identify it within the server's management system. Must be different from the name given to an other deployment content presently available on the server
        commonName - name by which the deployment should be known within the runtime. This would be equivalent to the file name of a deployment file, and would form the basis for such things as default Java Enterprise Edition application and module names. This would typically be the same as name (in which case add(String, InputStream) would normally be used, but in some cases users may wish to have two deployments with the same common name may (e.g. two versions of "foo.war" both available in the deployment content repository), in which case the deployments would need to have distinct name values but would have the same commonName
        stream - InputStream from which the new content should be read This stream has to be closed by the caller.
        Returns:
        a builder that can continue building the overall deployment plan
        Throws:
        IOException
      • explodeDeployment

        DeploymentPlanBuilder explodeDeployment​(String deploymentName)
                                         throws IOException
        Indicates the deployment to be exploded.

        Note that this operation does not indicate the content should be undeployed into the runtime.

        Parameters:
        deploymentName - name by which the deployment is known in the model.
        Returns:
        a builder that can continue building the overall deployment plan
        Throws:
        IOException
      • explodeDeploymentContent

        DeploymentPlanBuilder explodeDeploymentContent​(String deploymentName,
                                                       String path)
                                                throws IOException
        Indicates the deployment content to be exploded.

        Note that this operation does not indicate the content should be undeployed into the runtime.

        Parameters:
        deploymentName - name by which the deployment is known in the model.
        path - the relative path to the archive to be exploded.
        Returns:
        a builder that can continue building the overall deployment plan
        Throws:
        IOException
      • addContentToDeployment

        DeploymentPlanBuilder addContentToDeployment​(String deploymentName,
                                                     Map<String,​InputStream> contents)
                                              throws IOException
        Indicates the content readable from the specified InputStream should be added to the content repository.

        Note that this operation does not indicate the content should be deployed into the runtime. See AddDeploymentPlanBuilder.andDeploy().

        Parameters:
        deploymentName - name by which the deployment is known in the model.
        contents - a map consisting of the content relative target path as key and the bytes as value.
        Returns:
        a builder that can continue building the overall deployment plan
        Throws:
        IOException
      • addContentFileToDeployment

        DeploymentPlanBuilder addContentFileToDeployment​(String deploymentName,
                                                         Map<String,​Path> files)
                                                  throws IOException
        Indicates the content readable from the specified Path should be added to the content repository.

        Note that this operation does not indicate the content should be deployed into the runtime. See AddDeploymentPlanBuilder.andDeploy().

        Parameters:
        deploymentName - name by which the deployment is known in the model.
        files - a map consisting of the content relative target path as key and the file as value.
        Returns:
        a builder that can continue building the overall deployment plan
        Throws:
        IOException
      • removeContenFromDeployment

        DeploymentPlanBuilder removeContenFromDeployment​(String deploymentName,
                                                         List<String> paths)
                                                  throws IOException
        Indicates the content readable from the specified targetPath should be removed from the deployment with the specified name.

        Note that this operation does not indicate the content should be undeployed into the runtime.

        Parameters:
        deploymentName - name by which the deployment is known in the model.
        paths - paths to the exploded deployment from which the content will be removed.
        Returns:
        a builder that can continue building the overall deployment plan
        Throws:
        IOException
      • deploy

        DeploymentPlanBuilder deploy​(String deploymentName)
        Indicates the specified deployment content should be deployed.
        Parameters:
        deploymentName - unique identifier of the deployment content
        Returns:
        a builder that can continue building the overall deployment plan
      • undeploy

        UndeployDeploymentPlanBuilder undeploy​(String deploymentName)
        Indicates the specified deployment content should be undeployed.
        Parameters:
        deploymentName - unique identifier of the deployment content
        Returns:
        a builder that can continue building the overall deployment plan
      • redeploy

        DeploymentPlanBuilder redeploy​(String deploymentName)
        Indicates the specified deployment content should be redeployed (i.e. undeployed and then deployed again).
        Parameters:
        deploymentName - unique identifier of the deployment content
        Returns:
        a builder that can continue building the overall deployment plan
      • replace

        ReplaceDeploymentPlanBuilder replace​(String replacementDeploymentName,
                                             String toReplaceDeploymentName)
        Indicates the specified deployment content should be deployed, replacing the specified existing deployment.
        Parameters:
        replacementDeploymentName - unique identifier of the content to deploy
        toReplaceDeploymentName - unique identifier of the currently deployed content to replace
        Returns:
        a builder that can continue building the overall deployment plan
      • replace

        DeploymentPlanBuilder replace​(File file)
                               throws IOException
        Indicates the content of the specified file should be added to the content repository and replace existing content of the same name. The name of the deployment will be the value returned by file.getName().

        Whether this operation will result in the new content being deployed into the runtime depends on whether the existing content being replaced is deployed. If the content being replaced is deployed the old content will be undeployed and the new content will be deployed.

        Parameters:
        file - file containing the new content
        Returns:
        a builder that can continue building the overall deployment plan
        Throws:
        IOException
      • replace

        DeploymentPlanBuilder replace​(URL url)
                               throws IOException
        Indicates the content at the specified URL should be added to the content repository and replace existing content of the same name. The name of the deployment will be the last segment of the value returned by url.getPath().

        Whether this operation will result in the new content being deployed into the runtime depends on whether the existing content being replaced is deployed. If the content being replaced is deployed the old content will be undeployed and the new content will be deployed.

        Parameters:
        url - URL pointing to the new content
        Returns:
        a builder that can continue building the overall deployment plan
        Throws:
        IOException
      • replace

        DeploymentPlanBuilder replace​(String name,
                                      File file)
                               throws IOException
        Indicates the content of the specified file should be added to the content repository and replace existing content of the same name.

        Whether this operation will result in the new content being deployed into the runtime depends on whether the existing content being replaced is deployed. If the content being replaced is deployed the old content will be undeployed and the new content will be deployed.

        Parameters:
        name - name that should be given to the new content
        file - file containing the new content
        Returns:
        a builder that can continue building the overall deployment plan
        Throws:
        IOException
      • replace

        DeploymentPlanBuilder replace​(String name,
                                      URL url)
                               throws IOException
        Indicates the content at the specified URL should be added to the content repository and replace existing content of the same name.

        Whether this operation will result in the new content being deployed into the runtime depends on whether the existing content being replaced is deployed. If the content being replaced is deployed the old content will be undeployed and the new content will be deployed.

        Parameters:
        name - name that should be given to the new content
        url - URL pointing to the new content
        Returns:
        a builder that can continue building the overall deployment plan
        Throws:
        IOException
      • replace

        DeploymentPlanBuilder replace​(String name,
                                      InputStream stream)
        Indicates the content readable from the specified InputStream should be added to the content repository and replace existing content of the same name.

        Whether this operation will result in the new content being deployed into the runtime depends on whether the existing content being replaced is deployed. If the content being replaced is deployed the old content will be undeployed and the new content will be deployed.

        Parameters:
        name - name that should be given to the new content
        stream - InputStream from which the new content should be read This stream has to be closed by the caller.
        Returns:
        a builder that can continue building the overall deployment plan
      • replace

        DeploymentPlanBuilder replace​(String name,
                                      String commonName,
                                      InputStream stream)
        Indicates the content readable from the specified InputStream should be added to the content repository and replace existing content of the same name.

        Whether this operation will result in the new content being deployed into the runtime depends on whether the existing content being replaced is deployed. If the content being replaced is deployed the old content will be undeployed and the new content will be deployed.

        Parameters:
        name - name that should be given to the new content
        commonName - name by which the deployment should be known within the runtime. This would be equivalent to the file name of a deployment file, and would form the basis for such things as default Java Enterprise Edition application and module names. This would typically be the same as name (in which case add(String, InputStream) would normally be used, but in some cases users may wish to have two deployments with the same common name may (e.g. two versions of "foo.war" both available in the deployment content repository), in which case the deployments would need to have distinct name values but would have the same commonName
        stream - InputStream from which the new content should be read. This stream has to be closed by the caller.
        Returns:
        a builder that can continue building the overall deployment plan
      • remove

        DeploymentPlanBuilder remove​(String deploymentName)
        Indicates the specified deployment content should be removed from the content repository.
        Parameters:
        deploymentName - unique identifier of the deployment content
        Returns:
        a builder that can continue building the overall deployment plan
      • build

        DeploymentPlan build()
        Creates the deployment plan.
        Returns:
        the deployment plan