Class NSClientDataCollectionConfigFactory


  • public class NSClientDataCollectionConfigFactory
    extends java.lang.Object

    NSClientDataCollectionConfigFactory class.

    Author:
    Craig Miskell
    • Field Detail

      • m_lastModified

        protected static long m_lastModified
        Timestamp of the nsclient collection config, used to know when to reload from disk.
    • Constructor Detail

      • NSClientDataCollectionConfigFactory

        public NSClientDataCollectionConfigFactory​(java.lang.String configFile)
                                            throws java.io.IOException

        Constructor for NSClientDataCollectionConfigFactory.

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

      • getReadLock

        public java.util.concurrent.locks.Lock getReadLock()
      • getWriteLock

        public java.util.concurrent.locks.Lock getWriteLock()
      • 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 NSClientDataCollectionConfigFactory 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.
      • getNSClientCollection

        public NsclientCollection getNSClientCollection​(java.lang.String collectionName)

        getNSClientCollection

        Parameters:
        collectionName - a String object.
        Returns:
        a org.opennms.netmgt.config.nsclient.NsclientCollection 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.
      • updateFromFile

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