public DeploymentState getState() { return parent.getState(); }
public DeploymentState getState() { return parent.getState(); }
public DeploymentState getDeploymentState(String name) { DeploymentContext context = getDeploymentContext(name); if (context == null) return DeploymentState.UNDEPLOYED; return context.getState(); }
/** * Is context deployed. * * @param context the deployment context * @return true if context deployed, false otherwise */ protected boolean isDeployed(DeploymentContext context) { return context.isDeployed() || DeploymentState.DEPLOYED.equals(context.getState()); }
/** * Set the deployment state for a context and its children * * @param context the context * @param state the state * @param ifState the ifState */ private static void setState(DeploymentContext context, DeploymentState state, DeploymentState ifState) { if (ifState == null || ifState.equals(context.getState())) context.setState(state); List<DeploymentContext> children = context.getChildren(); if (children != null && children.isEmpty() == false) { for (DeploymentContext child : children) setState(child, state, ifState); } }
/** * Remove a context * * @param context the context * @param addToUndeploy add to undeploy collection */ private void removeContext(DeploymentContext context, boolean addToUndeploy) { String name = context.getName(); allDeployments.remove(name); errorDeployments.remove(name); missingDeployers.remove(name); if (DeploymentState.ERROR.equals(context.getState()) == false) context.setState(DeploymentState.UNDEPLOYING); DeploymentContext parent = context.getParent(); log.debug("Scheduling undeployment: " + name + " parent=" + parent); // Process the top level only if (context.isTopLevel() && addToUndeploy) undeploy.add(context); // Remove all the children List<DeploymentContext> children = context.getChildren(); if (children != null) { for (DeploymentContext child : children) removeContext(child, addToUndeploy); } }
/** * Add a context. * * @param context the context * @param addToDeploy should we add to deploy collection */ private void addContext(DeploymentContext context, boolean addToDeploy) { allDeployments.put(context.getName(), context); if (context.getState() == DeploymentState.ERROR) { log.debug("Not scheduling addition of context already in error: " + context.getName() + " reason=" + context.getProblem()); return; } context.setState(DeploymentState.DEPLOYING); DeploymentContext parent = context.getParent(); log.debug("Scheduling deployment: " + context.getName() + " parent=" + parent); // Process the top level only if (context.isTopLevel() && addToDeploy) deploy.add(context); // Add all the children List<DeploymentContext> children = context.getChildren(); if (children != null) { for (DeploymentContext child : children) addContext(child, addToDeploy); } }
if (DeploymentState.ERROR.equals(context.getState())) errorDeployments.put(name, context);
if (ControllerState.INSTALLED.equals(toState) && DeploymentState.DEPLOYING.equals(deploymentContext.getState()))