| java.lang.Object olstore.domain.manager.CartManager
CartManager | public class CartManager (Code) | | A wrapper class for type actions so that there is no need to reference the
beans directly, allowing us to swap out the backend beans for a different
implementation.
|
Constructor Summary | |
public | CartManager(ShoppingCartLocalHome cartHome, UserManager userManager, String username) Creates a new CartManger with information provided via Spring injection. |
Method Summary | |
public boolean | containsItem(Integer itemId) Checks if this shopping cart contains the given item.
Parameters: itemId - the id of the item to check. | public ArrayList | getItems() Returns a list of all item DTOs in this cart. | public int | getNumberOfItems() Returns the number of items currently in this cart. | public BigDecimal | getTotalCost() Returns the total cost for all items and quantities in the cart. | public void | placeOrder() Checkouts this shopping cart and places it as an order. | public void | updateQuantity(Integer itemId, Integer quantity) Updates the item quantity for the given item with the given amount in this cart. |
CartManager | public CartManager(ShoppingCartLocalHome cartHome, UserManager userManager, String username)(Code) | | Creates a new CartManger with information provided via Spring injection.
Parameters: cartHome - Cart EJB home object for finder methods. Parameters: userManager - a wrapper class for user related actions. Parameters: username - the user name that this cart will belong to. |
containsItem | public boolean containsItem(Integer itemId)(Code) | | Checks if this shopping cart contains the given item.
Parameters: itemId - the id of the item to check. true if this cart contains the given item. |
getItems | public ArrayList getItems()(Code) | | Returns a list of all item DTOs in this cart.
a list of all item DTOs in this cart. |
getNumberOfItems | public int getNumberOfItems()(Code) | | Returns the number of items currently in this cart.
the number of items currently in the cart. |
getTotalCost | public BigDecimal getTotalCost()(Code) | | Returns the total cost for all items and quantities in the cart.
the total cost for all items and quantities in the cart. |
placeOrder | public void placeOrder()(Code) | | Checkouts this shopping cart and places it as an order.
|
updateQuantity | public void updateQuantity(Integer itemId, Integer quantity)(Code) | | Updates the item quantity for the given item with the given amount in this cart.
Parameters: itemId - the id of the item to update. Parameters: quantity - the new quantity of the item. |
|
|