Class NSClientDataCollectionConfigFactory
- java.lang.Object
-
- org.opennms.protocols.nsclient.config.NSClientDataCollectionConfigFactory
-
public class NSClientDataCollectionConfigFactory extends java.lang.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(java.lang.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(java.lang.String collectionName)
getNSClientCollectionjava.util.concurrent.locks.Lock
getReadLock()
java.util.List<java.lang.String>
getRRAList(java.lang.String cName)
getRRAListjava.lang.String
getRrdPath()
getRrdPathRrdRepository
getRrdRepository(java.lang.String collectionName)
getRrdRepositoryint
getStep(java.lang.String cName)
getStepjava.util.concurrent.locks.Lock
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.
-
-
-
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
-
setInstance
public static void setInstance(NSClientDataCollectionConfigFactory instance)
setInstance
- Parameters:
instance
- aNSClientDataCollectionConfigFactory
object.
-
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
- aString
object.- Returns:
- a
org.opennms.netmgt.config.nsclient.NsclientCollection
object.
-
getRrdRepository
public RrdRepository getRrdRepository(java.lang.String collectionName)
getRrdRepository
- Parameters:
collectionName
- aString
object.- Returns:
- a
RrdRepository
object.
-
getStep
public int getStep(java.lang.String cName)
getStep
- Parameters:
cName
- aString
object.- Returns:
- a int.
-
getRRAList
public java.util.List<java.lang.String> getRRAList(java.lang.String cName)
getRRAList
- Parameters:
cName
- aString
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.
-
-