|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.config.DataCollectionConfigFactory
This class is the main respository for SNMP data collection configuration information used by the SNMP service monitor. When this class is loaded it reads the snmp data collection configuration into memory. Note: Users of this class should make sure the init() is called before calling any other method to ensure the config is loaded before accessing other convenience methods.
Field Summary | |
private java.util.Map |
m_collectionGroupMap
Map of group maps indexed by SNMP collection name. |
private java.util.Map |
m_collectionMap
Map of SnmpCollection objects indexed by data collection name |
private DatacollectionConfig |
m_config
The config class loaded from the config file |
private static boolean |
m_loaded
This member is set to true if the configuration file has been loaded. |
private static DataCollectionConfigFactory |
m_singleton
The singleton instance of this factory |
Constructor Summary | |
private |
DataCollectionConfigFactory(java.lang.String configFile)
Private constructor |
Method Summary | |
static DataCollectionConfigFactory |
getInstance()
Return the singleton instance of this factory. |
int |
getMaxVarsPerPdu(java.lang.String cName)
Retrieves the configured value for the maximum number of variables (oids) which can be encoded into a single outgoing SNMP PDU request.. |
java.util.List |
getMibObjectList(java.lang.String cName,
java.lang.String aSysoid,
java.lang.String anAddress,
int ifType)
This method returns the list of MIB objects associated with a particular system object id, IP address, and ifType for the specified collection. |
java.util.List |
getRRAList(java.lang.String cName)
Retrieves configured list of RoundRobin Archive statements. |
java.lang.String |
getRrdRepository()
Retrieves the configured path to the RRD file repository. |
java.lang.String |
getSnmpStorageFlag(java.lang.String cName)
Retrieves the configured value of the SNMP storage flag. |
int |
getStep(java.lang.String cName)
Retrieves configured RRD step size. |
static void |
init()
Load the config from the default config file and create the singleton instance of this factory. |
private void |
processGroupName(java.lang.String cName,
java.lang.String groupName,
int ifType,
java.util.List mibObjectList)
Private utility method used by the getMibObjectList() method. |
(package private) static void |
processObjectList(java.util.List objectList,
java.util.List mibObjectList)
Takes a list of castor generated MibObj objects iterates over them creating corresponding MibObject objects and adding them to the supplied MibObject list. |
static void |
reload()
Reload the config from the default config file |
private static long |
toLong(java.net.InetAddress addr)
Converts the internet address to a long value so that it can be compared using simple opertions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static DataCollectionConfigFactory m_singleton
private DatacollectionConfig m_config
private static boolean m_loaded
private java.util.Map m_collectionGroupMap
private java.util.Map m_collectionMap
Constructor Detail |
private DataCollectionConfigFactory(java.lang.String configFile) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
- Thrown if the specified config file cannot be read
org.exolab.castor.xml.MarshalException
- Thrown if the file does not conform to the schema.
org.exolab.castor.xml.ValidationException
- Thrown if the contents do not match the required schema.Method Detail |
public static void init() throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
- Thrown if the specified config file cannot be read
org.exolab.castor.xml.MarshalException
- Thrown if the file does not conform to the schema.
org.exolab.castor.xml.ValidationException
- Thrown if the contents do not match the required schema.public static void reload() throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
- Thrown if the specified config file cannot be read/loaded
org.exolab.castor.xml.MarshalException
- Thrown if the file does not conform to the schema.
org.exolab.castor.xml.ValidationException
- Thrown if the contents do not match the required schema.public static DataCollectionConfigFactory getInstance()
java.lang.IllegalStateException
- Thrown if the factory has not yet been initialized.private static long toLong(java.net.InetAddress addr)
addr
- The address to convert to a long
public java.util.List getMibObjectList(java.lang.String cName, java.lang.String aSysoid, java.lang.String anAddress, int ifType)
cName
- name of the data collection from which to retrieve oid
information.aSysoid
- system object id to look up in the collectionanAddress
- IP address to look up in the collectionifType
- Interface type (-1 indicates that only node-level objects
should be retrieved.
private void processGroupName(java.lang.String cName, java.lang.String groupName, int ifType, java.util.List mibObjectList)
cName
- Collection namegroupName
- Name of the group to processifType
- Interface typemibObjectList
- List of MibObject objects being built.static void processObjectList(java.util.List objectList, java.util.List mibObjectList)
objectList
- List of MibObject objects parsed from
'datacollection-config.xml'mibObjectList
- List of MibObject objects currently being builtpublic int getStep(java.lang.String cName)
cName
- Name of the data collection
public java.util.List getRRAList(java.lang.String cName)
cName
- Name of the data collection
public java.lang.String getSnmpStorageFlag(java.lang.String cName)
cName
- Name of the data collection
public int getMaxVarsPerPdu(java.lang.String cName)
cName
- Name of the data collection
public java.lang.String getRrdRepository()
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |