Class HyperDatabase

  • public class HyperDatabase
    extends Object
    Class containing the database connection that is used throughout the plugin
    • Constructor Detail

      • HyperDatabase

        public HyperDatabase​(co.aikar.taskchain.TaskChainFactory taskChainFactory,
                             Hyperverse hyperverse)
    • Method Detail

      • attemptConnect

        public boolean attemptConnect()
        Attempt to connect to the database
        True if the connection was successful, false if not
      • attemptClose

        public void attemptClose()
        Attempt to close the connection
      • storeLocation

        public void storeLocation​(@NotNull
                                  @NotNull PersistentLocation persistentLocation,
                                  boolean updateTable,
                                  boolean clear)
        Store the location in the database
        persistentLocation - Location to store
        updateTable - Whether or not the internal table should be updated
      • clearLocations

        public void clearLocations​(@NotNull
                                   @NotNull UUID uuid)
        Remove all stored locations for a specific UUID
        uuid - Player UUID
      • getLocations

        public Future<Collection<PersistentLocation>> getLocations​(@NotNull
                                                                   @NotNull UUID uuid)
        Query for locations for a given UUID
        uuid - Player UUID
        Future that will complete with the locations
      • getLocation

        public @NotNull Optional<PersistentLocation> getLocation​(@NotNull
                                                                 @NotNull UUID uuid,
                                                                 @NotNull String world)
        Get a stored persistent location for a given UUID and world
        uuid - Player UUID
        world - World
        Optional containing the location, if it was stored
      • clearWorld

        public void clearWorld​(@NotNull
                               @NotNull String worldName)
        Clear all references to a world from the database
        worldName - World to remove