private DeploymentActionsCompleteBuilder undeployAndRemoveUndeployed( final DeploymentPlanBuilder builder, final List<String> deploymentNames) { DeploymentActionsCompleteBuilder completeBuilder = null; for (String deploymentName : deploymentNames) { DeploymentPlanBuilder actualBuilder = (completeBuilder == null ? builder : completeBuilder); completeBuilder = actualBuilder.undeploy(deploymentName).andRemoveUndeployed(); if (matchPatternStrategy == MatchPatternStrategy.FIRST) { break; } } return completeBuilder; }
private DeploymentPlanBuilder deployContent(DeploymentPlanBuilder builder, Set<String> addedContent, Set<String> deployedContent, Set<String> undeployedContent, Set<String> removedContent, ModelNode domainModel) throws IOException { String deployment = chooseUndeployedContent("Choose the content to deploy:", addedContent, deployedContent, undeployedContent, removedContent, domainModel); if (deployment != null) { deployedContent.add(deployment); undeployedContent.remove(deployment); return builder.deploy(deployment); } return builder; }
private DeploymentPlanBuilder removeContent(DeploymentPlanBuilder builder, Set<String> addedContent, Set<String> deployedContent, Set<String> undeployedContent, Set<String> removedContent, ModelNode domainModel) throws IOException { String deployment = chooseUndeployedContent("Choose the content to remove:", addedContent, deployedContent, undeployedContent, removedContent, domainModel); if (deployment != null) { removedContent.add(deployment); addedContent.remove(deployment); return builder.remove(deployment); } return builder; }
builder = builder.add(contentName, content); break; builder = builder.add(contentName, content).andDeploy(); deployedContent.add(contentName); break; builder = builder.replace(contentName, content); ModelNode existing = model.get("deployment", contentName); if (deployedContent.contains(contentName) || (existing.isDefined() && existing.get("enabled").asBoolean(true) && !undeployedContent.contains(contentName))) {
private DeploymentPlanBuilder replaceContent(DeploymentPlanBuilder builder, Set<String> addedContent, Set<String> deployedContent, Set<String> undeployedContent, Set<String> removedContent, ModelNode domainModel) throws IOException { String toDeploy = chooseUndeployedContent("Choose the replacement deployment:", removedContent, removedContent, removedContent, removedContent, domainModel); if (toDeploy != null) { String toReplace = chooseDeployedContent("Choose the deployment to be replaced:", deployedContent, undeployedContent, domainModel); if (toReplace != null) { return builder.replace(toDeploy, toReplace); } } return builder; }
switch (type) { case ADD: { completeBuilder = builder.add(name, content); break; completeBuilder = builder.replace(name, content); } else { completeBuilder = builder.add(name, content); completeBuilder = builder.add(name, content).andDeploy(); break; completeBuilder = builder.replace(name, content).deploy(name); } else { completeBuilder = builder.add(name, content).andDeploy(); completeBuilder = builder.replace(name, content); break;
private DeploymentPlanBuilder undeployContent(DeploymentPlanBuilder builder, Set<String> addedContent, Set<String> deployedContent, Set<String> undeployedContent, Set<String> removedContent, ModelNode domainModel, DeploymentActionsMenu cmd) throws IOException { String toUndeploy = chooseDeployedContent("Choose the deployment to undeploy:", deployedContent, undeployedContent, domainModel); if (toUndeploy != null) { UndeployDeploymentPlanBuilder udpb = builder.undeploy(toUndeploy); builder = udpb; if (cmd == DeploymentActionsMenu.UNDEPLOY_AND_REMOVE) { builder = udpb.andRemoveUndeployed(); removedContent.add(toUndeploy); addedContent.remove(toUndeploy); } undeployedContent.add(toUndeploy); deployedContent.remove(toUndeploy); } return builder; }
public void undeploy(String runtimeName, String target) throws DeploymentException { try { DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan(); DeploymentPlan plan = builder.undeploy(runtimeName).remove(runtimeName).toServerGroup(target).build(); Future<DeploymentPlanResult> future = deploymentManager.execute(plan); future.get(); } catch (Exception ex) { log.warn("Cannot undeploy: " + runtimeName + ":" + ex.getMessage()); } }
UndeployDeploymentPlanBuilder undeployBuilder = builder.undeploy(runtimeName); ServerGroupDeploymentPlanBuilder serverGroupBuilder = null; for (String target : serverGroups) {