Interface ModerationSQL

All Superinterfaces:
SQL

public interface ModerationSQL extends SQL
SQL interface for moderation data operations in FlectonePulse. Defines database queries for managing player moderation's.
Since:
0.9.0
  • Method Details

    • findValidByPlayerAndType

      List<Moderation> findValidByPlayerAndType(int playerId, String type, long currentTime, String server, int limit, int offset)
      Finds valid (non-expired) moderations for a specific player and type with pagination support. Results are ordered by ID in descending order.
      Parameters:
      playerId - the player ID to search moderations for
      type - the moderation type to filter by
      currentTime - the current timestamp used to check expiration status
      server - the server ID (can be null for global search)
      limit - maximum number of results to return
      offset - number of results to skip for pagination
      Returns:
      list of valid moderations matching the criteria
    • findValidByType

      List<Moderation> findValidByType(String type, long currentTime, String server, int limit, int offset)
      Finds valid (non-expired) moderations by type across all players with pagination support. Results are ordered by ID in descending order.
      Parameters:
      type - the moderation type to filter by
      currentTime - the current timestamp used to check expiration status
      server - the server ID (can be null for global search)
      limit - maximum number of results to return
      offset - number of results to skip for pagination
      Returns:
      list of valid moderations matching the criteria
    • findValidById

      Optional<Moderation> findValidById(long currentTime, String server, int id)
      Finds a single valid moderation entry by its unique identifier. Checks that the moderation is valid and not expired, optionally filtered by server.
      Parameters:
      currentTime - the current timestamp used to check expiration status
      server - the server ID (can be null for global search)
      id - the unique moderation entry identifier
      Returns:
      an Optional containing the moderation if found and valid, or empty otherwise
    • findValidPlayerNamesByType

      List<String> findValidPlayerNamesByType(String type, long currentTime, String server)
      Finds player names with valid moderation's by type.
      Parameters:
      type - the moderation type
      currentTime - the current timestamp for expiration check
      server - the server ID
      Returns:
      list of player names
    • getTotalValidCountByPlayerAndType

      int getTotalValidCountByPlayerAndType(int playerId, String type, long currentTime, String server)
      Counts the total number of valid moderations for a specific player and type. Only includes non-expired moderations and can be filtered by server.
      Parameters:
      playerId - the player ID to count moderations for
      type - the moderation type to filter by
      currentTime - the current timestamp used to check expiration status
      server - the server ID (can be null for global count)
      Returns:
      the count of valid moderations matching the criteria
    • getTotalValidCountByType

      int getTotalValidCountByType(String type, long currentTime, String server)
      Counts the total number of valid moderations by type across all players. Only includes non-expired moderations and can be filtered by server.
      Parameters:
      type - the moderation type to filter by
      currentTime - the current timestamp used to check expiration status
      server - the server ID (can be null for global count)
      Returns:
      the count of valid moderations matching the criteria
    • insert

      int insert(int playerId, long date, long time, String reason, int moderatorId, String type, String server)
      Inserts a new moderation.
      Parameters:
      playerId - the player ID
      date - the timestamp when the moderation was applied
      time - the expiration timestamp (-1 for permanent)
      reason - the moderation reason
      moderatorId - the ID of the moderator
      type - the moderation type
      server - the server ID
      Returns:
      the generated moderation ID
    • invalidate

      void invalidate(int id, String server)
      Invalidates a specific moderation entry by its ID. Sets the valid flag to false, effectively removing it from active moderation lists.
      Parameters:
      id - the unique moderation entry identifier
      server - the server ID (can be null for global invalidation)
    • invalidate

      void invalidate(int playerId, String type, String server)
      Invalidates all moderations of a specific type for player. Sets the valid flag to false for all matching entries, optionally filtered by server.
      Parameters:
      playerId - the player ID
      type - the moderation type to invalidate
      server - the server ID (can be null for global invalidation)