Class UpdateCartServiceImpl

java.lang.Object
org.broadleafcommerce.core.web.service.UpdateCartServiceImpl
All Implemented Interfaces:
UpdateCartService

@Service("blUpdateCartService") public class UpdateCartServiceImpl extends Object implements UpdateCartService
Author: jerryocanas Date: 9/26/12
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    protected static final org.apache.commons.logging.Log
     
    protected org.broadleafcommerce.core.order.service.OrderLockManager
     
    protected org.broadleafcommerce.core.order.service.OrderService
     
    protected static org.broadleafcommerce.common.currency.domain.BroadleafCurrency
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    checkAvailabilityInLocale(org.broadleafcommerce.core.order.domain.DiscreteOrderItem doi, org.broadleafcommerce.common.currency.domain.BroadleafCurrency currency)
     
    org.broadleafcommerce.core.order.service.call.UpdateCartResponse
    copyCartToCurrentContext(org.broadleafcommerce.core.order.domain.Order currentCart)
    Reprices the order by removing all items and recreating the cart calling for a reprice on the new cart.
    boolean
    Compares the currency set in the BroadleafRequestContext with the savedCurrency.
    protected org.broadleafcommerce.common.currency.domain.BroadleafCurrency
     
    protected boolean
     
    org.broadleafcommerce.common.currency.domain.BroadleafCurrency
    Gets the currency that was set as active on last pass through.
    protected Object
    lockOrder(org.broadleafcommerce.core.order.domain.Order order, Object lockObject)
     
    void
    setSavedCurrency(org.broadleafcommerce.common.currency.domain.BroadleafCurrency savedCurrency)
    Sets the currency that was set as active on last pass through.
    void
    updateAndValidateCart(org.broadleafcommerce.core.order.domain.Order cart)
    Updates the cart (locale, pricing) and performs validation.
    void
    validateAddToCartRequest(org.broadleafcommerce.core.order.service.call.OrderItemRequestDTO itemRequest, org.broadleafcommerce.core.order.domain.Order cart)
    Validates the given add item that will be added to the given cart.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOG

      protected static final org.apache.commons.logging.Log LOG
    • savedCurrency

      protected static org.broadleafcommerce.common.currency.domain.BroadleafCurrency savedCurrency
    • orderService

      protected org.broadleafcommerce.core.order.service.OrderService orderService
    • extensionManager

      protected UpdateCartServiceExtensionManager extensionManager
    • orderLockManager

      @Autowired @Qualifier("blOrderLockManager") protected org.broadleafcommerce.core.order.service.OrderLockManager orderLockManager
  • Constructor Details

    • UpdateCartServiceImpl

      public UpdateCartServiceImpl()
  • Method Details

    • currencyHasChanged

      public boolean currencyHasChanged()
      Description copied from interface: UpdateCartService
      Compares the currency set in the BroadleafRequestContext with the savedCurrency. If different, returns TRUE
      Specified by:
      currencyHasChanged in interface UpdateCartService
      Returns:
    • copyCartToCurrentContext

      public org.broadleafcommerce.core.order.service.call.UpdateCartResponse copyCartToCurrentContext(org.broadleafcommerce.core.order.domain.Order currentCart)
      Description copied from interface: UpdateCartService
      Reprices the order by removing all items and recreating the cart calling for a reprice on the new cart.
      Specified by:
      copyCartToCurrentContext in interface UpdateCartService
      Returns:
    • validateAddToCartRequest

      public void validateAddToCartRequest(org.broadleafcommerce.core.order.service.call.OrderItemRequestDTO itemRequest, org.broadleafcommerce.core.order.domain.Order cart)
      Description copied from interface: UpdateCartService
      Validates the given add item that will be added to the given cart. This occurs prior to the item actually being added
      Specified by:
      validateAddToCartRequest in interface UpdateCartService
    • updateAndValidateCart

      public void updateAndValidateCart(org.broadleafcommerce.core.order.domain.Order cart)
      Description copied from interface: UpdateCartService
      Updates the cart (locale, pricing) and performs validation.
      Specified by:
      updateAndValidateCart in interface UpdateCartService
    • lockOrder

      protected Object lockOrder(org.broadleafcommerce.core.order.domain.Order order, Object lockObject)
    • getErrorInsteadOfQueue

      protected boolean getErrorInsteadOfQueue()
    • findActiveCurrency

      protected org.broadleafcommerce.common.currency.domain.BroadleafCurrency findActiveCurrency()
    • checkAvailabilityInLocale

      protected boolean checkAvailabilityInLocale(org.broadleafcommerce.core.order.domain.DiscreteOrderItem doi, org.broadleafcommerce.common.currency.domain.BroadleafCurrency currency)
    • getSavedCurrency

      public org.broadleafcommerce.common.currency.domain.BroadleafCurrency getSavedCurrency()
      Description copied from interface: UpdateCartService
      Gets the currency that was set as active on last pass through.
      Specified by:
      getSavedCurrency in interface UpdateCartService
      Returns:
    • setSavedCurrency

      public void setSavedCurrency(org.broadleafcommerce.common.currency.domain.BroadleafCurrency savedCurrency)
      Description copied from interface: UpdateCartService
      Sets the currency that was set as active on last pass through.
      Specified by:
      setSavedCurrency in interface UpdateCartService