|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opennms.bb.common.utils.BBParser | +--org.opennms.bb.dp.poller.parsers.PackageParser
This class is used to parse the packages.xml and load the information into classes to be used programatically.
Inner classes inherited from class org.opennms.bb.common.utils.BBParser |
BBParser.BBErrorHandler |
Field Summary | |
private String |
DEFAULT
|
private String |
ERANGE
|
private String |
FILTER
|
private String |
FILTER_COMMENT
|
private String |
FILTER_EXPR
|
private String |
IRANGE
|
private List |
m_modelNames
The list of model names that are associated with the packages |
private List |
m_packageList
The list of packages to parse from the xml file. |
private List |
m_packages
The list of Package objects that are created by parsing from the list of packages. |
private PollerPackage |
m_pollerPackage
As each package is parsed this object will be built and then placed into the m_packages list when complete |
private boolean |
m_readPackage
Indicates if a certain package should be read or ignored |
private String |
MODEL
|
private String |
PACKAGENAME
|
private String |
PARM
|
private String |
PARM_NAME
|
private String |
PARM_TYPE
|
private String |
PARM_VALUE
|
private String |
PARMS
|
private String |
RANGES
|
private String |
SERVICE
|
private String |
SERVICE_NAME
|
private String |
SPECIFIC
|
private String |
URL
|
Fields inherited from class org.opennms.bb.common.utils.BBParser |
ATTRIB_VALUE_PAIR_ERR, ATTRIB_VALUE_PAIR_ERR_STR, EXCEPTION, m_curElement, m_errNum, m_exceptionMsg, m_inpSource, m_parser, NULL_VALUE_ERR, NULL_VALUE_ERR_STR |
Constructor Summary | |
PackageParser(List aPackageList)
Creates the new parser that can be used to disassemble an XML file corresponding to the m_packages.dtd as defined by the OpenNMS specifications. |
Method Summary | |
List |
getModelNames()
|
List |
getPackages()
This method returns the list of Packages that was created by parsing. |
protected boolean |
getParameterName(org.w3c.dom.Node parmNameNode,
Parameter parm)
This method process the parameter <name> element of the parameter block in the DTD. |
protected boolean |
getParameterValue(org.w3c.dom.Node parmValNode,
Parameter parm)
Process the <value> element of the parm block and returns the information in the passed parm element. |
private boolean |
processDefRangeElement(org.w3c.dom.Element defaultElement,
PollerPackage m_pollerPackage)
This method is used to process the default range tags |
protected boolean |
processElement(org.w3c.dom.Element el,
boolean isRoot)
This method override the method in the base class that is the default target for processing elements in the DOM tree. |
private boolean |
processERangeElement(org.w3c.dom.Element erangeElement,
PollerPackage m_pollerPackage)
This method is used to process the |
private boolean |
processFilterTag(org.w3c.dom.Node filterNode,
PollerPackage m_pollerPackage)
This method is used to process the filter tag section of the document. |
private boolean |
processIRangeElement(org.w3c.dom.Element irangeElement,
PollerPackage m_pollerPackage)
This method is used to process the |
protected Parameter |
processParameter(org.w3c.dom.Node parmsNode)
This method is used to process the DTDs parameter block. |
private void |
processRange(org.w3c.dom.Node rangeNode,
PollerRange aRange)
This method parses the parameter tags ( |
private boolean |
processServiceElement(org.w3c.dom.Element serviceElement,
PollerPackage m_pollerPackage)
This method is used to process the |
private void |
processServiceParameters(org.w3c.dom.Node paramNode,
ServiceInfo aService)
This method parses the parameter tags ( |
private boolean |
processSpecificElement(org.w3c.dom.Element specificElement,
PollerPackage m_pollerPackage)
This method is used to process the |
private boolean |
processUrlElement(org.w3c.dom.Element urlElement,
PollerPackage m_pollerPackage)
This method is used to process the |
Methods inherited from class org.opennms.bb.common.utils.BBParser |
getErrorMessage, getErrorNumber, parse, parse, parse, parse, processDocument, processNode, processParmValue |
Methods inherited from class java.lang.Object |
|
Field Detail |
private List m_packageList
private List m_packages
private List m_modelNames
private boolean m_readPackage
private PollerPackage m_pollerPackage
private final String FILTER
private final String FILTER_COMMENT
private final String MODEL
private final String FILTER_EXPR
private final String SERVICE
private final String SERVICE_NAME
private final String PARMS
private final String PARM
private final String PARM_NAME
private final String PARM_VALUE
private final String PARM_TYPE
private final String PACKAGENAME
private final String DEFAULT
private final String RANGES
private final String IRANGE
private final String ERANGE
private final String SPECIFIC
private final String URL
Constructor Detail |
public PackageParser(List aPackageList)
Creates the new parser that can be used to disassemble an XML file corresponding to the m_packages.dtd as defined by the OpenNMS specifications. A new instance of a DOM parser is created to parse the passed file. The list of package that should be read by the parser are passed to the object on construction.
List
- aPackageList, The list of m_packages to be read.Method Detail |
protected boolean processElement(org.w3c.dom.Element el, boolean isRoot)
This method override the method in the base class that is the default target for processing elements in the DOM tree. The method is invoked by the DOM parser to handle each element. This extends the DiscIcebergParser by parsing out all information from the xml file. Additions will be commented.
processElement
in class BBParser
el
- The DOM element to be processed.isRoot
- True if the element is a root element.private boolean processFilterTag(org.w3c.dom.Node filterNode, PollerPackage m_pollerPackage)
This method is used to process the filter tag section of the document. If there is a return between the tag and the CDATA section the data will not be retrieved. This seems to be an issue with either Xerces or the XML spec. Make sure that the tag and the data for the filter expression are on the same line.
List
- aPackageList, the DOM node to handle.PollerPackage
- m_pollerPackage, the package object we are buildingprivate boolean processServiceElement(org.w3c.dom.Element serviceElement, PollerPackage m_pollerPackage)
This method is used to process the
Element
- serviceElement, the DOM element to handle.PollerPackage
- m_pollerPackage, the package object we are buildingprivate void processServiceParameters(org.w3c.dom.Node paramNode, ServiceInfo aService)
This method parses the parameter tags (
Node
- paramNode, the DOM node to handle.ServiceInfo
- aService, the object to place the Parameter intoprivate boolean processDefRangeElement(org.w3c.dom.Element defaultElement, PollerPackage m_pollerPackage)
This method is used to process the default range tags
Element
- defaultElement, the DOM element to handle.PollerPackage
- m_pollerPackage, the package object we are buildingprivate boolean processIRangeElement(org.w3c.dom.Element irangeElement, PollerPackage m_pollerPackage)
This method is used to process the
Element
- irangeElement, the DOM element to handle.PollerPackage
- m_pollerPackage, the package object we are buildingprivate boolean processERangeElement(org.w3c.dom.Element erangeElement, PollerPackage m_pollerPackage)
This method is used to process the
Element
- erangeElement, the DOM element to handle.PollerPackage
- m_pollerPackage, the package object we are buildingprivate boolean processSpecificElement(org.w3c.dom.Element specificElement, PollerPackage m_pollerPackage)
This method is used to process the
Element
- specificElement, the DOM element to handle.PollerPackage
- m_pollerPackage, the package object we are buildingprivate boolean processUrlElement(org.w3c.dom.Element urlElement, PollerPackage m_pollerPackage)
This method is used to process the
Element
- urlElement, the DOM element to handle.PollerPackage
- m_pollerPackage, the package object we are buildingprivate void processRange(org.w3c.dom.Node rangeNode, PollerRange aRange)
This method parses the parameter tags (
Node
- rangeNode, the DOM node to handle.PollerRange
- aRange, the object to place the Parameter intoprotected Parameter processParameter(org.w3c.dom.Node parmsNode)
This method is used to process the DTDs parameter block. The parameter block consist of a name, value, and the values type as an attribute. The elements are parsed out and stored in the returned Parameter object.
parmsNode
- The node containing the parameter informationprotected boolean getParameterName(org.w3c.dom.Node parmNameNode, Parameter parm)
This method process the parameter <name> element of the parameter block in the DTD. The value for the element is returned to the caller upon success.
parmNameNode
- The DOM Node containing the parm name.parm
- The parameter element to store the name.protected boolean getParameterValue(org.w3c.dom.Node parmValNode, Parameter parm)
Process the <value> element of the parm block and returns the information in the passed parm element. If the data is successfully extracted then a value of true is returned. If an error occurs then a false value is returned.
parmValNode
- The node element from the DOM parser.parm
- The [in/out] element modified by the call.public List getPackages()
This method returns the list of Packages that was created by parsing.
public List getModelNames()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |