Klasse PlayerNotificationService
java.lang.Object
de.delinkedde.areashopreborn.application.PlayerNotificationService
- Alle implementierten Schnittstellen:
org.bukkit.event.Listener
Persists important estate activity and delivers it immediately or on the next player join.
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungPlayerNotificationService(Database database, PlayerNotificationRepository notifications, ThreadBridge threads, MessageService messages, EconomyGateway economy, Logger logger, int deliveryBatchSize) Creates a persistent notification service using the system UTC clock. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungdeliverPending(UUID recipientId) Delivers one bounded batch when the player is online.Enqueues a plain notification idempotently and attempts immediate online delivery.voidonCityCreated(CityCreatedEvent event) Queues a durable city assignment for its new landlord.voidonJoin(org.bukkit.event.player.PlayerJoinEvent event) Delivers pending activity shortly after the recipient joins.voidonRegionBought(RegionBoughtEvent event) Queues a durable sale notice for the city landlord.
-
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 executornotifications- notification repositorythreads- server-thread bridgemessages- configurable message renderereconomy- currency formatterlogger- plugin loggerdeliveryBatchSize- maximum messages delivered in one join batch
-
-
Methodendetails
-
onCityCreated
Queues a durable city assignment for its new landlord.- Parameter:
event- completed city creation event
-
onRegionBought
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
Enqueues a plain notification idempotently and attempts immediate online delivery.- Parameter:
recipientId- recipient UUIDdeduplicationKey- stable business-event keymessage- bounded plain message- Gibt zurück:
- completion future
-
deliverPending
Delivers one bounded batch when the player is online.- Parameter:
recipientId- recipient UUID- Gibt zurück:
- completion future
-