Module watamebot

Class DataManager

java.lang.Object
net.foxgenesis.watame.sql.DataManager
All Implemented Interfaces:
AutoCloseable, IDatabaseManager

public class DataManager extends Object implements IDatabaseManager, AutoCloseable
Class to connect and retrieve data from a database
Author:
Ashley
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new instance using the default database folder of "./repo/".
    DataManager(File folder)
    Create a new instance using the specified folder as the repository folder.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addGuild(net.dv8tion.jda.api.entities.Guild guild)
    Register a guild to be loaded during data retrieval.
    void
     
    void
    Attempt to connect to the database.
    getDataForGuild(net.dv8tion.jda.api.entities.Guild guild)
    NEED_JAVADOC
    boolean
    Check if the database is connected and is ready for operations.
    boolean
    Check if all guild data has been processed and is ready for use.
    void
    removeGuild(net.dv8tion.jda.api.entities.Guild guild)
    Remove a guild from the data manager.
    void
    retrieveDatabaseData(net.dv8tion.jda.api.JDA jda)
    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
  • Constructor Details

    • DataManager

      public DataManager()
      Create a new instance using the default database folder of "./repo/".

      This method is effectively equivalent to:

       new DataManager(new File("repo"))
       
      Throws:
      IllegalArgumentException - if folder exists and is not a directory
      See Also:
    • DataManager

      public DataManager(@Nonnull File folder)
      Create a new instance using the specified folder as the repository folder.
      Parameters:
      folder - - File that will be used as the repository folder
      Throws:
      IllegalArgumentException - if folder exists and is not a directory
      NullPointerException - if folder is null
      See Also:
  • Method Details