Methods Summary |
---|
public java.lang.String | getAttribute(org.w3c.dom.Element element, java.lang.String attrName)Gets attribute value
if(element != null)
return element.getAttribute(attrName); //old value was config-ref
return null;
|
public java.util.List | getAttrs()
if(configDoc == null)
loadXML();
ArrayList list = new ArrayList(5);
XmlUtils.getAttributes(configDoc.getDocumentElement(),
PASSWORD, list);
return list;
|
public org.w3c.dom.Element | getElement(java.lang.String tagName, java.lang.String elementName)Returns specified xml node
if( tagName == null && elementName == null)
return null;
if (configDoc == null)
loadXML();
NodeList list = configDoc.getDocumentElement().getElementsByTagName(tagName);
if (list != null) {
int length = list.getLength();
Element element = null;
for (int i = 0; i < length ; i++) {
element = (Element) list.item(i);
if(element.getAttribute(NAME).equals(elementName))
return element;
}
}// if (list != null)
return null;
|
public org.w3c.dom.Element | getElement(org.w3c.dom.Element element, java.lang.String tagName)Assumes that there is only one child with given tag name
NodeList list = element.getElementsByTagName(tagName);
if (list != null) {
return (Element)list.item(0);
}//if
return null;
|
private void | loadXML()Loads XML - domain.xml in local mode
try {
String configFile = repositoryDir +
Constants.DOMAIN_XML;
String configDtdFile = DiagnosticServiceHelper.getInstallationRoot()+
Constants.DOMAIN_XML_DTD;
logger.log(Level.FINE,
"diagnostic-service.loadxml_configfile", configFile);
configDoc = XmlUtils.loadXML(configFile , configDtdFile);
} catch (SAXException ex) {
logger.log(Level.SEVERE,
"diagnostic-service.error_loading_xml",ex.getMessage());
throw new DiagnosticException (ex.getMessage());
} catch (IOException ioe) {
logger.log(Level.SEVERE,
"diagnostic-service.error_loading_xml",ioe.getMessage());
throw new DiagnosticException (ioe.getMessage());
} catch (ParserConfigurationException pce) {
logger.log(Level.SEVERE,
"diagnostic-service.error_loading_xml",pce.getMessage());
throw new DiagnosticException (pce.getMessage());
}
|