Class DbManager

java.lang.Object
org.veupathdb.lib.container.jaxrs.utils.db.DbManager

public class DbManager extends Object
Database Manager.

Handles the connection to DatabaseInstances and provides singleton access to them if needed.

  • Method Details

    • getInstance

      public static DbManager getInstance()
    • initAccountDatabase

      public static DatabaseInstance initAccountDatabase(Options opts)
      Initialize a connection wrapper to the user account database.
      Parameters:
      opts - Configuration options
      Returns:
      the initialized DatabaseInstance
    • newAccountDatabase

      public DatabaseInstance newAccountDatabase(Options opts)
    • getAccountDatabase

      public DatabaseInstance getAccountDatabase()
      Gets the current account database connection or throws an exception if the connection has not yet been established.
    • accountDatabase

      public static DatabaseInstance accountDatabase()
      Gets the current account database connection or throws an exception if the connection has not yet been established.
    • hasAccountDatabase

      public static boolean hasAccountDatabase()
    • initApplicationDatabase

      public static DatabaseInstance initApplicationDatabase(Options opts)
      Initialize a connection wrapper to the user account database.
      Parameters:
      opts - Configuration options
      Returns:
      the initialized DatabaseInstance
    • newApplicationDatabase

      public DatabaseInstance newApplicationDatabase(Options opts)
    • getApplicationDatabase

      public DatabaseInstance getApplicationDatabase()
      Gets the current application database connection or throws an exception if the connection has not yet been established.
    • applicationDatabase

      public static DatabaseInstance applicationDatabase()
      Gets the current application database connection or throws an exception if the connection has not yet been established.
    • hasApplicationDatabase

      public static boolean hasApplicationDatabase()
    • initUserDatabase

      public static DatabaseInstance initUserDatabase(Options opts)
      Initialize a connection wrapper to the user account database.
      Parameters:
      opts - Configuration options
      Returns:
      the initialized DatabaseInstance
    • newUserDatabase

      public DatabaseInstance newUserDatabase(Options opts)
    • getUserDatabase

      public DatabaseInstance getUserDatabase()
      Gets the current user database connection or throws an exception if the connection has not yet been established.
    • userDatabase

      public static DatabaseInstance userDatabase()
      Gets the current user database connection or throws an exception if the connection has not yet been established.
    • hasUserDatabase

      public static boolean hasUserDatabase()