Class DatabaseChecker


  • public class DatabaseChecker
    extends java.lang.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​(java.lang.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​(java.lang.String[] argv)
      main
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DatabaseChecker

        protected DatabaseChecker​(java.lang.String configFile)
                           throws java.io.IOException,
                                  java.lang.ClassNotFoundException
        Protected constructor
        Parameters:
        configFile - a String object.
        Throws:
        java.io.IOException - Thrown if the specified config file cannot be read
        java.io.IOException - if any.
        java.lang.ClassNotFoundException - if any.
      • DatabaseChecker

        protected DatabaseChecker()
                           throws java.io.IOException,
                                  java.lang.ClassNotFoundException
        Load the config from the default config file and create the singleton instance of this factory.
        Throws:
        java.io.IOException - Thrown if the specified config file cannot be read
        java.io.IOException - if any.
        java.lang.ClassNotFoundException - if any.