private void executePlan(final DomainDeploymentManager manager, final DeploymentPlan plan) throws DeploymentExecutionException, ExecutionException, InterruptedException { if (plan.getDeploymentActions().size() > 0) { final DeploymentPlanResult planResult = manager.execute(plan).get(); final Map<UUID, DeploymentActionResult> actionResults = planResult.getDeploymentActionResults(); for (UUID uuid : actionResults.keySet()) { final Map<String, ServerGroupDeploymentActionResult> groupDeploymentActionResults = actionResults.get(uuid).getResultsByServerGroup(); for (String serverGroup2 : groupDeploymentActionResults.keySet()) { final Map<String, ServerUpdateResult> serverUpdateResults = groupDeploymentActionResults.get(serverGroup2).getResultByServer(); for (String server : serverUpdateResults.keySet()) { final Throwable t = serverUpdateResults.get(server).getFailureResult(); if (t != null) { throw new DeploymentExecutionException(t, "Error executing %s", type); } } } } } } }
private String executeDeploymentPlan(DeploymentPlan plan, DeploymentAction deployAction) throws Exception { Future<DeploymentPlanResult> future = deploymentManager.execute(plan); DeploymentPlanResult planResult = future.get(); Map<String, ServerGroupDeploymentPlanResult> actionResults = planResult.getServerGroupResults(); for (Entry<String, ServerGroupDeploymentPlanResult> result : actionResults.entrySet()) { for (Entry<String, ServerDeploymentPlanResult> planServerResult : result.getValue().getServerResults().entrySet()) { ServerUpdateResult actionResult = planServerResult.getValue().getDeploymentActionResults() .get(deployAction.getId()); if (actionResult != null) { Exception deploymentException = (Exception) actionResult.getFailureResult(); if (deploymentException != null) throw deploymentException; } } } return deployAction.getDeploymentUnitUniqueName(); } }
private String executeDeploymentPlan(DeploymentPlan plan, DeploymentAction deployAction) throws Exception { Future<DeploymentPlanResult> future = deploymentManagerDeprecated.execute(plan); DeploymentPlanResult planResult = future.get(); Map<String, ServerGroupDeploymentPlanResult> actionResults = planResult.getServerGroupResults(); for (Entry<String, ServerGroupDeploymentPlanResult> result : actionResults.entrySet()) { for (Entry<String, ServerDeploymentPlanResult> planServerResult : result.getValue().getServerResults().entrySet()) { ServerUpdateResult actionResult = planServerResult.getValue().getDeploymentActionResults() .get(deployAction.getId()); if (actionResult != null) { Exception deploymentException = (Exception) actionResult.getFailureResult(); if (deploymentException != null) throw deploymentException; } } } return deployAction.getDeploymentUnitUniqueName(); } }