DeploymentPlanBuilderImpl getNewBuilder(DeploymentActionImpl mod) { DeploymentSetPlanImpl currentSet = getCurrentDeploymentSetPlan(); if (currentSet.hasServerGroupPlans()) { throw MESSAGES.cannotAddDeploymentAction(); } DeploymentSetPlanImpl newSet = currentSet.addAction(mod); return new DeploymentPlanBuilderImpl(this, newSet); }
@Override public ReplaceDeploymentPlanBuilder replace(String replacement, String toReplace) { DeploymentSetPlanImpl currentSet = getCurrentDeploymentSetPlan(); if (currentSet.hasServerGroupPlans()) { throw MESSAGES.cannotAddDeploymentAction(); } DeploymentActionImpl mod = DeploymentActionImpl.getReplaceAction(replacement, toReplace); DeploymentSetPlanImpl newSet = currentSet.addAction(mod); return new ReplaceDeploymentPlanBuilderImpl(this, newSet); }
@Override public DeployDeploymentPlanBuilder andDeploy() { DeploymentSetPlanImpl currentSet = getCurrentDeploymentSetPlan(); if (currentSet.hasServerGroupPlans()) { throw MESSAGES.cannotAddDeploymentAction(); } DeploymentActionImpl mod = DeploymentActionImpl.getDeployAction(newContentKey); DeploymentSetPlanImpl newSet = currentSet.addAction(mod); return new DeployDeploymentPlanBuilderImpl(this, newSet); }
@Override public UndeployDeploymentPlanBuilder undeploy(String key) { DeploymentSetPlanImpl currentSet = getCurrentDeploymentSetPlan(); if (currentSet.hasServerGroupPlans()) { throw MESSAGES.cannotAddDeploymentAction(); } DeploymentActionImpl mod = DeploymentActionImpl.getUndeployAction(key); DeploymentSetPlanImpl newSet = currentSet.addAction(mod); return new UndeployDeploymentPlanBuilderImpl(this, newSet); }
@Override public RemoveDeploymentPlanBuilder remove(String key) { DeploymentSetPlanImpl currentSet = getCurrentDeploymentSetPlan(); if (currentSet.hasServerGroupPlans()) { throw MESSAGES.cannotAddDeploymentAction(); } DeploymentActionImpl mod = DeploymentActionImpl.getRemoveAction(key); DeploymentSetPlanImpl newSet = currentSet.addAction(mod); return new RemoveDeploymentPlanBuilderImpl(this, newSet); }
@Override public AddDeploymentPlanBuilder add(String name) throws IOException { DeploymentSetPlanImpl currentSet = getCurrentDeploymentSetPlan(); if (currentSet.hasServerGroupPlans()) { throw MESSAGES.cannotAddDeploymentAction(); } DeploymentActionImpl mod = DeploymentActionImpl.getAddAction(name, null, null); DeploymentSetPlanImpl newSet = currentSet.addAction(mod); return new AddDeploymentPlanBuilderImpl(this, newSet); }
@Override public DeployDeploymentPlanBuilder deploy(String key) { DeploymentSetPlanImpl currentSet = getCurrentDeploymentSetPlan(); if (currentSet.hasServerGroupPlans()) { throw MESSAGES.cannotAddDeploymentAction(); } DeploymentActionImpl mod = DeploymentActionImpl.getDeployAction(key); DeploymentSetPlanImpl newSet = currentSet.addAction(mod); return new DeployDeploymentPlanBuilderImpl(this, newSet); }
@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); } }
@Override public AddDeploymentPlanBuilder add(String name, String commonName, InputStream stream) throws IOException, DuplicateDeploymentNameException { DeploymentSetPlanImpl currentSet = getCurrentDeploymentSetPlan(); if (currentSet.hasServerGroupPlans()) { throw MESSAGES.cannotAddDeploymentAction(); } byte[] hash = deploymentDistributor.distributeDeploymentContent(name, commonName, stream); DeploymentActionImpl mod = DeploymentActionImpl.getAddAction(name, commonName, hash); DeploymentSetPlanImpl newSet = currentSet.addAction(mod); return new AddDeploymentPlanBuilderImpl(this, newSet); }
@Override public RemoveDeploymentPlanBuilder replace(String name, String commonName, InputStream stream) throws IOException { DeploymentSetPlanImpl currentSet = getCurrentDeploymentSetPlan(); if (currentSet.hasServerGroupPlans()) { throw MESSAGES.cannotAddDeploymentAction(); } byte[] hash = deploymentDistributor.distributeReplacementDeploymentContent(name, commonName, stream); DeploymentActionImpl mod = DeploymentActionImpl.getFullReplaceAction(name, commonName, hash); DeploymentSetPlanImpl newSet = currentSet.addAction(mod); return new RemoveDeploymentPlanBuilderImpl(this, newSet); }