Interface PaymentTransactionVersionValidationService

All Known Implementing Classes:
DefaultPaymentTransactionVersionValidationService

public interface PaymentTransactionVersionValidationService
Service used for validating the version of a PaymentTransaction for reads and updates within this service.
Author:
Chris Kittrell (ckittrell)
  • Method Details

    • versionIsStale

      boolean versionIsStale(@NonNull PaymentTransaction paymentTransaction, @NonNull Integer versionToTest)
      Determines if the provided versionToTest is valid for the PaymentTransaction.
      Parameters:
      paymentTransaction - The PaymentTransaction whose version is being validated.
      versionToTest - The version provided by the request, which may or may not be out of date.
      Returns:
      Whether the provided versionToTest is valid for the PaymentTransaction.
    • validateVersionForUpdate

      void validateVersionForUpdate(@NonNull PaymentTransaction paymentTransaction, @Nullable Integer versionToTest)
      Determines if the provided versionToTest is valid for an update of the PaymentTransaction.
      Parameters:
      paymentTransaction - The PaymentTransaction whose version is being validated.
      versionToTest - The version provided by the request, which may or may not be out of date.
      Throws:
      StalePaymentTransactionVersionException - If the provided version is stale.
    • validateVersionForArchival

      void validateVersionForArchival(@NonNull PaymentTransaction paymentTransaction, @Nullable Integer versionToTest)
      Determines if the provided versionToTest is valid for an archival of the PaymentTransaction.
      Parameters:
      paymentTransaction - The PaymentTransaction whose version is being validated.
      versionToTest - The version provided by the request, which may or may not be out of date.
      Throws:
      StalePaymentTransactionVersionException - If the provided version is stale.