Class CartSubscriptionLockActivity
java.lang.Object
com.broadleafcommerce.cartoperation.service.checkout.workflow.activity.CartSubscriptionLockActivity
- All Implemented Interfaces:
CheckoutWorkflowActivity
Handles validation of subscription items contained in the cart. This primarily ensures that
existing subscriptions can be modified and adds locks on them, which should be released
- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
- Author:
- Nathan Moore (nathandmoore)
-
Constructor Summary
ConstructorsConstructorDescriptionCartSubscriptionLockActivity(SubscriptionOpsProvider subscriptionOpsProvider, org.springframework.context.MessageSource messageSource) -
Method Summary
Modifier and TypeMethodDescriptionprotected <T extends LockStatus>
voidclearLocks(List<T> statuses) execute(@NonNull CheckoutProcessDto processDto, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Method responsible for executing some work against the cart that is required for checkout.protected org.springframework.context.MessageSourceprotected SubscriptionOpsProviderprotected voidvalidateSubscriptionLocks(@NotNull CheckoutProcessDto processDto, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems) Create locks for subscriptions associated with the cart items.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.cartoperation.service.checkout.workflow.activity.CheckoutWorkflowActivity
rollback
-
Constructor Details
-
CartSubscriptionLockActivity
public CartSubscriptionLockActivity(SubscriptionOpsProvider subscriptionOpsProvider, org.springframework.context.MessageSource messageSource)
-
-
Method Details
-
execute
public CheckoutProcessDto execute(@NonNull @NonNull CheckoutProcessDto processDto, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CheckoutWorkflowActivityMethod responsible for executing some work against the cart that is required for checkout. This may include, but is not limited to, cart validation checks, inventory reservations, or payment authorizations.- Specified by:
executein interfaceCheckoutWorkflowActivity- Parameters:
processDto- TheCheckoutProcessDtothat we're attempting to checkout with.contextInfo- Context information around sandbox and multitenant state.- Returns:
- The final state of the
CheckoutProcessDtofollowing the execution of the activity.
-
validateSubscriptionLocks
protected void validateSubscriptionLocks(@NotNull @NotNull CheckoutProcessDto processDto, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems) Create locks for subscriptions associated with the cart items. Throw a validation exception if unable to lock any subscriptions. Important this happens early in cart completion lifecycle, so we can fail fast if we can't lock subscriptions.- Parameters:
processDto- theCheckoutProcessDtobeing used for checkoutcartItems- The individual cart items possibly containing references to existing subscriptions
-
clearLocks
-
getSubscriptionOpsProvider
-
getMessageSource
protected org.springframework.context.MessageSource getMessageSource()
-