org.opennms.netmgt.config
Class HttpCollectionConfigFactory

java.lang.Object
  extended by org.opennms.netmgt.config.HttpCollectionConfigFactory

public class HttpCollectionConfigFactory
extends Object

HttpCollectionConfigFactory class.

Version:
$Id: $
Author:
David Hustace

Field Summary
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
HttpCollectionConfigFactory(InputStream stream)
          Constructor for HttpCollectionConfigFactory.
HttpCollectionConfigFactory(Reader rdr)
          Deprecated. 
HttpCollectionConfigFactory(String configFile)
          Constructor for HttpCollectionConfigFactory.
 
Method Summary
static HttpDatacollectionConfig getConfig()
          getConfig
 HttpCollection getHttpCollection(String collectionName)
          getHttpCollection
static HttpCollectionConfigFactory getInstance()
          Singleton static call to get the only instance that should exist
 List<String> getRRAList(String cName)
          getRRAList
 String getRrdPath()
          getRrdPath
 RrdRepository getRrdRepository(String collectionName)
          getRrdRepository
 int getStep(String cName)
          getStep
static void init()
          Be sure to call this method before calling getInstance().
 void reload()
          reload
static void setConfig(HttpDatacollectionConfig m_config)
          setConfig
static void setInstance(HttpCollectionConfigFactory instance)
          setInstance
protected  void updateFromFile()
          Reload the http-datacollection-config.xml file if it has been changed since we last read it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

initialized

protected boolean initialized
Boolean indicating if the init() method has been called.


m_lastModified

protected static long m_lastModified
Timestamp of the http collection config, used to know when to reload from disk.

Constructor Detail

HttpCollectionConfigFactory

public HttpCollectionConfigFactory(String configFile)
                            throws org.exolab.castor.xml.MarshalException,
                                   org.exolab.castor.xml.ValidationException,
                                   IOException

Constructor for HttpCollectionConfigFactory.

Parameters:
configFile - a String object.
Throws:
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.
IOException - if any.

HttpCollectionConfigFactory

@Deprecated
public HttpCollectionConfigFactory(Reader rdr)
                            throws org.exolab.castor.xml.MarshalException,
                                   org.exolab.castor.xml.ValidationException
Deprecated. 

Constructor for HttpCollectionConfigFactory.

Parameters:
rdr - a Reader object.
Throws:
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.

HttpCollectionConfigFactory

public HttpCollectionConfigFactory(InputStream stream)
                            throws org.exolab.castor.xml.MarshalException,
                                   org.exolab.castor.xml.ValidationException

Constructor for HttpCollectionConfigFactory.

Parameters:
stream - a InputStream object.
Throws:
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.
Method Detail

init

public static void init()
                 throws IOException,
                        FileNotFoundException,
                        org.exolab.castor.xml.MarshalException,
                        org.exolab.castor.xml.ValidationException
Be sure to call this method before calling getInstance().

Throws:
IOException - if any.
FileNotFoundException - if any.
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - 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 - a HttpCollectionConfigFactory object.

reload

public void reload()
            throws IOException,
                   FileNotFoundException,
                   org.exolab.castor.xml.MarshalException,
                   org.exolab.castor.xml.ValidationException

reload

Throws:
IOException - if any.
FileNotFoundException - if any.
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.

updateFromFile

protected void updateFromFile()
                       throws IOException,
                              org.exolab.castor.xml.MarshalException,
                              org.exolab.castor.xml.ValidationException
Reload the http-datacollection-config.xml file if it has been changed since we last read it.

Throws:
IOException - if any.
org.exolab.castor.xml.MarshalException - if any.
org.exolab.castor.xml.ValidationException - if any.

getConfig

public static HttpDatacollectionConfig getConfig()

getConfig

Returns:
a HttpDatacollectionConfig object.

setConfig

public static void setConfig(HttpDatacollectionConfig m_config)

setConfig

Parameters:
m_config - a HttpDatacollectionConfig object.

getHttpCollection

public HttpCollection getHttpCollection(String collectionName)

getHttpCollection

Parameters:
collectionName - a String object.
Returns:
a HttpCollection object.

getRrdRepository

public RrdRepository getRrdRepository(String collectionName)

getRrdRepository

Parameters:
collectionName - a String object.
Returns:
a RrdRepository object.

getStep

public int getStep(String cName)

getStep

Parameters:
cName - a String object.
Returns:
a int.

getRRAList

public List<String> getRRAList(String cName)

getRRAList

Parameters:
cName - a String object.
Returns:
a List object.

getRrdPath

public String getRrdPath()

getRrdPath

Returns:
a String object.


Copyright © 2011. All Rights Reserved.