net.sf.snmpadaptor4j.config
Class XmlConfigParser

java.lang.Object
  extended by net.sf.snmpadaptor4j.config.XmlConfigParser
All Implemented Interfaces:
SnmpDaemonConfiguration, SnmpAppContext, SnmpConfiguration

public final class XmlConfigParser
extends Object
implements SnmpConfiguration, SnmpAppContext

XML parser of SNMP configuration.

Author:
Jean-Philippe MINETTI

Method Summary
 String getDefaultRootOid()
          Returns the default root OID containing the attributes of the application.
 String getListenerAddress()
          Returns the listening IP address of SNMP daemon (127.0.0.1 by default).
 Integer getListenerPort()
          Returns the UDP port of SNMP daemon (161 by default).
 String getListenerReadCommunity()
          Returns the read community of SNMP daemon ("public" by default).
 Integer getListenerSnmpVersion()
          Returns the protocol version of SNMP daemon (SNMP v2 by default).
 String getListenerWriteCommunity()
          Returns the write community of SNMP daemon ("private" by default).
 List<SnmpManagerConfiguration> getManagerList()
          Returns the parameter list to connect to each manager where to send all notifications (SNMP traps).
 Map<ObjectName,String> getMBeanOidMap()
          Returns the map of MBean OIDs.
 Map<String,String> getRootOidMap()
          Returns the map of root OIDs where the attributes of the application will stay.
static XmlConfigParser newInstance(URL url)
          Creates and returns a new instance of XmlConfigParser.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

newInstance

public static XmlConfigParser newInstance(URL url)
                                   throws Exception
Creates and returns a new instance of XmlConfigParser.

Parameters:
url - URL to the SNMP configuration file.
Returns:
New instance of XmlConfigParser.
Throws:
Exception - Exception if an error occurred.

getListenerAddress

public String getListenerAddress()
Description copied from interface: SnmpDaemonConfiguration
Returns the listening IP address of SNMP daemon (127.0.0.1 by default).

Specified by:
getListenerAddress in interface SnmpDaemonConfiguration
Returns:
Listening IP address.

getListenerPort

public Integer getListenerPort()
Description copied from interface: SnmpDaemonConfiguration
Returns the UDP port of SNMP daemon (161 by default).

Specified by:
getListenerPort in interface SnmpDaemonConfiguration
Returns:
UDP port.

getListenerSnmpVersion

public Integer getListenerSnmpVersion()
Description copied from interface: SnmpDaemonConfiguration
Returns the protocol version of SNMP daemon (SNMP v2 by default).

Specified by:
getListenerSnmpVersion in interface SnmpDaemonConfiguration
Returns:
SNMP protocol version.

getListenerReadCommunity

public String getListenerReadCommunity()
Description copied from interface: SnmpDaemonConfiguration
Returns the read community of SNMP daemon ("public" by default).

Specified by:
getListenerReadCommunity in interface SnmpDaemonConfiguration
Returns:
Read community of SNMP daemon.

getListenerWriteCommunity

public String getListenerWriteCommunity()
Description copied from interface: SnmpDaemonConfiguration
Returns the write community of SNMP daemon ("private" by default).

Specified by:
getListenerWriteCommunity in interface SnmpDaemonConfiguration
Returns:
Write community of SNMP daemon.

getManagerList

public List<SnmpManagerConfiguration> getManagerList()
Description copied from interface: SnmpConfiguration
Returns the parameter list to connect to each manager where to send all notifications (SNMP traps).

Specified by:
getManagerList in interface SnmpConfiguration
Returns:
Parameter list to connect to each manager.

getDefaultRootOid

public String getDefaultRootOid()
Description copied from interface: SnmpAppContext
Returns the default root OID containing the attributes of the application.

Specified by:
getDefaultRootOid in interface SnmpAppContext
Returns:
Default root OID.

getRootOidMap

public Map<String,String> getRootOidMap()
Description copied from interface: SnmpAppContext
Returns the map of root OIDs where the attributes of the application will stay.

Specified by:
getRootOidMap in interface SnmpAppContext
Returns:
Map of root OIDs (never NULL but can be empty).

getMBeanOidMap

public Map<ObjectName,String> getMBeanOidMap()
Description copied from interface: SnmpAppContext
Returns the map of MBean OIDs.

Specified by:
getMBeanOidMap in interface SnmpAppContext
Returns:
Map of MBean OIDs (never NULL but can be empty).

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012-2013 snmpAdaptor4j. All Rights Reserved.