Interface PaymentVersionValidationService

All Known Implementing Classes:
DefaultPaymentVersionValidationService

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

    • versionIsStale

      boolean versionIsStale(@NonNull Payment payment, @NonNull Integer versionToTest)
      Determines if the provided versionToTest is valid for the Payment.
      Parameters:
      payment - The Payment 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 Payment.
    • validateVersionForUpdate

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

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