Klasse PlayerNotificationRepository
java.lang.Object
de.delinkedde.areashopreborn.persistence.PlayerNotificationRepository
Stores idempotent player notifications until a successful in-game delivery.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic final recordImmutable queued notification row. -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungPlayerNotificationRepository(Database database) Creates the notification repository. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanEnqueues a notification once for a stable business-event key.findPending(UUID recipientId, int limit) Finds the oldest pending notifications for one player.voidmarkDelivered(List<Long> ids, Instant deliveredAt) Marks successfully sent rows as delivered in one transaction.
-
Konstruktordetails
-
PlayerNotificationRepository
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 UUIDdeduplicationKey- stable unique event keymessage- bounded plain messagecreatedAt- 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 UUIDlimit- maximum returned rows- Gibt zurück:
- immutable pending rows
- Löst aus:
SQLException- when persistence fails
-
markDelivered
Marks successfully sent rows as delivered in one transaction.- Parameter:
ids- notification row identifiersdeliveredAt- successful delivery timestamp- Löst aus:
SQLException- when persistence fails
-