Class NSClientDataCollectionConfigFactory
- java.lang.Object
-
- org.opennms.protocols.nsclient.config.NSClientDataCollectionConfigFactory
-
public class NSClientDataCollectionConfigFactory extends java.lang.ObjectNSClientDataCollectionConfigFactory class.
- Author:
- Craig Miskell
-
-
Field Summary
Fields Modifier and Type Field Description protected static longm_lastModifiedTimestamp of the nsclient collection config, used to know when to reload from disk.
-
Constructor Summary
Constructors Constructor Description NSClientDataCollectionConfigFactory(java.lang.String configFile)Constructor for NSClientDataCollectionConfigFactory.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NSClientDataCollectionConfigFactorygetInstance()Singleton static call to get the only instance that should existNsclientCollectiongetNSClientCollection(java.lang.String collectionName)getNSClientCollectionjava.util.concurrent.locks.LockgetReadLock()java.util.List<java.lang.String>getRRAList(java.lang.String cName)getRRAListjava.lang.StringgetRrdPath()getRrdPathRrdRepositorygetRrdRepository(java.lang.String collectionName)getRrdRepositoryintgetStep(java.lang.String cName)getStepjava.util.concurrent.locks.LockgetWriteLock()static voidinit()Be sure to call this method before calling getInstance().voidreload()reloadstatic voidsetInstance(NSClientDataCollectionConfigFactory instance)setInstanceprotected voidupdateFromFile()Reload the nsclient-datacollection-config.xml file if it has been changed since we last read it.
-
-
-
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.FileNotFoundExceptionBe 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
-
setInstance
public static void setInstance(NSClientDataCollectionConfigFactory instance)
setInstance
- Parameters:
instance- aNSClientDataCollectionConfigFactoryobject.
-
reload
public void reload() throws java.io.IOException, java.io.FileNotFoundExceptionreload
- Throws:
java.io.IOException- if any.java.io.FileNotFoundException- if any.
-
getNSClientCollection
public NsclientCollection getNSClientCollection(java.lang.String collectionName)
getNSClientCollection
- Parameters:
collectionName- aStringobject.- Returns:
- a
org.opennms.netmgt.config.nsclient.NsclientCollectionobject.
-
getRrdRepository
public RrdRepository getRrdRepository(java.lang.String collectionName)
getRrdRepository
- Parameters:
collectionName- aStringobject.- Returns:
- a
RrdRepositoryobject.
-
getStep
public int getStep(java.lang.String cName)
getStep
- Parameters:
cName- aStringobject.- Returns:
- a int.
-
getRRAList
public java.util.List<java.lang.String> getRRAList(java.lang.String cName)
getRRAList
- Parameters:
cName- aStringobject.- Returns:
- a
Listobject.
-
getRrdPath
public java.lang.String getRrdPath()
getRrdPath
- Returns:
- a
Stringobject.
-
updateFromFile
protected void updateFromFile() throws java.io.IOExceptionReload the nsclient-datacollection-config.xml file if it has been changed since we last read it.- Throws:
java.io.IOException- if any.
-
-