java.lang.Object
com.broadleafcommerce.cartoperation.service.checkout.workflow.activity.CartSubscriptionLockActivity
All Implemented Interfaces:
CheckoutWorkflowActivity

public class CartSubscriptionLockActivity extends Object implements 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 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: CheckoutWorkflowActivity
      Method 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:
      execute in interface CheckoutWorkflowActivity
      Parameters:
      processDto - The CheckoutProcessDto that we're attempting to checkout with.
      contextInfo - Context information around sandbox and multitenant state.
      Returns:
      The final state of the CheckoutProcessDto following 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 - the CheckoutProcessDto being used for checkout
      cartItems - The individual cart items possibly containing references to existing subscriptions
    • clearLocks

      protected <T extends LockStatus> void clearLocks(List<T> statuses)
    • getSubscriptionOpsProvider

      protected SubscriptionOpsProvider getSubscriptionOpsProvider()
    • getMessageSource

      protected org.springframework.context.MessageSource getMessageSource()