Klasse GeometryJournalRepository
java.lang.Object
de.delinkedde.areashopreborn.persistence.GeometryJournalRepository
Persists the restartable journal of city expansions, height changes, and parcel merges.
Each of these operations changes WorldGuard and SQLite. Without a journal a crash between both steps leaves a divergence that cannot be attributed to either side afterwards.
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungGeometryJournalRepository(Database database) Creates the journal repository. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidMarks the operation as fully applied on both sides.voidMarks the operation as failed after a compensation attempt.findUnfinished(int limit) Lists operations that never reached a terminal state.voidMarks that WorldGuard already holds the new geometry.prepare(GeometryOperation.Type type, UUID targetRegionId, UUID sourceRegionId, UUID actorId, RegionGeometry previous, RegionGeometry updated) Records an operation before WorldGuard is touched.
-
Konstruktordetails
-
GeometryJournalRepository
Creates the journal repository.- Parameter:
database- owning database
-
-
Methodendetails
-
prepare
public UUID prepare(GeometryOperation.Type type, UUID targetRegionId, UUID sourceRegionId, UUID actorId, RegionGeometry previous, RegionGeometry updated) throws SQLException Records an operation before WorldGuard is touched.- Parameter:
type- operation typetargetRegionId- retained regionsourceRegionId- archived merge source, ornullactorId- acting player or system identityprevious- geometry before the changeupdated- geometry after the change- Gibt zurück:
- journal identifier
- Löst aus:
SQLException- when the insert fails
-
markProtectionApplied
Marks that WorldGuard already holds the new geometry.- Parameter:
id- journal identifier- Löst aus:
SQLException- when the update fails
-
complete
Marks the operation as fully applied on both sides.- Parameter:
id- journal identifier- Löst aus:
SQLException- when the update fails
-
fail
Marks the operation as failed after a compensation attempt.- Parameter:
id- journal identifierdetail- bounded failure description- Löst aus:
SQLException- when the update fails
-
findUnfinished
Lists operations that never reached a terminal state.- Parameter:
limit- maximum rows returned- Gibt zurück:
- unfinished operations oldest first
- Löst aus:
SQLException- when the query fails
-