Class AbstractAccountCartStatusHandler

java.lang.Object
com.broadleafcommerce.cartoperation.service.status.AbstractCartStatusChangeHandler
com.broadleafcommerce.cartoperation.service.status.accountcart.AbstractAccountCartStatusHandler
All Implemented Interfaces:
CartStatusHandler
Direct Known Subclasses:
ReclaimAccountCartStatusChangeHandler, RejectedAccountCartStatusChangeHandler, RequiresApprovalAccountCartStatusChangeHandler

public abstract class AbstractAccountCartStatusHandler extends AbstractCartStatusChangeHandler
An abstract class to handle the account carts status changes.
Author:
Dima Myroniuk (dmyroniuk)
  • Constructor Details

    • AbstractAccountCartStatusHandler

      protected AbstractAccountCartStatusHandler(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils, com.broadleafcommerce.common.extension.TypeFactory typeFactory, CartUtils cartUtils)
  • Method Details

    • canHandle

      public boolean canHandle(ChangeCartStatusRequest changeStatusRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CartStatusHandler
      Determines if this handler can handle the status change.
      Specified by:
      canHandle in interface CartStatusHandler
      Overrides:
      canHandle in class AbstractCartStatusChangeHandler
      Parameters:
      changeStatusRequest - the ChangeCartStatusRequest to facilitate the cart status change
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      true if this handler can handle the status change, otherwise false
    • isCartOwner

      protected boolean isCartOwner(@NonNull @NonNull ChangeCartStatusRequest changeStatusRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from class: AbstractCartStatusChangeHandler
      Determines if the given CustomerRef is the owner of the given Cart.
      Overrides:
      isCartOwner in class AbstractCartStatusChangeHandler
      Parameters:
      changeStatusRequest - the ChangeCartStatusRequest to facilitate the cart status change
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      true if the currently authenticated user is the owner of the Cart, otherwise false
    • processStatusChange

      protected ChangeCartStatusRequest processStatusChange(@NonNull @NonNull ChangeCartStatusRequest changeStatusRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from class: AbstractCartStatusChangeHandler
      Perform the status change of the Cart.

      By default, this updates the status and creates a corresponding CartActionAudit. This serves as a hook point for additional steps for the status change.

      Overrides:
      processStatusChange in class AbstractCartStatusChangeHandler
      Parameters:
      changeStatusRequest - the ChangeCartStatusRequest to facilitate the cart status change
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      the ChangeCartStatusRequest with the updated cart
    • postProcessStatusChange

      protected ChangeCartStatusRequest postProcessStatusChange(@NonNull @NonNull ChangeCartStatusRequest changeStatusRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from class: AbstractCartStatusChangeHandler
      Perform any additional handling after the Cart has changed status.

      By default, this does nothing. This serves as a hook point for customization.

      Overrides:
      postProcessStatusChange in class AbstractCartStatusChangeHandler
      Parameters:
      changeStatusRequest - the ChangeCartStatusRequest to facilitate the cart status change
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      the change status request after performing any additional handling.
    • buildCartActionAuditForAccountCartUpdate

      protected com.broadleafcommerce.cart.client.domain.CartActionAudit buildCartActionAuditForAccountCartUpdate(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, String actionType, String userType)
    • isAccountCart

      protected boolean isAccountCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
    • getCartUtils

      protected CartUtils getCartUtils()