Interface CartFacade
-
- All Known Subinterfaces:
B2BCartFacade
- All Known Implementing Classes:
DefaultB2BCartFacade,DefaultCartFacade
public interface CartFacadeDefines an API for cart manipulation, responsible for managing entries for cart.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CartModificationDataaddOrderEntry(OrderEntryData cartEntry)Method for adding a product to cart.java.util.List<CartModificationData>addOrderEntryList(java.util.List<OrderEntryData> cartEntries)Method for adding a product to cart.CartDatagetCurrentCart()This gets the current cart.voidremoveSessionCart()If existing the current session cart is being detached from this session and removed.CartDataupdate(CartData cartData)Updates the information in the cart based on the content of the cartDataCartModificationDataupdateOrderEntry(OrderEntryData cartEntry)Method for updating the number of products.java.util.List<CartModificationData>updateOrderEntryList(java.util.List<OrderEntryData> cartEntries)Method for updating a list of products in the cart.java.util.List<CartModificationData>validateCurrentCartData()Method for validating every entry in the cart
-
-
-
Method Detail
-
addOrderEntry
CartModificationData addOrderEntry(OrderEntryData cartEntry) throws EntityValidationException
Method for adding a product to cart.- Parameters:
cartEntry- the cart entry with the new product to add..- Returns:
- the cart modification data that includes a statusCode and the actual quantity added to the cart
- Throws:
EntityValidationException- if the validation fails.
-
updateOrderEntry
CartModificationData updateOrderEntry(OrderEntryData cartEntry) throws EntityValidationException
Method for updating the number of products.- Parameters:
cartEntry- the cart entry with the new value of quantity for product.- Returns:
- the cart modification data that includes a statusCode and the actual quantity that the entry was updated to
- Throws:
EntityValidationException- if the validation fails.
-
addOrderEntryList
java.util.List<CartModificationData> addOrderEntryList(java.util.List<OrderEntryData> cartEntries)
Method for adding a product to cart.- Parameters:
cartEntries- the cart entries with the new products to add.- Returns:
- the cart modification data that includes a statusCode and the actual quantity added to the cart
-
updateOrderEntryList
java.util.List<CartModificationData> updateOrderEntryList(java.util.List<OrderEntryData> cartEntries)
Method for updating a list of products in the cart.- Parameters:
cartEntries- the cart entries with the new products to add.- Returns:
- the cart modification data that includes a statusCode and the actual quantity added to the cart
-
update
CartData update(CartData cartData)
Updates the information in the cart based on the content of the cartData- Parameters:
cartData- the cart to modify and it's modifications.- Returns:
- the updated cart.
-
getCurrentCart
CartData getCurrentCart()
This gets the current cart.- Returns:
- the current cart.
-
validateCurrentCartData
java.util.List<CartModificationData> validateCurrentCartData() throws CommerceCartModificationException
Method for validating every entry in the cart- Returns:
- a list of cart modifications that includes a statusCode and the actual quantity that the entry was updated to
- Throws:
CommerceCartModificationException- if the cart cannot be modified
-
removeSessionCart
void removeSessionCart()
If existing the current session cart is being detached from this session and removed. Afterwards it's no longer available.
-
-