Class NSClientDataCollectionConfigFactory
- java.lang.Object
-
- org.opennms.protocols.nsclient.config.NSClientDataCollectionConfigFactory
-
public class NSClientDataCollectionConfigFactory extends Object
NSClientDataCollectionConfigFactory class.
- Author:
- Craig Miskell
-
-
Field Summary
Fields Modifier and Type Field Description protected static long
m_lastModified
Timestamp of the nsclient collection config, used to know when to reload from disk.
-
Constructor Summary
Constructors Constructor Description NSClientDataCollectionConfigFactory(String configFile)
Constructor for NSClientDataCollectionConfigFactory.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NSClientDataCollectionConfigFactory
getInstance()
Singleton static call to get the only instance that should existNsclientCollection
getNSClientCollection(String collectionName)
getNSClientCollectionLock
getReadLock()
List<String>
getRRAList(String cName)
getRRAListString
getRrdPath()
getRrdPathRrdRepository
getRrdRepository(String collectionName)
getRrdRepositoryint
getStep(String cName)
getStepLock
getWriteLock()
static void
init()
Be sure to call this method before calling getInstance().void
reload()
reloadstatic void
setInstance(NSClientDataCollectionConfigFactory instance)
setInstanceprotected void
updateFromFile()
Reload the nsclient-datacollection-config.xml file if it has been changed since we last read it.
-
-
-
Constructor Detail
-
NSClientDataCollectionConfigFactory
public NSClientDataCollectionConfigFactory(String configFile) throws IOException
Constructor for NSClientDataCollectionConfigFactory.
- Parameters:
configFile
- aString
object.- Throws:
IOException
- if any.
-
-
Method Detail
-
getReadLock
public Lock getReadLock()
-
getWriteLock
public Lock getWriteLock()
-
init
public static void init() throws IOException, FileNotFoundException
Be sure to call this method before calling getInstance().- Throws:
IOException
- if any.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:
IllegalStateException
- if init has not been called
-
setInstance
public static void setInstance(NSClientDataCollectionConfigFactory instance)
setInstance
- Parameters:
instance
- aNSClientDataCollectionConfigFactory
object.
-
reload
public void reload() throws IOException, FileNotFoundException
reload
- Throws:
IOException
- if any.FileNotFoundException
- if any.
-
getNSClientCollection
public NsclientCollection getNSClientCollection(String collectionName)
getNSClientCollection
- Parameters:
collectionName
- aString
object.- Returns:
- a
org.opennms.netmgt.config.nsclient.NsclientCollection
object.
-
getRrdRepository
public RrdRepository getRrdRepository(String collectionName)
getRrdRepository
- Parameters:
collectionName
- aString
object.- Returns:
- a
RrdRepository
object.
-
getStep
public int getStep(String cName)
getStep
- Parameters:
cName
- aString
object.- Returns:
- a int.
-
updateFromFile
protected void updateFromFile() throws IOException
Reload the nsclient-datacollection-config.xml file if it has been changed since we last read it.- Throws:
IOException
- if any.
-
-