Klasse PlayerNotificationService

java.lang.Object
de.delinkedde.areashopreborn.application.PlayerNotificationService
Alle implementierten Schnittstellen:
org.bukkit.event.Listener

public final class PlayerNotificationService extends Object implements org.bukkit.event.Listener
Persists important estate activity and delivers it immediately or on the next player join.
  • Konstruktordetails

    • PlayerNotificationService

      public PlayerNotificationService(Database database, PlayerNotificationRepository notifications, ThreadBridge threads, MessageService messages, EconomyGateway economy, Logger logger, int deliveryBatchSize)
      Creates a persistent notification service using the system UTC clock.
      Parameter:
      database - asynchronous database executor
      notifications - notification repository
      threads - server-thread bridge
      messages - configurable message renderer
      economy - currency formatter
      logger - plugin logger
      deliveryBatchSize - maximum messages delivered in one join batch
  • Methodendetails

    • onCityCreated

      public void onCityCreated(CityCreatedEvent event)
      Queues a durable city assignment for its new landlord.
      Parameter:
      event - completed city creation event
    • onRegionBought

      public void onRegionBought(RegionBoughtEvent event)
      Queues a durable sale notice for the city landlord.
      Parameter:
      event - completed parcel purchase event
    • onJoin

      public void onJoin(org.bukkit.event.player.PlayerJoinEvent event)
      Delivers pending activity shortly after the recipient joins.
      Parameter:
      event - player join event
    • enqueue

      public CompletableFuture<Void> enqueue(UUID recipientId, String deduplicationKey, String message)
      Enqueues a plain notification idempotently and attempts immediate online delivery.
      Parameter:
      recipientId - recipient UUID
      deduplicationKey - stable business-event key
      message - bounded plain message
      Gibt zurück:
      completion future
    • deliverPending

      public CompletableFuture<Void> deliverPending(UUID recipientId)
      Delivers one bounded batch when the player is online.
      Parameter:
      recipientId - recipient UUID
      Gibt zurück:
      completion future