java.lang.Object
net.foxgenesis.database.DatabaseManager
- All Implemented Interfaces:
AutoCloseable,IDatabaseManager
NEED_JAVADOC
- Author:
- Ashley
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()@NotNull StringgetName()Get the name of this instance.booleanisDatabaseRegistered(AbstractDatabase database) Check if anAbstractDatabaseis registered in this manager.booleanisReady()Check if all guild data has been processed and is ready for use.booleanregister(@NotNull Plugin plugin, @NotNull AbstractDatabase database) Register anAbstractDatabasethat aPluginrequires.voidstart(@NotNull AConnectionProvider provider) start(@NotNull AConnectionProvider provider, Executor executor) booleanNEED_JAVADOC
-
Field Details
-
logger
@NotNull protected final @NotNull org.slf4j.Logger logger
-
-
Constructor Details
-
DatabaseManager
NEED_JAVADOC- Parameters:
name-
-
-
Method Details
-
register
public boolean register(@NotNull @NotNull Plugin plugin, @NotNull @NotNull AbstractDatabase database) throws IOException Description copied from interface:IDatabaseManagerRegister anAbstractDatabasethat aPluginrequires.- Specified by:
registerin interfaceIDatabaseManager- Parameters:
plugin- - owner of the instancedatabase- - database to register- Returns:
- Returns
trueif the database was registered.falseotherwise. - Throws:
IOException- Thrown if there was an error while reading database setup files
-
unload
NEED_JAVADOC- Parameters:
owner-- Returns:
- Returns
trueif all databases from theownerhave been unloaded.falseotherwise
-
isDatabaseRegistered
Description copied from interface:IDatabaseManagerCheck if anAbstractDatabaseis registered in this manager.- Specified by:
isDatabaseRegisteredin interfaceIDatabaseManager- Parameters:
database- - the database to check if it exists- Returns:
- Returns
trueif the database is registered,falseotherwise.
-
start
public CompletableFuture<Void> start(@NotNull @NotNull AConnectionProvider provider, Executor executor) -
start
-
isReady
public boolean isReady()Description copied from interface:IDatabaseManagerCheck if all guild data has been processed and is ready for use.- Specified by:
isReadyin interfaceIDatabaseManager- Returns:
- Returns
truewhen all data has been loaded from the database
-
getName
Description copied from interface:IDatabaseManagerGet the name of this instance.- Specified by:
getNamein interfaceIDatabaseManager- Returns:
- Returns the name of this instance.
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-