org.opennms.netmgt.config
Class WmiDataCollectionConfigFactory

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

public class WmiDataCollectionConfigFactory
extends Object

This class loads and presents the WMI data collection configuration file for use with the WMI performance collection classes.

Author:
Matt Raykowski , OpenNMS

Field Summary
protected  boolean initialized
          Boolean indicating if the init() method has been called.
protected static long m_lastModified
          Timestamp of the WMI collection config, used to know when to reload from disk.
 
Constructor Summary
WmiDataCollectionConfigFactory(Reader rdr)
           
WmiDataCollectionConfigFactory(String configFile)
           
 
Method Summary
static WmiDatacollectionConfig getConfig()
           
static WmiDataCollectionConfigFactory getInstance()
          Singleton static call to get the only instance that should exist
 List getRRAList(String cName)
           
 String getRrdPath()
           
 RrdRepository getRrdRepository(String collectionName)
           
 int getStep(String cName)
           
 WmiCollection getWmiCollection(String collectionName)
           
static void init()
          Be sure to call this method before calling getInstance().
 void reload()
           
static void setConfig(WmiDatacollectionConfig m_config)
           
static void setInstance(WmiDataCollectionConfigFactory instance)
           
protected  void updateFromFile()
          Reload the wmi-datacollection-config.xml file if it has been changed since we last read it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

initialized

protected boolean initialized
Boolean indicating if the init() method has been called.


m_lastModified

protected static long m_lastModified
Timestamp of the WMI collection config, used to know when to reload from disk.

Constructor Detail

WmiDataCollectionConfigFactory

public WmiDataCollectionConfigFactory(String configFile)
                               throws org.exolab.castor.xml.MarshalException,
                                      org.exolab.castor.xml.ValidationException,
                                      IOException
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException

WmiDataCollectionConfigFactory

public WmiDataCollectionConfigFactory(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 IOException,
                        FileNotFoundException,
                        org.exolab.castor.xml.MarshalException,
                        org.exolab.castor.xml.ValidationException
Be sure to call this method before calling getInstance().

Throws:
IOException
FileNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

getInstance

public static WmiDataCollectionConfigFactory getInstance()
Singleton static call to get the only instance that should exist

Returns:
the single factory instance
Throws:
IllegalStateException - if init has not been called

setInstance

public static void setInstance(WmiDataCollectionConfigFactory instance)

reload

public void reload()
            throws IOException,
                   FileNotFoundException,
                   org.exolab.castor.xml.MarshalException,
                   org.exolab.castor.xml.ValidationException
Throws:
IOException
FileNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

updateFromFile

protected void updateFromFile()
                       throws IOException,
                              org.exolab.castor.xml.MarshalException,
                              org.exolab.castor.xml.ValidationException
Reload the wmi-datacollection-config.xml file if it has been changed since we last read it.

Throws:
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

getConfig

public static WmiDatacollectionConfig getConfig()

setConfig

public static void setConfig(WmiDatacollectionConfig m_config)

getWmiCollection

public WmiCollection getWmiCollection(String collectionName)

getRrdRepository

public RrdRepository getRrdRepository(String collectionName)

getStep

public int getStep(String cName)

getRRAList

public List getRRAList(String cName)

getRrdPath

public String getRrdPath()


Copyright © 2009. All Rights Reserved.