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 booleaninitializedBoolean indicating if the init() method has been called.protected static longm_lastModifiedTimestamp 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 HttpDatacollectionConfiggetConfig()getConfigHttpCollectiongetHttpCollection(String collectionName)getHttpCollectionstatic HttpCollectionConfigFactorygetInstance()Singleton static call to get the only instance that should existList<String>getRRAList(String cName)getRRAListStringgetRrdPath()getRrdPathRrdRepositorygetRrdRepository(String collectionName)getRrdRepositoryintgetStep(String cName)getStepstatic voidinit()Be sure to call this method before calling getInstance().voidreload()reloadstatic voidsetConfig(HttpDatacollectionConfig m_config)setConfigstatic voidsetInstance(HttpCollectionConfigFactory instance)setInstanceprotected voidupdateFromFile()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- aStringobject.- Throws:
IOException- if any.
-
HttpCollectionConfigFactory
public HttpCollectionConfigFactory(InputStream stream) throws IOException
Constructor for HttpCollectionConfigFactory.
- Parameters:
stream- aInputStreamobject.- Throws:
IOException
-
-
Method Detail
-
init
public static void init() throws IOException, FileNotFoundExceptionBe 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- aHttpCollectionConfigFactoryobject.
-
reload
public void reload() throws IOException, FileNotFoundExceptionreload
- Throws:
IOException- if any.FileNotFoundException- if any.
-
updateFromFile
protected void updateFromFile() throws IOExceptionReload 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
HttpDatacollectionConfigobject.
-
setConfig
public static void setConfig(HttpDatacollectionConfig m_config)
setConfig
- Parameters:
m_config- aHttpDatacollectionConfigobject.
-
getHttpCollection
public HttpCollection getHttpCollection(String collectionName)
getHttpCollection
- Parameters:
collectionName- aStringobject.- Returns:
- a
HttpCollectionobject.
-
getRrdRepository
public RrdRepository getRrdRepository(String collectionName)
getRrdRepository
- Parameters:
collectionName- aStringobject.- Returns:
- a
RrdRepositoryobject.
-
getStep
public int getStep(String cName)
getStep
- Parameters:
cName- aStringobject.- Returns:
- a int.
-
-