public void removeFailedCommands(String instanceName) throws Exception { Node instance = findNode(instanceName); if (instance == null) return; NodeList clist = instance.getChildNodes(); for(int j=0; j<clist.getLength(); j++) { instance.removeChild(clist.item(j)); } writeDoc(); }
public void removeInstanceNode(String instanceName) throws Exception { Node instance = findNode(instanceName); if (instance == null) return; NodeList clist = instance.getChildNodes(); for(int j=0; j<clist.getLength(); j++) { instance.removeChild(clist.item(j)); } Node parent = instance.getParentNode(); parent.removeChild(instance); writeDoc(); }
public void removeInstanceNode(String instanceName) throws Exception { Node instance = findNode(instanceName); if (instance == null) return; NodeList clist = instance.getChildNodes(); for(int j=0; j<clist.getLength(); j++) { instance.removeChild(clist.item(j)); } Node parent = instance.getParentNode(); parent.removeChild(instance); writeDoc(); }
public void removeFailedCommands(String instanceName) throws Exception { Node instance = findNode(instanceName); if (instance == null) return; NodeList clist = instance.getChildNodes(); for(int j=0; j<clist.getLength(); j++) { instance.removeChild(clist.item(j)); } writeDoc(); }
public void updateState(String instanceName, String newState) throws Exception { Node instance = findNode(instanceName); if (instance == null) { addInstanceNode(instanceName, newState); } else { instance.getAttributes().getNamedItem("state").setNodeValue(newState); } writeDoc(); }
public void updateState(String instanceName, String newState) throws Exception { Node instance = findNode(instanceName); if (instance == null) { addInstanceNode(instanceName, newState); } else { instance.getAttributes().getNamedItem("state").setNodeValue(newState); } writeDoc(); }
public void addFailedCommand(String instanceName, String failedCmd) throws Exception { Node instance = findNode(instanceName); if (instance == null) { instance = addInstanceNode(instanceName, InstanceState.StateType.NO_RESPONSE.getDescription()); } Text tNode = xmlDoc.createTextNode(failedCmd); Element fcNode = xmlDoc.createElement("failed-command"); fcNode.appendChild(tNode); instance.appendChild(fcNode); writeDoc(); }
public void addFailedCommand(String instanceName, String failedCmd) throws Exception { Node instance = findNode(instanceName); if (instance == null) { instance = addInstanceNode(instanceName, InstanceState.StateType.NO_RESPONSE.getDescription()); } Text tNode = xmlDoc.createTextNode(failedCmd); Element fcNode = xmlDoc.createElement("failed-command"); fcNode.appendChild(tNode); instance.appendChild(fcNode); writeDoc(); }
public void addNewServer(String name) throws Exception { String newState = InstanceState.StateType.NEVER_STARTED.getDescription(); Node i = findNode(name); if (i != null) { // deal with the case where an entry for this server was already // in the list. This can happen the first time the file is created. // In this case, remove the old information. removeInstanceNode(name); } addInstanceNode(name, newState); writeDoc(); }
public void addNewServer(String name) throws Exception { String newState = InstanceState.StateType.NEVER_STARTED.getDescription(); Node i = findNode(name); if (i != null) { // deal with the case where an entry for this server was already // in the list. This can happen the first time the file is created. // In this case, remove the old information. removeInstanceNode(name); } addInstanceNode(name, newState); writeDoc(); }