Class DbManager
java.lang.Object
org.veupathdb.lib.container.jaxrs.utils.db.DbManager
Database Manager.
Handles the connection to DatabaseInstances and provides singleton access to them if needed.
-
Method Summary
Modifier and TypeMethodDescriptionstatic DatabaseInstance
Gets the current account database connection or throws an exception if the connection has not yet been established.static DatabaseInstance
Gets the current application database connection or throws an exception if the connection has not yet been established.Gets the current account database connection or throws an exception if the connection has not yet been established.Gets the current application database connection or throws an exception if the connection has not yet been established.static DbManager
Gets the current user database connection or throws an exception if the connection has not yet been established.static boolean
static boolean
static boolean
static DatabaseInstance
initAccountDatabase
(Options opts) Initialize a connection wrapper to the user account database.static DatabaseInstance
Initialize a connection wrapper to the user account database.static DatabaseInstance
initUserDatabase
(Options opts) Initialize a connection wrapper to the user account database.newAccountDatabase
(Options opts) newUserDatabase
(Options opts) static DatabaseInstance
Gets the current user database connection or throws an exception if the connection has not yet been established.
-
Method Details
-
getInstance
-
initAccountDatabase
Initialize a connection wrapper to the user account database.- Parameters:
opts
- Configuration options- Returns:
- the initialized DatabaseInstance
-
newAccountDatabase
-
getAccountDatabase
Gets the current account database connection or throws an exception if the connection has not yet been established. -
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
Initialize a connection wrapper to the user account database.- Parameters:
opts
- Configuration options- Returns:
- the initialized DatabaseInstance
-
newApplicationDatabase
-
getApplicationDatabase
Gets the current application database connection or throws an exception if the connection has not yet been established. -
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
Initialize a connection wrapper to the user account database.- Parameters:
opts
- Configuration options- Returns:
- the initialized DatabaseInstance
-
newUserDatabase
-
getUserDatabase
Gets the current user database connection or throws an exception if the connection has not yet been established. -
userDatabase
Gets the current user database connection or throws an exception if the connection has not yet been established. -
hasUserDatabase
public static boolean hasUserDatabase()
-