org.opennms.bb.eui.admin.snmp.utils
Class SnmpXmlParser

java.lang.Object
  |
  +--org.opennms.bb.common.utils.BBParser
        |
        +--org.opennms.bb.eui.admin.snmp.utils.SnmpXmlParser

public class SnmpXmlParser
extends BBParser

SnmpXmlParser parses a 'Snmp' xml and stores the data read in vectors
 This can then be queried for the data using the 'get..' functions

 It throws an IOException if the xml file is not found or if it does not
 conform to its DTD 

Author:
Sowmya Modifications: 04/18/00 - Changed the parser to extend BBParser - Sowmya 05/10/00 - Removed extraneous memory allocations for the range etc. column vectors

Inner classes inherited from class org.opennms.bb.common.utils.BBParser
BBParser.BBErrorHandler
 
Field Summary
(package private)  String DEFAULT
           
(package private)  Vector defaultColumns
           
(package private)  Vector defaultData
           
(package private)  Vector defCols
           
(package private)  String FROM
           
(package private)  int iNumDefParms
           
(package private)  int NUM_PARM_NOT_EQUAL_TO_NUM_DEFS_ERR
           
(package private)  String NUM_PARM_NOT_EQUAL_TO_NUM_DEFS_ERR_STR
           
(package private)  String PARM
           
(package private)  String PARM_NAME
           
(package private)  String PARM_VALUE
           
(package private)  String PARMS
           
(package private)  String RANGE
           
(package private)  String RANGES
           
(package private)  Vector rangesColumns
           
(package private)  Vector rangesData
           
(package private)  String SPECIFIC
           
(package private)  String SPECIFICS
           
(package private)  Vector specificsColumns
           
(package private)  Vector specificsData
           
(package private)  String SPECIP
           
(package private)  String TO
           
(package private)  String URL
           
(package private)  String URLNAME
           
(package private)  String URLS
           
(package private)  Vector urlsColumns
           
(package private)  Vector urlsData
           
 
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
SnmpXmlParser()
          Creates the DOM parser
 
Method Summary
 Vector getDefaultColumns()
          Returns the 'Default' tab column names
 Vector getDefaultData()
          Returns the 'Default' tab data
 String getErrorMessage()
          Returns the error message for the parse
 Vector getRangesColumns()
          Returns the 'Ranges' tab column names
 Vector getRangesData()
          Returns the 'Ranges' tab data
 Vector getSpecificsColumns()
          Returns the 'Specific Devices' tab column names
 Vector getSpecificsData()
          Returns the 'Specific Devices' tab data
 Vector getUrlsColumns()
          Returns the 'Url Configuration' tab column names
 Vector getUrlsData()
          Returns the 'Url Configuration' tab data
 void printDefaultData()
          Print the 'Default' tab data - used primarily for debugging
 void printTabCols(Vector v, String id)
          Print the vector passed in - used primarily for debugging
 void printTabData(Vector v, String id)
          Print the vector passed in - used primarily for debugging
protected  boolean processDefaultElement(org.w3c.dom.Node defNode)
           
protected  boolean processDefaultParms(org.w3c.dom.Node parmsNode)
           
protected  boolean processElement(org.w3c.dom.Element el, boolean isRoot)
          This is the method to be overridden by sub-classes to branch off and go through the DOM tree to handle elements specific to the XML they are parsing - does nothing here
protected  Vector processParm(org.w3c.dom.Node parmsNode)
           
protected  String processParmName(org.w3c.dom.Node parmNameNode)
           
protected  int processParms(org.w3c.dom.Node tabNode, Vector tabVector)
           
protected  boolean processRangesRange(org.w3c.dom.Node rangesNode)
           
protected  boolean processSpecificsSpecific(org.w3c.dom.Node specificsNode)
           
protected  boolean processTabElement(org.w3c.dom.Node tabNode)
           
protected  boolean processUrlsUrl(org.w3c.dom.Node urlsNode)
           
 
Methods inherited from class org.opennms.bb.common.utils.BBParser
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

defaultColumns

Vector defaultColumns

defaultData

Vector defaultData

defCols

Vector defCols

