java.lang.Object
net.foxgenesis.watame.sql.DataManager
- All Implemented Interfaces:
AutoCloseable,IGuildDataProvider
@Deprecated(forRemoval=true)
public class DataManager
extends Object
implements IGuildDataProvider, AutoCloseable
Deprecated, for removal: This API element is subject to removal in a future version.
Class to connect and retrieve data from a database
- Author:
- Ashley
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGuild(net.dv8tion.jda.api.entities.Guild guild) Deprecated, for removal: This API element is subject to removal in a future version.Register a guild to be loaded during data retrieval.voidclose()Deprecated, for removal: This API element is subject to removal in a future version.voidconnect()Deprecated, for removal: This API element is subject to removal in a future version.Attempt to connect to the database.getDataForGuild(net.dv8tion.jda.api.entities.Guild guild) Deprecated, for removal: This API element is subject to removal in a future version.NEED_JAVADOCbooleanDeprecated, for removal: This API element is subject to removal in a future version.booleanisReady()Deprecated, for removal: This API element is subject to removal in a future version.Check if all guild data has been processed and is ready for use.voidremoveGuild(net.dv8tion.jda.api.entities.Guild guild) Deprecated, for removal: This API element is subject to removal in a future version.Remove a guild from the data manager.voidretrieveDatabaseData(net.dv8tion.jda.api.JDA jda) Deprecated, for removal: This API element is subject to removal in a future version.Retrieve all data needed from the database.
-
Method Details
-
connect
Deprecated, for removal: This API element is subject to removal in a future version.Attempt to connect to the database.- Throws:
SQLException- if a database access error occursIOException- thrown if an error occurs while reading the InputStream of the resourceUnsupportedOperationException- if connection to the database failed
-
addGuild
public void addGuild(@Nonnull net.dv8tion.jda.api.entities.Guild guild) Deprecated, for removal: This API element is subject to removal in a future version.Register a guild to be loaded during data retrieval.- Parameters:
guild- -Guildto be loaded- Throws:
NullPointerException- ifguildisnull- See Also:
-
removeGuild
public void removeGuild(@Nonnull net.dv8tion.jda.api.entities.Guild guild) Deprecated, for removal: This API element is subject to removal in a future version.Remove a guild from the data manager.- Parameters:
guild- -Guildto be removed- Throws:
NullPointerException- ifguildisnull- See Also:
-
retrieveDatabaseData
public void retrieveDatabaseData(@Nonnull net.dv8tion.jda.api.JDA jda) Deprecated, for removal: This API element is subject to removal in a future version.Retrieve all data needed from the database.This will fire a
DataManager.DatabaseLoadedEventon the passedjdainstance on completion.- Parameters:
jda- -JDAinstance to use
-
getDataForGuild
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IGuildDataProviderNEED_JAVADOC- Specified by:
getDataForGuildin interfaceIGuildDataProvider- Returns:
-
isReady
public boolean isReady()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IGuildDataProviderCheck if all guild data has been processed and is ready for use.- Specified by:
isReadyin interfaceIGuildDataProvider- Returns:
- Returns
truewhen all data has been loaded from the database
-
isConnectionValid
public boolean isConnectionValid()Deprecated, for removal: This API element is subject to removal in a future version. -
close
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-