private Element getNoMoreThanOneChild( Element element, String name ) { List<Element> children = XmlUtils.getChildrenByTagName(element, name); if (children.size() == 0) { return null; } else { return children.get(0); } } }
List<Element> globalPropertiesNodes = XmlUtils.getChildrenByTagName(atsProjectNode, NODE_APPLICATION_GLOBAL_PROPERTIES); if (globalPropertiesNodes.size() >= 1) { List<Element> portElements = XmlUtils.getChildrenByTagName(globalPropertiesNode, NODE_APPLICATION_GLOBAL_PROPERTY_PORT); if (portElements.size() >= 1) { List<Element> unixJavaExeElements = XmlUtils.getChildrenByTagName(globalPropertiesNode, NODE_APPLICATION_GLOBAL_PROPERTY_UNIX_JAVA_EXEC); if (unixJavaExeElements.size() >= 1) { List<Element> winJavaExeElements = XmlUtils.getChildrenByTagName(globalPropertiesNode, NODE_APPLICATION_GLOBAL_PROPERTY_WIN_JAVA_EXEC); if (winJavaExeElements.size() >= 1) { List<Element> winStartupLatencyElements = XmlUtils.getChildrenByTagName(globalPropertiesNode, NODE_APPLICATION_GLOBAL_PROPERTY_WIN_STARTUP_LATENCY); if (winStartupLatencyElements.size() >= 1) {
List<Element> agentZipElements = XmlUtils.getChildrenByTagName(sourceNode, "agentZip"); if (agentZipElements != null && !agentZipElements.isEmpty()) { this.agentZip = XmlUtils.getMandatoryAttribute(agentZipElements.get(0), for (Element folderPathNode : XmlUtils.getChildrenByTagName(sourceNode, AtsProjectConfiguration.NODE_ATTRIBUTE_FOLDER)) { PathInfo folderPath = new PathInfo(folderPathNode, false, this.home); for (Element filePathNode : XmlUtils.getChildrenByTagName(sourceNode, AtsProjectConfiguration.NODE_ATTRIBUTE_FILE)) { this.paths.add(new PathInfo(filePathNode, true, this.home));
List<Element> sourceNodes = XmlUtils.getChildrenByTagName(atsProjectNode, NODE_SOURCE_PROJECT); if (sourceNodes.size() != 1) { throw new AtsConfigurationException("Bad ATS configuration file. We must have exactly 1 " List<Element> agentNodes = XmlUtils.getChildrenByTagName(atsProjectNode, NODE_ATS_AGENT); for (Element agentNode : agentNodes) { String agentAlias = XmlUtils.getMandatoryAttribute(agentNode, NODE_ATTRIBUTE_ALIAS); List<Element> applicationNodes = XmlUtils.getChildrenByTagName(atsProjectNode, NODE_APPLICATION); for (Element applicationNode : applicationNodes) { String applicationAlias = XmlUtils.getMandatoryAttribute(applicationNode, NODE_ATTRIBUTE_ALIAS); List<Element> shellCommandsNodes = XmlUtils.getChildrenByTagName(atsProjectNode, NODE_SHELL_COMMANDS); if (shellCommandsNodes.size() > 0) { shellCommandsNodes = XmlUtils.getChildrenByTagName(shellCommandsNodes.get(0), "command"); for (Element commandNode : shellCommandsNodes) {
List<Element> postInstallCommandElements = XmlUtils.getChildrenByTagName(applicationNode, AtsProjectConfiguration.NODE_APPLICATION_PROPERTY_POST_INSTALL_COMMAND); if (postInstallCommandElements.size() > 0) { List<Element> postStartCommandElements = XmlUtils.getChildrenByTagName(applicationNode, AtsProjectConfiguration.NODE_APPLICATION_PROPERTY_POST_START_COMMAND); if (postStartCommandElements.size() > 0) { List<Element> postStopCommandElements = XmlUtils.getChildrenByTagName(applicationNode, AtsProjectConfiguration.NODE_APPLICATION_PROPERTY_POST_STOP_COMMAND); if (postStopCommandElements.size() > 0) { for (Element folderPathNode : XmlUtils.getChildrenByTagName(applicationNode, AtsProjectConfiguration.NODE_ATTRIBUTE_FOLDER)) { this.paths.add(new PathInfo(folderPathNode, false, this.home, sftpHome, isUnix)); for (Element filePathNode : XmlUtils.getChildrenByTagName(applicationNode, AtsProjectConfiguration.NODE_ATTRIBUTE_FILE)) { this.paths.add(new PathInfo(filePathNode, true, this.home, sftpHome, isUnix));