|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.config.CollectdConfigFactory
public class CollectdConfigFactory
This is the singleton class used to load the configuration for the OpenNMS Collection Daemon from the collectd-configuration xml file. A mapping of the configured URLs to the iplist they contain is built at init() time so as to avoid numerous file reads. Note: Users of this class should make sure the init() is called before calling any other method to ensure the config is loaded before accessing other convenience methods.
| Constructor Summary | |
|---|---|
CollectdConfigFactory(java.io.Reader rdr,
java.lang.String localServer,
boolean verifyServer)
Public constructor |
|
| Method Summary | |
|---|---|
boolean |
domainExists(java.lang.String name)
Returns true if collection domain exists |
CollectdConfig |
getCollectdConfig()
|
static CollectdConfigFactory |
getInstance()
Return the singleton instance of this factory. |
CollectdPackage |
getPackage(java.lang.String name)
|
static void |
init()
Load the config from the default config file and create the singleton instance of this factory. |
boolean |
isServiceCollectionEnabled(java.lang.String ipAddr,
java.lang.String svcName)
Returns true if the specified interface is included by at least one package which has the specified service and that service is enabled (set to "on"). |
boolean |
packageExists(java.lang.String name)
Returns true if collection package exists |
void |
rebuildPackageIpListMap()
This method is used to rebuild the package agaist iplist mapping when needed. |
static void |
reload()
Reload the config from the default config file |
void |
saveCurrent()
Saves the current in-memory configuration to disk and reloads |
static void |
setInstance(CollectdConfigFactory instance)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CollectdConfigFactory(java.io.Reader rdr,
java.lang.String localServer,
boolean verifyServer)
throws java.io.IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
java.io.IOException - Thrown if the specified config file cannot be read
org.exolab.castor.xml.MarshalException - Thrown if the file does not conform to the schema.
org.exolab.castor.xml.ValidationException - Thrown if the contents do not match the required schema.| Method Detail |
|---|
public void rebuildPackageIpListMap()
public static void init()
throws java.io.IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
java.io.IOException - Thrown if the specified config file cannot be read
org.exolab.castor.xml.MarshalException - Thrown if the file does not conform to the schema.
org.exolab.castor.xml.ValidationException - Thrown if the contents do not match the required schema.
public static void reload()
throws java.io.IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
java.io.IOException - Thrown if the specified config file cannot be read/loaded
org.exolab.castor.xml.MarshalException - Thrown if the file does not conform to the schema.
org.exolab.castor.xml.ValidationException - Thrown if the contents do not match the required schema.
public void saveCurrent()
throws org.exolab.castor.xml.MarshalException,
java.io.IOException,
org.exolab.castor.xml.ValidationException
org.exolab.castor.xml.MarshalException
java.io.IOException
org.exolab.castor.xml.ValidationExceptionpublic static CollectdConfigFactory getInstance()
java.lang.IllegalStateException - Thrown if the factory has not yet been initialized.public static void setInstance(CollectdConfigFactory instance)
public CollectdConfig getCollectdConfig()
public CollectdPackage getPackage(java.lang.String name)
public boolean packageExists(java.lang.String name)
name - The package name to check
public boolean domainExists(java.lang.String name)
name - The domain name to check
public boolean isServiceCollectionEnabled(java.lang.String ipAddr,
java.lang.String svcName)
ipAddr - IP address of the interface to lookupsvcName - The service name to lookup
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||