com.xebialabs.deployit.engine.api
Interface DeploymentService


public interface DeploymentService

Deployment management


Method Summary
 java.lang.String createTask(Deployment deployment)
          Creates the deployment task.
 Deployment generateAllDeployeds(Deployment deployment)
          Generates all deployeds for the given deployment.
 Deployment generateSelectedDeployeds(java.util.List<java.lang.String> deployableIds, Deployment deployment)
          Generates only the deployeds for the given deployables in the deployment.
 Deployment generateSingleDeployed(java.lang.String deployableId, java.lang.String containerId, com.xebialabs.deployit.plugin.api.reflect.Type deployedType, Deployment deployment)
          Generates a deployed for the given deployable to the given container in the deployment.
 Deployment prepareInitial(java.lang.String versionId, java.lang.String environmentId)
          Prepares an initial deployment.
 Deployment prepareUndeploy(java.lang.String deployedApplicationId)
          Prepares an undeployment.
 Deployment prepareUpdate(java.lang.String versionId, java.lang.String deployedApplicationId)
          Prepares an update deployment.
 java.lang.String rollback(java.lang.String taskId)
          Rollback a STOPPED or EXECUTED task.
 Deployment validate(Deployment deployment)
          Validates the generated deployment.
 

Method Detail

prepareInitial

Deployment prepareInitial(java.lang.String versionId,
                          java.lang.String environmentId)
Prepares an initial deployment.

Parameters:
versionId - The ID of the udm.Version that is the source of the deployment.
environmentId - The ID of the udm.Environment that is the target of the deployment.
Returns:
A new Deployment object to which you can add deployeds.

prepareUpdate

Deployment prepareUpdate(java.lang.String versionId,
                         java.lang.String deployedApplicationId)
Prepares an update deployment.

Parameters:
versionId - The ID of the new udm.Version that is the source of the deployment.
deployedApplicationId - The ID of the udm.DeployedApplication that is to be updated.
Returns:
A new Deployment object which contains the updated deployeds.

prepareUndeploy

Deployment prepareUndeploy(java.lang.String deployedApplicationId)
Prepares an undeployment.

Parameters:
deployedApplicationId - The ID of the udm.DeployedApplication that is to be undeployed.
Returns:
A new Deployment object which contains no deployeds (ie. all deployeds of the previous deployment will be deleted).

generateAllDeployeds

Deployment generateAllDeployeds(Deployment deployment)
Generates all deployeds for the given deployment.

Parameters:
deployment - The prepared Deployment parameter object.
Returns:
An updated Deployment parameter object.

generateSelectedDeployeds

Deployment generateSelectedDeployeds(java.util.List<java.lang.String> deployableIds,
                                     Deployment deployment)
Generates only the deployeds for the given deployables in the deployment.

Try to generate deployeds from each of the deployables to all the matching Containers in the Environment of the Deployment parameter object.

Parameters:
deployableIds - The list of IDs of deployables to generate the deployeds for.
deployment - The prepared Deployment parameter object
Returns:
An updated Deployment parameter object.

generateSingleDeployed

Deployment generateSingleDeployed(java.lang.String deployableId,
                                  java.lang.String containerId,
                                  com.xebialabs.deployit.plugin.api.reflect.Type deployedType,
                                  Deployment deployment)
Generates a deployed for the given deployable to the given container in the deployment.

The deployed should be of the given type (which is optional)

Parameters:
deployableId - The ID of the deployable to generate a deployed for
containerId - The ID of the container to generate a deployed to
deployedType - (Optional) The type of the deployed to generate
deployment - The prepared Deployment parameter object
Returns:
An updated Deployment parameter object.

validate

Deployment validate(Deployment deployment)
Validates the generated deployment. Checks whether all the deployeds that are in the deployment are valid.

Parameters:
deployment - The deployment to validate.
Returns:
The validated deployment.

createTask

java.lang.String createTask(Deployment deployment)
Creates the deployment task.

Parameters:
deployment - The fully prepared Deployment parameter object.
Returns:
a reference to a Task ID that can be executed by the TaskService.

rollback

java.lang.String rollback(java.lang.String taskId)
Rollback a STOPPED or EXECUTED task. Reverting the deployment to the previous state. The task will be set to CANCELLED when it was STOPPED, and DONE when it was EXECUTED.

Parameters:
taskId - the ID of the task
Returns:
the ID of the new task.