Klasse InactivityReleaseRepository
java.lang.Object
de.delinkedde.areashopreborn.persistence.InactivityReleaseRepository
Persists idempotent inactivity ownership returns and their recovery state.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanapplyDatabase(InactivityReleaseAction action, Instant now) Atomically transfers eligible SQLite ownership and advances the journal.voidMarks WorldGuard work complete.voidcompleteRecovery(InactivityReleaseAction action, Instant now) Atomically restores the region lifecycle and completes a manually retried action.Finds an action by identifier for administration and recovery.Lists actions whose SQLite transition committed but whose WorldGuard stage did not finish.findDatabaseApplied(int limit) Lists a bounded oldest-first batch whose WorldGuard stage still needs recovery.findDirectlyOwned(UUID ownerId) Finds regions directly owned by a player.findReleaseCandidates(UUID ownerId, int limit) Finds a bounded batch of parcels that still satisfy the database-only release rules.voidmanualReview(UUID actionId, String detail, Instant now) Quarantines a failed WorldGuard transition.prepare(EstateRegion region, UUID recipientId, Instant now) Creates an intent unless this owner-region pair was already processed.
-
Konstruktordetails
-
InactivityReleaseRepository
Creates the repository.- Parameter:
database- database owner
-
-
Methodendetails
-
findDirectlyOwned
Finds regions directly owned by a player.- Parameter:
ownerId- owner identifier- Gibt zurück:
- directly owned regions
- Löst aus:
SQLException- when persistence fails
-
findReleaseCandidates
Finds a bounded batch of parcels that still satisfy the database-only release rules.Filtering before materializing domain snapshots prevents one unusually large owner from monopolizing the SQLite worker or allocating an unbounded list. The transactional update repeats the decisive predicates before changing ownership.
- Parameter:
ownerId- owner identifierlimit- maximum candidate count- Gibt zurück:
- stable oldest-first candidate batch
- Löst aus:
SQLException- when the query fails
-
prepare
public InactivityReleaseAction prepare(EstateRegion region, UUID recipientId, Instant now) throws SQLException Creates an intent unless this owner-region pair was already processed.- Parameter:
region- target regionrecipientId- return recipientnow- creation timestamp- Gibt zurück:
- newly created or existing action
- Löst aus:
SQLException- when persistence fails
-
applyDatabase
Atomically transfers eligible SQLite ownership and advances the journal.- Parameter:
action- prepared actionnow- transition timestamp- Gibt zurück:
- whether this call applied the transition
- Löst aus:
SQLException- when persistence fails or eligibility changed
-
complete
Marks WorldGuard work complete.- Parameter:
actionId- action identifiernow- completion timestamp- Löst aus:
SQLException- when persistence fails
-
manualReview
Quarantines a failed WorldGuard transition.- Parameter:
actionId- action identifierdetail- bounded diagnostic detailnow- transition timestamp- Löst aus:
SQLException- when persistence fails
-
findById
Finds an action by identifier for administration and recovery.- Parameter:
actionId- action identifier- Gibt zurück:
- matching action when present
- Löst aus:
SQLException- when persistence fails
-
findDatabaseApplied
Lists actions whose SQLite transition committed but whose WorldGuard stage did not finish.- Gibt zurück:
- oldest recoverable actions first
- Löst aus:
SQLException- when persistence fails
-
findDatabaseApplied
Lists a bounded oldest-first batch whose WorldGuard stage still needs recovery.- Parameter:
limit- maximum actions returned- Gibt zurück:
- oldest recoverable actions first
- Löst aus:
SQLException- when persistence fails
-
completeRecovery
Atomically restores the region lifecycle and completes a manually retried action.- Parameter:
action- action whose WorldGuard stage was successfully retriednow- completion timestamp- Löst aus:
SQLException- when state changed concurrently or persistence fails
-