Class TorqueXmlParser
- java.lang.Object
-
- nl.esciencecenter.xenon.adaptors.schedulers.torque.TorqueXmlParser
-
final class TorqueXmlParser extends java.lang.Object
Parses xml output from TORQUE batch system.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.xml.parsers.DocumentBuilder
documentBuilder
private static org.slf4j.Logger
LOGGER
-
Constructor Summary
Constructors Constructor Description TorqueXmlParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.w3c.dom.Document
parseDocument(java.lang.String data)
protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>
parseJobInfos(java.lang.String data)
Parses job info from "qstat -x"protected void
recursiveMapFromElement(org.w3c.dom.Node root, java.util.Map<java.lang.String,java.lang.String> result)
Create a Map from the tag names and text values of child nodes.
-
-
-
Constructor Detail
-
TorqueXmlParser
TorqueXmlParser() throws XenonException
- Throws:
XenonException
-
-
Method Detail
-
parseDocument
protected org.w3c.dom.Document parseDocument(java.lang.String data) throws XenonException
- Throws:
XenonException
-
recursiveMapFromElement
protected void recursiveMapFromElement(org.w3c.dom.Node root, java.util.Map<java.lang.String,java.lang.String> result)
Create a Map from the tag names and text values of child nodes. If a child node also has tags, those tags and their text values will also be added. If multiple of the same tag names occur, the value of the last occurrence will be stored.- Parameters:
root
- XML element of which the children will be added to the mapresult
- a mutable map that will have added to it tag names as keys and text values as values- Throws:
java.lang.IllegalArgumentException
- if root is not an XML element
-
parseJobInfos
protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> parseJobInfos(java.lang.String data) throws XenonException
Parses job info from "qstat -x"- Parameters:
data
- the stream to get the xml data from- Returns:
- a list containing all queue names found
- Throws:
XenonException
- if the file could not be parsedXenonException
- if the server version is not compatible with this adaptor
-
-