Module watamebot

Class DataManager

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 Classes
    Modifier and Type
    Class
    Description
    static class 
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addGuild(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.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    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_JAVADOC
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    boolean
    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.
    void
    removeGuild(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.
    void
    retrieveDatabaseData(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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • connect

      public void connect() throws SQLException, UnsupportedOperationException, IOException
      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 occurs
      IOException - thrown if an error occurs while reading the InputStream of the resource
      UnsupportedOperationException - 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 - - Guild to be loaded
      Throws:
      NullPointerException - if guild is null
      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 - - Guild to be removed
      Throws:
      NullPointerException - if guild is null
      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.DatabaseLoadedEvent on the passed jda instance on completion.

      Parameters:
      jda - - JDA instance to use
    • getDataForGuild

      @Nullable public IGuildData getDataForGuild(@Nonnull net.dv8tion.jda.api.entities.Guild guild)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IGuildDataProvider
      NEED_JAVADOC
      Specified by:
      getDataForGuild in interface IGuildDataProvider
      Returns:
    • isReady

      public boolean isReady()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IGuildDataProvider
      Check if all guild data has been processed and is ready for use.
      Specified by:
      isReady in interface IGuildDataProvider
      Returns:
      Returns true when 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

      public void close() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception