Class BlacklistStore


@Component
public class BlacklistStore
extends DatabaseAwareBean
Read a blacklist from the database or write it to the database. This works with blacklists as a collection of records, not a serialised BLOB.

Arguably everything in here really ought to be in Blacklist itself, but that's necessarily in code that can't see into the database.

Author:
Donal Fellows
  • Constructor Details

  • Method Details

    • readBlacklist

      public Optional<Blacklist> readBlacklist​(int boardId)
      Read a blacklist from the database.
      Parameters:
      boardId - The ID of the board.
      Returns:
      The blacklist, if one is defined.
      Throws:
      DataAccessException - If database access fails.
    • writeBlacklist

      public void writeBlacklist​(int boardId, Blacklist blacklist)
      Save a blacklist in the database.
      Parameters:
      boardId - What board is this a blacklist for?
      blacklist - The blacklist to save.