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 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; }