AddDeploymentPlanBuilderImpl(DeploymentPlanBuilderImpl existing, DeploymentSetPlanImpl setPlan) { super(existing, setPlan); this.newContentKey = setPlan.getLastAction().getDeploymentUnitUniqueName(); }
@Override public UUID getDeploymentActionId() { return deploymentAction.getId(); }
UndeployDeploymentPlanBuilderImpl(DeploymentPlanBuilderImpl existing, DeploymentSetPlanImpl setPlan) { super(existing, setPlan); DeploymentAction modification = setPlan.getLastAction(); if (modification.getType() != DeploymentAction.Type.UNDEPLOY) { throw ControllerClientLogger.ROOT_LOGGER.invalidActionType(modification.getType()); } this.undeployModification = modification; }
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(); } }
@Override public DeploymentPlanBuilder andRemoveUndeployed() { DeploymentSetPlanImpl currentSet = getCurrentDeploymentSetPlan(); if (currentSet.hasServerGroupPlans()) { throw MESSAGES.cannotAddDeploymentAction(); } DeploymentActionImpl mod = DeploymentActionImpl.getRemoveAction(replacementModification.getReplacedDeploymentUnitUniqueName()); DeploymentSetPlanImpl newSet = currentSet.addAction(mod); return new DeploymentPlanBuilderImpl(this, newSet); } }
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(); } }
@Override public DeploymentPlanBuilder andRemoveUndeployed() { DeploymentSetPlanImpl currentSet = getCurrentDeploymentSetPlan(); if (currentSet.hasServerGroupPlans()) { throw ControllerClientLogger.ROOT_LOGGER.cannotAddDeploymentAction(); } DeploymentActionImpl mod = DeploymentActionImpl.getRemoveAction(replacementModification.getReplacedDeploymentUnitUniqueName()); DeploymentSetPlanImpl newSet = currentSet.addAction(mod); return new DeploymentPlanBuilderImpl(this, newSet); } }
@Override public UUID getDeploymentActionId() { return deploymentAction.getId(); }
AddDeploymentPlanBuilderImpl(DeploymentPlanBuilderImpl existing, DeploymentSetPlanImpl setPlan) { super(existing, setPlan); this.newContentKey = setPlan.getLastAction().getDeploymentUnitUniqueName(); }
UndeployDeploymentPlanBuilderImpl(DeploymentPlanBuilderImpl existing, DeploymentSetPlanImpl setPlan) { super(existing, setPlan); DeploymentAction modification = setPlan.getLastAction(); if (modification.getType() != DeploymentAction.Type.UNDEPLOY) { throw MESSAGES.invalidActionType(modification.getType()); } this.undeployModification = modification; }
private void createDefaultResults(final Map<UUID, DeploymentActionResult> actionResults, final BasicDomainUpdateResult domainUpdateResult, final UpdateResultHandlerResponse resultHandlerResponse) { for (DeploymentAction deploymentAction : plan.getDeploymentActions()) { // Create the deployment action result final DeploymentActionResultImpl deploymentActionResult = new DeploymentActionResultImpl(deploymentAction, domainUpdateResult); // Update the action result with updates for each server for (ServerIdentity serverId : servers) { final ServerUpdateResultImpl serverUpdateResult = new ServerUpdateResultImpl(deploymentAction.getId(), serverId, resultHandlerResponse); deploymentActionResult.storeServerUpdateResult(serverId, serverUpdateResult); } actionResults.put(deploymentAction.getId(), deploymentActionResult); } } }
@Override public RemoveDeploymentPlanBuilder andRemoveUndeployed() { DeploymentSetPlanImpl currentSet = getCurrentDeploymentSetPlan(); if (currentSet.hasServerGroupPlans()) { throw ControllerClientLogger.ROOT_LOGGER.cannotAddDeploymentActionsAfterStart(); } DeploymentActionImpl mod = DeploymentActionImpl.getRemoveAction(undeployModification.getDeploymentUnitUniqueName()); DeploymentSetPlanImpl newSet = currentSet.addAction(mod); return new RemoveDeploymentPlanBuilderImpl(this, newSet); } }
private void createDefaultResults(final Map<UUID, DeploymentActionResult> actionResults, final BasicDomainUpdateResult domainUpdateResult, final UpdateResultHandlerResponse resultHandlerResponse) { for (DeploymentAction deploymentAction : plan.getDeploymentActions()) { // Create the deployment action result final DeploymentActionResultImpl deploymentActionResult = new DeploymentActionResultImpl(deploymentAction, domainUpdateResult); // Update the action result with updates for each server for (ServerIdentity serverId : servers) { final ServerUpdateResultImpl serverUpdateResult = new ServerUpdateResultImpl(deploymentAction.getId(), serverId, resultHandlerResponse); deploymentActionResult.storeServerUpdateResult(serverId, serverUpdateResult); } actionResults.put(deploymentAction.getId(), deploymentActionResult); } } }
@Override public RemoveDeploymentPlanBuilder andRemoveUndeployed() { DeploymentSetPlanImpl currentSet = getCurrentDeploymentSetPlan(); if (currentSet.hasServerGroupPlans()) { throw MESSAGES.cannotAddDeploymentActionsAfterStart(); } DeploymentActionImpl mod = DeploymentActionImpl.getRemoveAction(undeployModification.getDeploymentUnitUniqueName()); DeploymentSetPlanImpl newSet = currentSet.addAction(mod); return new RemoveDeploymentPlanBuilderImpl(this, newSet); } }
for (DeploymentAction deploymentAction : plan.getDeploymentActions()) { final List<String> steps = actionsById.get(deploymentAction.getId()); for (String step : steps) { if (result.hasDefined(step)) { final ServerUpdateResultImpl serverUpdateResult = new ServerUpdateResultImpl(deploymentAction.getId(), serverId, resultHandlerResponse); deploymentActionResult.storeServerUpdateResult(serverId, serverUpdateResult); actionResults.put(deploymentAction.getId(), deploymentActionResult);
for (DeploymentAction deploymentAction : plan.getDeploymentActions()) { final List<String> steps = actionsById.get(deploymentAction.getId()); for (String step : steps) { if (result.hasDefined(step)) { final ServerUpdateResultImpl serverUpdateResult = new ServerUpdateResultImpl(deploymentAction.getId(), serverId, resultHandlerResponse); deploymentActionResult.storeServerUpdateResult(serverId, serverUpdateResult); actionResults.put(deploymentAction.getId(), deploymentActionResult);