@Singleton public abstract class DBSystem extends java.lang.Object implements SubSystem
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<Database> |
databases |
protected Database |
db |
protected Locale |
locale |
protected com.djrapitops.plugin.logging.console.PluginLogger |
logger |
Constructor and Description |
---|
DBSystem(Locale locale,
SQLiteDB.Factory sqLiteDB,
H2DB.Factory h2Factory,
com.djrapitops.plugin.logging.console.PluginLogger logger) |
Modifier and Type | Method and Description |
---|---|
void |
disable()
Performs disable actions for the subsystem
|
void |
enable()
Performs enable actions for the subsystem.
|
Database |
getActiveDatabaseByName(java.lang.String dbName) |
Database |
getActiveDatabaseByType(DBType type) |
Database |
getDatabase() |
java.util.Set<Database> |
getDatabases() |
H2DB.Factory |
getH2Factory() |
SQLiteDB.Factory |
getSqLiteFactory() |
void |
setActiveDatabase(Database db) |
protected final Locale locale
protected final com.djrapitops.plugin.logging.console.PluginLogger logger
protected Database db
protected final java.util.Set<Database> databases
public DBSystem(Locale locale, SQLiteDB.Factory sqLiteDB, H2DB.Factory h2Factory, com.djrapitops.plugin.logging.console.PluginLogger logger)
public Database getActiveDatabaseByName(java.lang.String dbName)
public java.util.Set<Database> getDatabases()
public void disable()
SubSystem
public Database getDatabase()
public void enable() throws EnableException
SubSystem
enable
in interface SubSystem
EnableException
- If an error occurred during enable and it is fatal to the subsystem.public void setActiveDatabase(Database db)
public SQLiteDB.Factory getSqLiteFactory()
public H2DB.Factory getH2Factory()