Klasse PlayerNotificationRepository

java.lang.Object
de.delinkedde.areashopreborn.persistence.PlayerNotificationRepository

public final class PlayerNotificationRepository extends Object
Stores idempotent player notifications until a successful in-game delivery.
  • Konstruktordetails

    • PlayerNotificationRepository

      public PlayerNotificationRepository(Database database)
      Creates the notification repository.
      Parameter:
      database - database owner
  • Methodendetails

    • enqueue

      public boolean enqueue(UUID recipientId, String deduplicationKey, String message, Instant createdAt) throws SQLException
      Enqueues a notification once for a stable business-event key.
      Parameter:
      recipientId - recipient UUID
      deduplicationKey - stable unique event key
      message - bounded plain message
      createdAt - creation timestamp
      Gibt zurück:
      whether a new row was inserted
      Löst aus:
      SQLException - when persistence fails
    • findPending

      public List<PlayerNotificationRepository.PendingNotification> findPending(UUID recipientId, int limit) throws SQLException
      Finds the oldest pending notifications for one player.
      Parameter:
      recipientId - recipient UUID
      limit - maximum returned rows
      Gibt zurück:
      immutable pending rows
      Löst aus:
      SQLException - when persistence fails
    • markDelivered

      public void markDelivered(List<Long> ids, Instant deliveredAt) throws SQLException
      Marks successfully sent rows as delivered in one transaction.
      Parameter:
      ids - notification row identifiers
      deliveredAt - successful delivery timestamp
      Löst aus:
      SQLException - when persistence fails