org.opennms.bb.dp.discovery.utils
Class DiscPollersParser

java.lang.Object
  |
  +--org.opennms.bb.common.utils.BBParser
        |
        +--org.opennms.bb.dp.discovery.utils.DiscPollersParser

public final class DiscPollersParser
extends BBParser

The DiscPollersParser class is designed parse the pollersXML.xml configuration file for the information that is specific to the discovery process. The class extends the BBParser class and overrides the necessary methods to correctly parse the XML configuration file.

Version:
$Revision: 1.6 $
Author:
OpenNMS

Inner classes inherited from class org.opennms.bb.common.utils.BBParser
BBParser.BBErrorHandler
 
Field Summary
private  String DISCLIMIT
           
private  long m_curPollerIP
          This is the IP Address of the current XML configation info.
private  float m_discLimit
          The discovery limit load for this poller from the XML configuration file.
private  long m_ipAddr
          This defines the IPv4 Address of this poller.
private  List m_packages
          The list of poller packages that should be used by discovery.
private  String PACKAGE
           
private  String POLLERIP
           
private  String TYPE
           
 
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
DiscPollersParser(long ipAddr)
          The class constructor initilizes a new instance of the class to parse the discovery XML configation file into a DOM tree.
 
Method Summary
 float getBandwidthLimit()
          Returns the discovery bandwidth limitation as found in the XML configuation document.
 List getPackages()
          Returns the list of poller packages that were parsed from the XML configuration document.
protected  boolean processElement(org.w3c.dom.Element el, boolean isRoot)
          Overrides the base class' method and parses the proper element types for the discovery XML types.
 
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
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_ipAddr

private long m_ipAddr

This defines the IPv4 Address of this poller. The class should only load the information relevant to this poller and ignore the rest.


m_discLimit

private float m_discLimit

The discovery limit load for this poller from the XML configuration file.


m_packages

private List m_packages

The list of poller packages that should be used by discovery.


m_curPollerIP

private long m_curPollerIP

This is the IP Address of the current XML configation info. As the file is parsed, this address will change to match the section being parsed.


DISCLIMIT

private final String DISCLIMIT

POLLERIP

private final String POLLERIP

PACKAGE

private final String PACKAGE

TYPE

private final String TYPE
Constructor Detail

DiscPollersParser

public DiscPollersParser(long ipAddr)

The class constructor initilizes a new instance of the class to parse the discovery XML configation file into a DOM tree. Once the tree is loaded the relevant information is processed for the callers consumption.

Parameters:
ipAddr - The IP Address of the poller configuation that is desired.
Method Detail

processElement

protected boolean processElement(org.w3c.dom.Element el,
                                 boolean isRoot)

Overrides the base class' method and parses the proper element types for the discovery XML types. The method is invoked by the DOM parser when a new element is discovered.

Overrides:
processElement in class BBParser
Parameters:
el - The element that is currently being processed.
isRoot - True if the element is a root element.

getBandwidthLimit

public float getBandwidthLimit()

Returns the discovery bandwidth limitation as found in the XML configuation document.

Returns:
The discovery bandwidth limit.

getPackages

public List getPackages()

Returns the list of poller packages that were parsed from the XML configuration document. The list is not synchronized and care should be used when shared between multiple threads.

Returns:
The list of packages