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 Summary
Modifier and TypeMethodDescriptionvoid
validateVersionForArchival
(PaymentTransaction paymentTransaction, Integer versionToTest) Determines if the providedversionToTest
is valid for an archival of thePaymentTransaction
.void
validateVersionForUpdate
(PaymentTransaction paymentTransaction, Integer versionToTest) Determines if the providedversionToTest
is valid for an update of thePaymentTransaction
.boolean
versionIsStale
(PaymentTransaction paymentTransaction, Integer versionToTest) Determines if the providedversionToTest
is valid for thePaymentTransaction
.
-
Method Details
-
versionIsStale
boolean versionIsStale(@NonNull PaymentTransaction paymentTransaction, @NonNull Integer versionToTest) Determines if the providedversionToTest
is valid for thePaymentTransaction
.- Parameters:
paymentTransaction
- ThePaymentTransaction
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 thePaymentTransaction
.
-
validateVersionForUpdate
void validateVersionForUpdate(@NonNull PaymentTransaction paymentTransaction, @Nullable Integer versionToTest) Determines if the providedversionToTest
is valid for an update of thePaymentTransaction
.- Parameters:
paymentTransaction
- ThePaymentTransaction
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 providedversionToTest
is valid for an archival of thePaymentTransaction
.- Parameters:
paymentTransaction
- ThePaymentTransaction
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.
-