org.opennms.netmgt.config
Class JMXDataCollectionConfigFactory

java.lang.Object
  extended by org.opennms.netmgt.config.JMXDataCollectionConfigFactory

public final class JMXDataCollectionConfigFactory
extends java.lang.Object

This class is the main respository for JMX data collection configuration information used by the an instance of the JMX service monitor. When this class is loaded it reads the jmx 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.

Author:
Mike Jamison , OpenNMS

Constructor Summary
JMXDataCollectionConfigFactory(java.io.Reader rdr)
           
 
Method Summary
 java.util.Map getAttributeMap(java.lang.String cName, java.lang.String aSysoid, java.lang.String anAddress)
          This method returns the list of MIB objects associated with a particular system object id, IP address, and ifType for the specified collection.
static JMXDataCollectionConfigFactory 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.HashMap getMBeanInfo_save(java.lang.String cName)
           
 java.util.HashMap getMBeanInfo(java.lang.String cName)
           
 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.
 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.
static void reload()
          Reload the config from the default config file
static void setInstance(JMXDataCollectionConfigFactory singleton)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMXDataCollectionConfigFactory

public JMXDataCollectionConfigFactory(java.io.Reader rdr)
                               throws org.exolab.castor.xml.MarshalException,
                                      org.exolab.castor.xml.ValidationException
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
Method Detail

init

public static void init()
                 throws java.io.IOException,
                        org.exolab.castor.xml.MarshalException,
                        org.exolab.castor.xml.ValidationException
Load the config from the default config file and create the singleton instance of this factory.

Throws:
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.

reload

public static void reload()
                   throws java.io.IOException,
                          org.exolab.castor.xml.MarshalException,
                          org.exolab.castor.xml.ValidationException
Reload the config from the default config file

Throws:
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.

getInstance

public static JMXDataCollectionConfigFactory getInstance()
Return the singleton instance of this factory.

Returns:
The current factory instance.
Throws:
java.lang.IllegalStateException - Thrown if the factory has not yet been initialized.

setInstance

public static void setInstance(JMXDataCollectionConfigFactory singleton)

getAttributeMap

public java.util.Map getAttributeMap(java.lang.String cName,
                                     java.lang.String aSysoid,
                                     java.lang.String anAddress)
This method returns the list of MIB objects associated with a particular system object id, IP address, and ifType for the specified collection.

Parameters:
cName - name of the data collection from which to retrieve oid information.
aSysoid - system object id to look up in the collection
anAddress - IP address to look up in the collection
ifType - Interface type (-1 indicates that only node-level objects should be retrieved.
Returns:
a list of MIB objects

getMBeanInfo

public java.util.HashMap getMBeanInfo(java.lang.String cName)

getMBeanInfo_save

public java.util.HashMap getMBeanInfo_save(java.lang.String cName)

getStep

public int getStep(java.lang.String cName)
Retrieves configured RRD step size.

Parameters:
cName - Name of the data collection
Returns:
RRD step size for the specified collection

getRRAList

public java.util.List getRRAList(java.lang.String cName)
Retrieves configured list of RoundRobin Archive statements.

Parameters:
cName - Name of the data collection
Returns:
list of RRA strings.

getMaxVarsPerPdu

public 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..

Parameters:
cName - Name of the data collection
Returns:
max number of variables per pdu or -1 upon error

getRrdRepository

public java.lang.String getRrdRepository()
Retrieves the configured path to the RRD file repository.

Returns:
RRD repository path.


Copyright © 2007. All Rights Reserved.