if (plan != null) {
if (plan.getDeploymentActions().size() > 0) {
final ServerDeploymentPlanResult planResult = manager.execute(plan).get();
// Check the results
for (DeploymentAction action : plan.getDeploymentActions()) {
final ServerDeploymentActionResult actionResult = planResult.getDeploymentActionResult(action.getId());
final ServerUpdateActionResult.Result result = actionResult.getResult();
switch (result) {
case FAILED:
throw new DeploymentExecutionException("Deployment failed.", actionResult.getDeploymentException());
case NOT_EXECUTED:
throw new DeploymentExecutionException("Deployment not executed.", actionResult.getDeploymentException());
case ROLLED_BACK:
throw new DeploymentExecutionException("Deployment failed and was rolled back.", actionResult.getDeploymentException());
case CONFIGURATION_MODIFIED_REQUIRES_RESTART:
resultStatus = Status.REQUIRES_RESTART;
break;
}
}