Interface PunishmentsApi


public interface PunishmentsApi
Reads and creates Plex punishments.
  • Method Details

    • indefiniteBans

      List<IndefiniteBanView> indefiniteBans()
      Returns current indefinite bans.
      Returns:
      current indefinite bans
    • indefiniteBanByUuid

      Optional<IndefiniteBanView> indefiniteBanByUuid(UUID uuid)
      Looks up an indefinite ban by UUID.
      Parameters:
      uuid - UUID to look up
      Returns:
      matching indefinite ban, if one exists
    • indefiniteBanByName

      Optional<IndefiniteBanView> indefiniteBanByName(String name)
      Finds an indefinite ban by player name.
      Parameters:
      name - player name
      Returns:
      matching ban, if one exists
    • indefiniteBanByIp

      Optional<IndefiniteBanView> indefiniteBanByIp(String ip)
      Finds an indefinite ban by IP address.
      Parameters:
      ip - IP address
      Returns:
      matching ban, if one exists
    • isBanned

      CompletableFuture<Boolean> isBanned(UUID uuid)
      Checks if a player has an active ban.
      Parameters:
      uuid - player UUID
      Returns:
      result of the check
    • isBanned

      CompletableFuture<Boolean> isBanned(UUID uuid, @Nullable @Nullable String ip)
      Checks whether a player has an active UUID or current IP ban.
      Parameters:
      uuid - player UUID
      ip - current player IP, or null to check only the UUID
      Returns:
      result of the check
    • unban

      Removes active bans for a player.
      Parameters:
      uuid - player UUID
      Returns:
      future containing whether an active ban was removed
    • punish

      Applies a punishment to a player.
      Parameters:
      punishment - punishment details
      Returns:
      result that completes when storage is updated
      Throws:
      NullPointerException - if the request is null