Oops... looks like the spiders padded through here
Add products to your cart and remove them from here Lets buypublic interface PlayerDataLayer
This follows the Chain of Responsibility pattern, allowing layers to be composed. Each layer can intercept data operations and either return cached data or delegate to the next layer in the chain.
| Modifier and Type | Method and Description |
|---|---|
default CompletableFuture<Void> |
dispose(UUID uniqueId,
PlayerDbModel model,
boolean isDirty)
Handles disposal of player data.
|
CompletableFuture<? extends PlayerDbModel> |
fetchByUniqueId(UUID uniqueId)
Fetches player data by unique ID.
|
PlayerDataLayer |
getNextLayer()
Gets the next layer in the chain.
|
<T extends PlayerDbModel> |
insert(T model)
Inserts new player data.
|
void |
setNextLayer(PlayerDataLayer nextLayer)
Sets the next layer in the chain.
|
<T extends PlayerDbModel> |
update(T model)
Updates player data.
|
CompletableFuture<? extends PlayerDbModel> fetchByUniqueId(UUID uniqueId)
The layer decides whether to return cached data or fetch from the next layer.
uniqueId - the player's unique ID<T extends PlayerDbModel> CompletableFuture<T> insert(T model)
The layer can cache the data after the insert operation completes.
model - the player database model to insert<T extends PlayerDbModel> CompletableFuture<Void> update(T model)
The layer can update its cache before passing the update to the next layer.
model - the player database model to updatevoid setNextLayer(PlayerDataLayer nextLayer)
This allows layers to be composed in a chain of responsibility pattern.
nextLayer - the next layer to delegate to, or null to remove the chainPlayerDataLayer getNextLayer()
default CompletableFuture<Void> dispose(UUID uniqueId,
PlayerDbModel model,
boolean isDirty)
This is called when player data is being unloaded from memory. The layer should release any locks and update Redis if the data is dirty.
uniqueId - the player's unique IDmodel - the player database model (may be null)isDirty - whether the data is dirty and needs to be saved
Oops... looks like the spiders padded through here
Add products to your cart and remove them from here Lets buy