Interface DeploymentManager


public interface DeploymentManager
Allows deployment operations to be executed on a running server. This will work with both standalone servers and managed domain servers.

The server result for each deployment operation will be the result of a composite operation.

If the server is a managed domain server groups are required. If the server is a standalone server no server groups are allowed to be define. A failed DeploymentResult will be returned if the server groups are empty for a managed domain or populated for a standalone server.

Author:
James R. Perkins
  • Method Details Link icon

    • deploy Link icon

      DeploymentResult deploy(Deployment deployment) throws IOException
      Deploys the content to the server.

      If the deployment is not enabled a deploy operation will need to be invoked. This can also be achieved by invoking the deployToRuntime(DeploymentDescription) method.

      Parameters:
      deployment - the deployment to deploy
      Returns:
      the result of the deployment
      Throws:
      IOException - if a failure occurs communicating with the server
      See Also:
    • deploy Link icon

      DeploymentResult deploy(Set<Deployment> deployments) throws IOException
      Deploys the content of each deployment to the server.

      If the deployment is not enabled a deploy operation will need to be invoked. This can also be achieved by invoking the deployToRuntime(Set) method.

      Also note that it is safe to trigger a deploy operation on already deployed deployments.

      Parameters:
      deployments - a set of deployments to deploy
      Returns:
      the result of the deployment
      Throws:
      IOException - if a failure occurs communicating with the server
      See Also:
    • forceDeploy Link icon

      DeploymentResult forceDeploy(Deployment deployment) throws IOException
      Deploys the content to the server if it does not already exist on the server. If the deployment already exist the deployment is replaced.

      If the deployment is not enabled a deploy operation will need to be invoked. This can also be achieved by invoking the deployToRuntime(DeploymentDescription) method.

      Parameters:
      deployment - the deployment to deploy
      Returns:
      the result of the deployment
      Throws:
      IOException - if a failure occurs communicating with the server
      See Also:
    • forceDeploy Link icon

      DeploymentResult forceDeploy(Set<Deployment> deployments) throws IOException
      Deploys the content to the server if it does not already exist on the server. If the deployment already exist the deployment is replaced.

      If the deployment is not enabled a deploy operation will need to be invoked. This can also be achieved by invoking the deployToRuntime(Set) method.

      Also note that it is safe to trigger a deploy operation on already deployed deployments.

      Parameters:
      deployments - a set of deployments to deploy
      Returns:
      the result of the deployment
      Throws:
      IOException - if a failure occurs communicating with the server
      See Also:
    • deployToRuntime Link icon

      DeploymentResult deployToRuntime(DeploymentDescription deployment) throws IOException
      Deploys existing deployment content to the runtime.
      Parameters:
      deployment - the deployment description to deploy
      Returns:
      the result of the deployment
      Throws:
      IOException - if a failure occurs communicating with the server
    • deployToRuntime Link icon

      DeploymentResult deployToRuntime(Set<DeploymentDescription> deployments) throws IOException
      Deploys existing deployment content to the runtime for each deployment description.
      Parameters:
      deployments - the deployment descriptions to deploy
      Returns:
      the result of the deployment
      Throws:
      IOException - if a failure occurs communicating with the server
    • redeploy Link icon

      DeploymentResult redeploy(Deployment deployment) throws IOException
      Redeploys the content to the server. Uses a full-replace-deployment operation to upload the new content, undeploy the old content, deploy the new content and then remove the old content.

      If the deployment is not enabled a deploy or redeploy operation will need to be invoked. This can also be achieved by invoking the deployToRuntime(DeploymentDescription) method or the redeployToRuntime(DeploymentDescription) method.

      Parameters:
      deployment - the deployment to redeploy
      Returns:
      the result of the deployment
      Throws:
      IOException - if a failure occurs communicating with the server
      See Also:
    • redeploy Link icon

      DeploymentResult redeploy(Set<Deployment> deployments) throws IOException
      Redeploys the content to the server. Uses a full-replace-deployment operation to upload the new content, undeploy the old content, deploy the new content and then remove the old content.

      If the deployment is not enabled a deploy or redeploy operation will need to be invoked. This can also be achieved by invoking the deployToRuntime(Set) method or the redeployToRuntime(Set) method.

      Also note that it is safe to trigger a deploy or operation on already deployed deployments.

      Parameters:
      deployments - a set of deployments to redeploy
      Returns:
      the result of the deployment
      Throws:
      IOException - if a failure occurs communicating with the server
      See Also:
    • redeployToRuntime Link icon

      DeploymentResult redeployToRuntime(DeploymentDescription deployment) throws IOException
      Redeploys existing deployment content to the runtime.
      Parameters:
      deployment - the deployment description to redeploy
      Returns:
      the result of the deployment
      Throws:
      IOException - if a failure occurs communicating with the server
    • redeployToRuntime Link icon

      DeploymentResult redeployToRuntime(Set<DeploymentDescription> deployments) throws IOException
      Redeploys existing deployment content to the runtime for each deployment description.
      Parameters:
      deployments - the deployment descriptions to redeploy
      Returns:
      the result of the deployment
      Throws:
      IOException - if a failure occurs communicating with the server
    • undeploy Link icon

      DeploymentResult undeploy(UndeployDescription undeployDescription) throws IOException
      Undeploys the deployment from the server.
      Parameters:
      undeployDescription - the description for undeploying the content
      Returns:
      the result of the deployment
      Throws:
      IOException - if a failure occurs communicating with the server
    • undeploy Link icon

      DeploymentResult undeploy(Set<UndeployDescription> undeployDescriptions) throws IOException
      Undeploys the deployment from the server.
      Parameters:
      undeployDescriptions - the descriptions for undeploying the content
      Returns:
      the result of the deployment
      Throws:
      IOException - if a failure occurs communicating with the server
    • getDeployments Link icon

      Set<DeploymentDescription> getDeployments() throws IOException
      Returns the available deployments.
      Returns:
      the deployments
      Throws:
      IOException - if a failure occurs communicating with the server
    • getDeployments Link icon

      Set<DeploymentDescription> getDeployments(String serverGroup) throws IOException
      Returns all the deployments on the specified server-group. These deployments may also belong to other server groups.
      Parameters:
      serverGroup - the server group to get the deployments for
      Returns:
      the deployments
      Throws:
      IOException - if a failure occurs communicating with the server
      IllegalStateException - if the running server is not a managed domain
    • getDeploymentNames Link icon

      Set<String> getDeploymentNames() throws IOException
      Returns the names of deployed content.
      Returns:
      the names of deployed content
      Throws:
      IOException - if a failure occurs communicating with the server
    • hasDeployment Link icon

      boolean hasDeployment(String name) throws IOException
      Checks if the deployment content is on the server.
      Parameters:
      name - the name of the deployment
      Returns:
      true if the deployment content exists otherwise false
      Throws:
      IOException - if a failure occurs communicating with the server
    • hasDeployment Link icon

      boolean hasDeployment(String name, String serverGroup) throws IOException
      Checks if the deployment content is on the server.
      Parameters:
      name - the name of the deployment
      serverGroup - the server group to check for the deployment on
      Returns:
      true if the deployment content exists otherwise false
      Throws:
      IOException
    • isEnabled Link icon

      boolean isEnabled(String name) throws IOException
      Checks if the deployment has been deployed to the runtime. The deployment must already exist on the server.

      If a deployment is enabled it has been deployed to the runtime. Otherwise the deployment has not been deployed to the runtime.

      Parameters:
      name - the name of the deployment
      Returns:
      true if the deployment content exists and is enabled otherwise false
      Throws:
      IOException - if a failure occurs communicating with the server
      See Also:
    • isEnabled Link icon

      boolean isEnabled(String name, String serverGroup) throws IOException
      Checks if the deployment has been deployed to the runtime. The deployment must already exist on the server.

      If a deployment is enabled it has been deployed to the runtime. Otherwise the deployment has not been deployed to the runtime.

      Parameters:
      name - the name of the deployment
      serverGroup - the server group to check for the deployment on
      Returns:
      true if the deployment content exists and is enabled otherwise false
      Throws:
      IOException
      See Also:
    • create Link icon

      static DeploymentManager create(org.jboss.as.controller.client.ModelControllerClient client)
      Creates a new deployment manager.

      The client will not be closed by the DeploymentManager. The user is responsible for closing the client.

      Parameters:
      client - the client used to communicate with the server
      Returns:
      a new deployment manager
      Since:
      1.2