Class WmiDataCollectionConfigFactory


  • public class WmiDataCollectionConfigFactory
    extends java.lang.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 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​(java.lang.String configFile)
                                       throws java.io.IOException

        Constructor for WmiDataCollectionConfigFactory.

        Parameters:
        configFile - a String object.
        Throws:
        java.io.IOException - if any.
      • WmiDataCollectionConfigFactory

        public WmiDataCollectionConfigFactory​(java.io.InputStream is)
                                       throws java.io.IOException

        Constructor for WmiDataCollectionConfigFactory.

        Parameters:
        is - a InputStream object.
        Throws:
        java.io.IOException
    • Method Detail

      • init

        public static void init()
                         throws java.io.IOException,
                                java.io.FileNotFoundException
        Be sure to call this method before calling getInstance().
        Throws:
        java.io.IOException - if any.
        java.io.FileNotFoundException - if any.
      • getInstance

        public static WmiDataCollectionConfigFactory getInstance()
        Singleton static call to get the only instance that should exist
        Returns:
        the single factory instance
        Throws:
        java.lang.IllegalStateException - if init has not been called
      • reload

        public void reload()
                    throws java.io.IOException,
                           java.io.FileNotFoundException

        reload

        Throws:
        java.io.IOException - if any.
        java.io.FileNotFoundException - if any.
      • updateFromFile

        protected void updateFromFile()
                               throws java.io.IOException
        Reload the wmi-datacollection-config.xml file if it has been changed since we last read it.
        Throws:
        java.io.IOException - if any.
      • getWmiCollection

        public WmiCollection getWmiCollection​(java.lang.String collectionName)

        getWmiCollection

        Parameters:
        collectionName - a String object.
        Returns:
        a WmiCollection object.
      • getRrdRepository

        public RrdRepository getRrdRepository​(java.lang.String collectionName)

        getRrdRepository

        Parameters:
        collectionName - a String object.
        Returns:
        a RrdRepository object.
      • getStep

        public int getStep​(java.lang.String cName)

        getStep

        Parameters:
        cName - a String object.
        Returns:
        a int.
      • getRRAList

        public java.util.List<java.lang.String> getRRAList​(java.lang.String cName)

        getRRAList

        Parameters:
        cName - a String object.
        Returns:
        a List object.
      • getRrdPath

        public java.lang.String getRrdPath()

        getRrdPath

        Returns:
        a String object.