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 TypeMethodDescriptionvoidvalidateVersionForArchival(PaymentTransaction paymentTransaction, Integer versionToTest) Determines if the providedversionToTestis valid for an archival of thePaymentTransaction.voidvalidateVersionForUpdate(PaymentTransaction paymentTransaction, Integer versionToTest) Determines if the providedversionToTestis valid for an update of thePaymentTransaction.booleanversionIsStale(PaymentTransaction paymentTransaction, Integer versionToTest) Determines if the providedversionToTestis valid for thePaymentTransaction.
-
Method Details
-
versionIsStale
boolean versionIsStale(@NonNull PaymentTransaction paymentTransaction, @NonNull Integer versionToTest) Determines if the providedversionToTestis valid for thePaymentTransaction.- Parameters:
paymentTransaction- ThePaymentTransactionwhose version is being validated.versionToTest- The version provided by the request, which may or may not be out of date.- Returns:
- Whether the provided
versionToTestis valid for thePaymentTransaction.
-
validateVersionForUpdate
void validateVersionForUpdate(@NonNull PaymentTransaction paymentTransaction, @Nullable Integer versionToTest) Determines if the providedversionToTestis valid for an update of thePaymentTransaction.- Parameters:
paymentTransaction- ThePaymentTransactionwhose 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 providedversionToTestis valid for an archival of thePaymentTransaction.- Parameters:
paymentTransaction- ThePaymentTransactionwhose 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.
-