Package org.opennms.netmgt.vmmgr
Class DatabaseChecker
- java.lang.Object
-
- org.opennms.netmgt.vmmgr.DatabaseChecker
-
public class DatabaseChecker extends Object
This is the singleton class used to load the OpenNMS database configuration from the opennms-database.xml. This provides convenience methods to create database connections to the database configured in this default xml
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
- Author:
- Brian Weaver
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DatabaseChecker()
Load the config from the default config file and create the singleton instance of this factory.protected
DatabaseChecker(String configFile)
Protected constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
check()
Check whether the data sources in opennms-datasources.xml are valid.static void
main(String[] argv)
main
-
-
-
Constructor Detail
-
DatabaseChecker
protected DatabaseChecker(String configFile) throws IOException, ClassNotFoundException
Protected constructor- Parameters:
configFile
- aString
object.- Throws:
IOException
- Thrown if the specified config file cannot be readIOException
- if any.ClassNotFoundException
- if any.
-
DatabaseChecker
protected DatabaseChecker() throws IOException, ClassNotFoundException
Load the config from the default config file and create the singleton instance of this factory.- Throws:
IOException
- Thrown if the specified config file cannot be readIOException
- if any.ClassNotFoundException
- if any.
-
-
Method Detail
-
check
public void check() throws MissingDataSourceException, InvalidDataSourceException
Check whether the data sources in opennms-datasources.xml are valid.
- Throws:
MissingDataSourceException
- A required data source was not found in opennms-datasources.xml.InvalidDataSourceException
- A required data source could not be connected to.
-
-