Class DefaultStaleCartItemsService
- java.lang.Object
-
- com.broadleafcommerce.cartoperation.service.DefaultStaleCartItemsService
-
- All Implemented Interfaces:
StaleCartItemsService
public class DefaultStaleCartItemsService extends Object implements StaleCartItemsService
The default implementation forStaleCartItemsService.- Author:
- Dima Myroniuk (dmyroniuk)
-
-
Constructor Summary
Constructors Constructor Description DefaultStaleCartItemsService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<com.broadleafcommerce.cart.client.domain.CartAlert>buildProductNotFoundCartAlerts(List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems)protected CartOperationServicegetCartOperationService()protected CatalogProvidergetCatalogProvider()protected StringgetMessage(@NonNull String errorMessage, Object... args)protected org.springframework.context.MessageSourcegetMessageSource()protected com.broadleafcommerce.common.extension.TypeFactorygetTypeFactory()com.broadleafcommerce.cart.client.domain.CartremoveStaleCartItems(com.broadleafcommerce.cart.client.domain.Cart cart, boolean price, boolean updateCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Removes theCartItemsfrom the cart if the appropriate product doesn't exist and creates theCartAlertabout removed items.com.broadleafcommerce.cart.client.domain.CartremoveStaleCartItems(com.broadleafcommerce.cart.client.domain.Cart cart, ProductList productList, boolean price, boolean updateCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Removes theCartItemsfrom the cart if the appropriate product doesn't exist and creates theCartAlertabout removed items.com.broadleafcommerce.cart.client.domain.CartremoveStaleCartItems(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems, boolean price, boolean updateCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Removes the specified cart items from the cart and adds theCartAlertabout removed items.voidsetCartOperationService(CartOperationService cartOperationService)voidsetCatalogProvider(CatalogProvider catalogProvider)voidsetMessageSource(org.springframework.context.MessageSource messageSource)voidsetTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
-
Method Detail
-
removeStaleCartItems
public com.broadleafcommerce.cart.client.domain.Cart removeStaleCartItems(com.broadleafcommerce.cart.client.domain.Cart cart, boolean price, boolean updateCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:StaleCartItemsServiceRemoves theCartItemsfrom the cart if the appropriate product doesn't exist and creates theCartAlertabout removed items.- Specified by:
removeStaleCartItemsin interfaceStaleCartItemsService- Parameters:
cart- the cart to check the stale itemsprice- whether or not to re-price the cartupdateCart- whether or not to updateCartpricing and save the cart after the removalcontextInfo- context information about sandboxing and multitenant state- Returns:
- the cart without stale cart items
-
removeStaleCartItems
public com.broadleafcommerce.cart.client.domain.Cart removeStaleCartItems(com.broadleafcommerce.cart.client.domain.Cart cart, ProductList productList, boolean price, boolean updateCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:StaleCartItemsServiceRemoves theCartItemsfrom the cart if the appropriate product doesn't exist and creates theCartAlertabout removed items.- Specified by:
removeStaleCartItemsin interfaceStaleCartItemsService- Parameters:
cart- the cart to check the stale itemsproductList- the list of the products for the cart itemsprice- whether or not to re-price the cartupdateCart- whether or not to updateCartpricing and save the cart after the removalcontextInfo- context information about sandboxing and multitenant state- Returns:
- the cart without stale cart items
-
removeStaleCartItems
public com.broadleafcommerce.cart.client.domain.Cart removeStaleCartItems(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems, boolean price, boolean updateCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:StaleCartItemsServiceRemoves the specified cart items from the cart and adds theCartAlertabout removed items.- Specified by:
removeStaleCartItemsin interfaceStaleCartItemsService- Parameters:
cart- the cart to check the stale itemscartItems- the list of the items to removeprice- whether or not to re-price the cartupdateCart- whether or not to updateCartpricing and save the cart after the removalcontextInfo- context information about sandboxing and multitenant state- Returns:
- the cart without stale cart items
-
buildProductNotFoundCartAlerts
protected List<com.broadleafcommerce.cart.client.domain.CartAlert> buildProductNotFoundCartAlerts(List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems)
-
getMessage
protected String getMessage(@NonNull @NonNull String errorMessage, @Nullable Object... args)
-
setCartOperationService
@Autowired @Lazy public void setCartOperationService(CartOperationService cartOperationService)
-
getCartOperationService
protected CartOperationService getCartOperationService()
-
setCatalogProvider
@Autowired public void setCatalogProvider(CatalogProvider catalogProvider)
-
getCatalogProvider
protected CatalogProvider getCatalogProvider()
-
setTypeFactory
@Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-
setMessageSource
@Autowired public void setMessageSource(org.springframework.context.MessageSource messageSource)
-
getMessageSource
protected org.springframework.context.MessageSource getMessageSource()
-
-