Package org.opennms.netmgt.config
Class HttpCollectionConfigFactory
- java.lang.Object
-
- org.opennms.netmgt.config.HttpCollectionConfigFactory
-
public class HttpCollectionConfigFactory extends Object
HttpCollectionConfigFactory class.
- Version:
- $Id: $
- Author:
- David Hustace
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
initialized
Boolean indicating if the init() method has been called.protected static long
m_lastModified
Timestamp of the http collection config, used to know when to reload from disk.
-
Constructor Summary
Constructors Constructor Description HttpCollectionConfigFactory(InputStream stream)
Constructor for HttpCollectionConfigFactory.HttpCollectionConfigFactory(String configFile)
Constructor for HttpCollectionConfigFactory.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HttpDatacollectionConfig
getConfig()
getConfigHttpCollection
getHttpCollection(String collectionName)
getHttpCollectionstatic HttpCollectionConfigFactory
getInstance()
Singleton static call to get the only instance that should existList<String>
getRRAList(String cName)
getRRAListString
getRrdPath()
getRrdPathRrdRepository
getRrdRepository(String collectionName)
getRrdRepositoryint
getStep(String cName)
getStepstatic void
init()
Be sure to call this method before calling getInstance().void
reload()
reloadstatic void
setConfig(HttpDatacollectionConfig m_config)
setConfigstatic void
setInstance(HttpCollectionConfigFactory instance)
setInstanceprotected void
updateFromFile()
Reload the http-datacollection-config.xml file if it has been changed since we last read it.
-
-
-
Constructor Detail
-
HttpCollectionConfigFactory
public HttpCollectionConfigFactory(String configFile) throws IOException
Constructor for HttpCollectionConfigFactory.
- Parameters:
configFile
- aString
object.- Throws:
IOException
- if any.
-
HttpCollectionConfigFactory
public HttpCollectionConfigFactory(InputStream stream) throws IOException
Constructor for HttpCollectionConfigFactory.
- Parameters:
stream
- aInputStream
object.- Throws:
IOException
-
-
Method Detail
-
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 HttpCollectionConfigFactory 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(HttpCollectionConfigFactory instance)
setInstance
- Parameters:
instance
- aHttpCollectionConfigFactory
object.
-
reload
public void reload() throws IOException, FileNotFoundException
reload
- Throws:
IOException
- if any.FileNotFoundException
- if any.
-
updateFromFile
protected void updateFromFile() throws IOException
Reload the http-datacollection-config.xml file if it has been changed since we last read it.- Throws:
IOException
- if any.
-
getConfig
public static HttpDatacollectionConfig getConfig()
getConfig
- Returns:
- a
HttpDatacollectionConfig
object.
-
setConfig
public static void setConfig(HttpDatacollectionConfig m_config)
setConfig
- Parameters:
m_config
- aHttpDatacollectionConfig
object.
-
getHttpCollection
public HttpCollection getHttpCollection(String collectionName)
getHttpCollection
- Parameters:
collectionName
- aString
object.- Returns:
- a
HttpCollection
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.
-
-