Interface PermissionStorage


public interface PermissionStorage
Interface defining the contract for permission data persistence.
  • Method Details

    • init

      void init()
      Initializes the storage backend (e.g., database connection).
    • loadGroups

      void loadGroups()
      Loads all defined groups into memory.
    • loadUser

      PermissionUser loadUser(UUID uuid)
      Loads a specific user from storage.
      Parameters:
      uuid - The UUID of the user.
      Returns:
      The loaded PermissionUser.
    • getUuidFromName

      UUID getUuidFromName(String name)
      Resolves a UUID from a stored username.
      Parameters:
      name - The username.
      Returns:
      The UUID, or null if not stored.
    • getKnownUsers

      Map<UUID,String> getKnownUsers()
      Gets a map of all known user UUIDs and names.
      Returns:
      The user map.
    • saveGroup

      void saveGroup(PermissionGroup group)
      Saves a group synchronously.
      Parameters:
      group - The group to save.
    • saveUser

      void saveUser(PermissionUser user)
      Saves a user synchronously.
      Parameters:
      user - The user to save.
    • saveGroupAsync

      void saveGroupAsync(PermissionGroup group)
      Saves a group asynchronously.
      Parameters:
      group - The group to save.
    • saveUserAsync

      void saveUserAsync(PermissionUser user)
      Saves a user asynchronously.
      Parameters:
      user - The user to save.
    • deleteGroup

      void deleteGroup(String id)
      Deletes a group synchronously.
      Parameters:
      id - The ID of the group.
    • deleteGroupAsync

      void deleteGroupAsync(String id)
      Deletes a group asynchronously.
      Parameters:
      id - The ID of the group.
    • shutdown

      void shutdown()
      Closes the storage backend.