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;
}
}
}
}
} catch (DeploymentExecutionException e) {
throw e;
} catch (Exception e) {
throw new DeploymentExecutionException(e, "Error executing %s", type);
}
return resultStatus;
}