Klasse TransactionRecoveryService

java.lang.Object
de.delinkedde.areashopreborn.application.TransactionRecoveryService

public final class TransactionRecoveryService extends Object
Conservatively quarantines purchase workflows interrupted across SQLite, Vault, and WorldGuard.

Vault operations cannot participate in the SQLite transaction. A process may terminate after an external money operation but before its next journal update. Therefore startup recovery never guesses whether money moved and never automatically repeats a withdrawal, refund, or payout.

  • Konstruktordetails

    • TransactionRecoveryService

      public TransactionRecoveryService(Database database, PurchaseRepository purchases, EstateRepository estates, WorldGuardGateway worldGuard, ThreadBridge threads)
      Creates the recovery scanner.
      Parameter:
      database - asynchronous database executor
      purchases - purchase journal repository
      estates - estate repository used for audit entries
      worldGuard - WorldGuard adapter
      threads - main-thread bridge
    • TransactionRecoveryService

      public TransactionRecoveryService(Database database, PurchaseRepository purchases, SellbackRepository sellbacks, RentalRepository rentals, EstateRepository estates, WorldGuardGateway worldGuard, ThreadBridge threads)
      Creates a recovery scanner for every durable money workflow.
      Parameter:
      database - asynchronous database executor
      purchases - purchase journal repository
      sellbacks - sellback journal repository
      rentals - rental payment repository
      estates - estate repository used for quarantine and audit entries
      worldGuard - WorldGuard adapter
      threads - main-thread bridge
    • TransactionRecoveryService

      public TransactionRecoveryService(Database database, PurchaseRepository purchases, SellbackRepository sellbacks, RentalRepository rentals, EstateRepository estates, WorldGuardGateway worldGuard, ThreadBridge threads, int batchSize, int maximumReportEntries)
      Creates a bounded recovery scanner for every durable money workflow.
      Parameter:
      database - asynchronous database executor
      purchases - purchase journal repository
      sellbacks - sellback journal repository
      rentals - rental payment repository
      estates - estate repository used for quarantine and audit entries
      worldGuard - WorldGuard adapter
      threads - main-thread bridge
      batchSize - maximum journals processed by one database task
      maximumReportEntries - maximum identifiers and details retained in memory
  • Methodendetails

    • scan

      Finds and quarantines every nonterminal purchase, sellback, and rental payment journal.
      Gibt zurück:
      future containing the complete recovery report
    • retryProtection

      public CompletableFuture<Void> retryProtection(UUID administratorId, UUID transactionId)
      Reapplies only the idempotent WorldGuard ownership step of a quarantined purchase.

      The retry is allowed only when SQLite already names the transaction buyer as owner. It deliberately leaves the journal in manual review because seller payout cannot be proven or repeated safely through Vault.

      Parameter:
      administratorId - administrator requesting the retry
      transactionId - quarantined purchase identifier
      Gibt zurück:
      completion future
    • confirmPayout

      public CompletableFuture<Void> confirmPayout(UUID administratorId, UUID transactionId, String evidence)
      Completes a quarantined purchase after an administrator externally verifies seller payout.

      WorldGuard ownership is idempotently reapplied before the SQLite compare-and-set. This operation never moves money through Vault; the evidence must reference an independently verified payout record.

      Parameter:
      administratorId - resolving administrator
      transactionId - quarantined purchase identifier
      evidence - external payout verification reference
      Gibt zurück:
      completion future
    • confirmSellbackPayout

      public CompletableFuture<Void> confirmSellbackPayout(UUID administratorId, UUID transactionId, String evidence)
      Completes a quarantined sellback after independently verified seller payout.

      No Vault operation is performed. WorldGuard is first set idempotently to the intended recipient, after which SQLite atomically completes ownership, journal, and audit state.

      Parameter:
      administratorId - resolving administrator
      transactionId - quarantined sellback identifier
      evidence - external payout verification reference
      Gibt zurück:
      completion future
    • confirmSellbackRefund

      public CompletableFuture<Void> confirmSellbackRefund(UUID administratorId, UUID transactionId, String evidence)
      Restores a quarantined sellback after independently verified payout reversal.

      This path is allowed only while SQLite still proves seller ownership. It never withdraws or deposits money and preserves the seller's stored member set.

      Parameter:
      administratorId - resolving administrator
      transactionId - quarantined sellback identifier
      evidence - external refund verification reference
      Gibt zurück:
      completion future
    • confirmRentalPayment

      public CompletableFuture<Void> confirmRentalPayment(UUID administratorId, UUID paymentId, String evidence)
      Activates a quarantined rental or extension after independently verified payment.
      Parameter:
      administratorId - resolving administrator
      paymentId - quarantined rental payment identifier
      evidence - external payment verification reference
      Gibt zurück:
      completion future
    • confirmRentalRefund

      public CompletableFuture<Void> confirmRentalRefund(UUID administratorId, UUID paymentId, String evidence)
      Releases a quarantined rental or extension after independently verified refund.
      Parameter:
      administratorId - resolving administrator
      paymentId - quarantined rental payment identifier
      evidence - external refund verification reference
      Gibt zurück:
      completion future