rangesColumns

Vector rangesColumns

rangesData

Vector rangesData

specificsColumns

Vector specificsColumns

specificsData

Vector specificsData

urlsColumns

Vector urlsColumns

urlsData

Vector urlsData

PARMS

final String PARMS

PARM

final String PARM

PARM_NAME

final String PARM_NAME

PARM_VALUE

final String PARM_VALUE

DEFAULT

final String DEFAULT

RANGES

final String RANGES

RANGE

final String RANGE

FROM

final String FROM

TO

final String TO

SPECIFICS

final String SPECIFICS

SPECIFIC

final String SPECIFIC

SPECIP

final String SPECIP

URLS

final String URLS

URL

final String URL

URLNAME

final String URLNAME

NUM_PARM_NOT_EQUAL_TO_NUM_DEFS_ERR

final int NUM_PARM_NOT_EQUAL_TO_NUM_DEFS_ERR

NUM_PARM_NOT_EQUAL_TO_NUM_DEFS_ERR_STR

final String NUM_PARM_NOT_EQUAL_TO_NUM_DEFS_ERR_STR

iNumDefParms

int iNumDefParms
Constructor Detail

SnmpXmlParser

public SnmpXmlParser()
Creates the DOM parser
Method Detail

processElement

protected boolean processElement(org.w3c.dom.Element el,
                                 boolean isRoot)
Description copied from class: BBParser
This is the method to be overridden by sub-classes to branch off and go through the DOM tree to handle elements specific to the XML they are parsing - does nothing here
Overrides:
processElement in class BBParser
Following copied from class: org.opennms.bb.common.utils.BBParser
Returns:
true if processed sucessfully, false otherwise

processDefaultElement

protected boolean processDefaultElement(org.w3c.dom.Node defNode)

processDefaultParms

protected boolean processDefaultParms(org.w3c.dom.Node parmsNode)

processTabElement

protected boolean processTabElement(org.w3c.dom.Node tabNode)

processRangesRange

protected boolean processRangesRange(org.w3c.dom.Node rangesNode)

processSpecificsSpecific

protected boolean processSpecificsSpecific(org.w3c.dom.Node specificsNode)

processUrlsUrl

protected boolean processUrlsUrl(org.w3c.dom.Node urlsNode)

processParms

protected int processParms(org.w3c.dom.Node tabNode,
                           Vector tabVector)

processParm

protected Vector processParm(org.w3c.dom.Node parmsNode)

processParmName

protected String processParmName(org.w3c.dom.Node parmNameNode)

getErrorMessage

public String getErrorMessage()
Returns the error message for the parse
Overrides:
getErrorMessage in class BBParser

getDefaultColumns

public Vector getDefaultColumns()
Returns the 'Default' tab column names
Returns:
The vector containing the 'default' columns

getDefaultData

public Vector getDefaultData()
Returns the 'Default' tab data
Returns:
The vector containing the 'default' data

getRangesColumns

public Vector getRangesColumns()
Returns the 'Ranges' tab column names
Returns:
The vector containing the 'Ranges' columns

getRangesData

public Vector getRangesData()
Returns the 'Ranges' tab data
Returns:
The vector containing the 'Ranges' data

getSpecificsColumns

public Vector getSpecificsColumns()
Returns the 'Specific Devices' tab column names
Returns:
The vector containing the 'Specific Devices' columns

getSpecificsData

public Vector getSpecificsData()
Returns the 'Specific Devices' tab data
Returns:
The vector containing the 'Specific Devices' data

getUrlsColumns

public Vector getUrlsColumns()
Returns the 'Url Configuration' tab column names
Returns:
The vector containing the 'Url Configuration' columns

getUrlsData

public Vector getUrlsData()
Returns the 'Url Configuration' tab data
Returns:
The vector containing the 'Url Configuration' data

printDefaultData

public void printDefaultData()
Print the 'Default' tab data - used primarily for debugging

printTabCols

public void printTabCols(Vector v,
                         String id)
Print the vector passed in - used primarily for debugging

printTabData

public void printTabData(Vector v,
                         String id)
Print the vector passed in - used primarily for debugging