DatabaseManager

public interface DatabaseManager

Sealed interface for database management.

Inheritors

Types

Link copied to clipboard
public final class ExpiredGrant extends Record
Simple record representing an expired grant entry.

Functions

Link copied to clipboard
public abstract void close()
Closes the database connection.
Link copied to clipboard
@NotNull()
public abstract @NotNull() CompletableFuture<Optional<String>> getActiveSkin(@NotNull() @NotNull() UUID playerUuid, @NotNull() @NotNull() Material material)
Gets the active skin for a specific item type.
Link copied to clipboard
Retrieves all grants that have expired (expires_at is not null and <= now).
Link copied to clipboard
@NotNull()
public abstract @NotNull() CompletableFuture<Collection<SkinGrant>> getGrants(@NotNull() @NotNull() UUID playerUuid)
Gets all skin grants for a player.
Link copied to clipboard
@NotNull()
public abstract @NotNull() CompletableFuture<Void> grantSkin(@NotNull() @NotNull() UUID playerUuid, @NotNull() @NotNull() String skinId, @NotNull() @NotNull() String source)
Grants a skin to a player.
Link copied to clipboard
@NotNull()
public abstract @NotNull() CompletableFuture<Void> grantSkinWithExpiry(@NotNull() @NotNull() UUID playerUuid, @NotNull() @NotNull() String skinId, @NotNull() @NotNull() String source, @Nullable() @Nullable() LocalDateTime expiresAt)
Grants a skin with an optional expiration date.
Link copied to clipboard
public abstract void init()
Initializes the database connection and creates tables.
Link copied to clipboard
public abstract void logAction(@NotNull() @NotNull() UUID playerUuid, @NotNull() @NotNull() String action, @NotNull() @NotNull() String target, @Nullable() @Nullable() String metadata)
Logs an action to the database.
Link copied to clipboard
@NotNull()
public abstract @NotNull() CompletableFuture<Void> migrateSkinId(String oldSkinId, @NotNull() @NotNull() String newSkinId)
Link copied to clipboard
@NotNull()
public abstract @NotNull() CompletableFuture<Void> revokeSkin(@NotNull() @NotNull() UUID playerUuid, @NotNull() @NotNull() String skinId)
Revokes a skin from a player.
Link copied to clipboard
@NotNull()
public abstract @NotNull() CompletableFuture<Void> setActiveSkin(@NotNull() @NotNull() UUID playerUuid, @NotNull() @NotNull() Material material, @Nullable() @Nullable() String skinId)
Sets the active skin for a specific item type.