Klasse GeometryJournalRepository

java.lang.Object
de.delinkedde.areashopreborn.persistence.GeometryJournalRepository

public final class GeometryJournalRepository extends Object
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.

  • Konstruktordetails

    • GeometryJournalRepository

      public GeometryJournalRepository(Database database)
      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 type
      targetRegionId - retained region
      sourceRegionId - archived merge source, or null
      actorId - acting player or system identity
      previous - geometry before the change
      updated - geometry after the change
      Gibt zurück:
      journal identifier
      Löst aus:
      SQLException - when the insert fails
    • markProtectionApplied

      public void markProtectionApplied(UUID id) throws SQLException
      Marks that WorldGuard already holds the new geometry.
      Parameter:
      id - journal identifier
      Löst aus:
      SQLException - when the update fails
    • complete

      public void complete(UUID id) throws SQLException
      Marks the operation as fully applied on both sides.
      Parameter:
      id - journal identifier
      Löst aus:
      SQLException - when the update fails
    • fail

      public void fail(UUID id, String detail) throws SQLException
      Marks the operation as failed after a compensation attempt.
      Parameter:
      id - journal identifier
      detail - bounded failure description
      Löst aus:
      SQLException - when the update fails
    • findUnfinished

      public List<GeometryOperation> findUnfinished(int limit) throws SQLException
      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