|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.websphere.samples.plantsbywebsphereejb.ShoppingCartBean
public class ShoppingCartBean
ShoppingCartBean is the implementation class for the ShoppingCart
stateful session
EJB. ShoppingCartBean implements each of the business methods in the ShoppingCart
EJB local interface and each of the EJB lifecycle methods in the javax.ejb.SessionBean
interface.
ShoppingCart
Constructor Summary | |
---|---|
ShoppingCartBean()
|
Method Summary | |
---|---|
void |
addItem(ShoppingCartItem new_item)
Add an item to the cart. |
void |
checkInventory(java.util.Collection<ShoppingCartItem> items)
Method checkInventory. |
void |
checkInventory(ShoppingCartItem si)
Method checkInventory. |
OrderInfo |
createOrder(java.lang.String customerID,
java.lang.String billName,
java.lang.String billAddr1,
java.lang.String billAddr2,
java.lang.String billCity,
java.lang.String billState,
java.lang.String billZip,
java.lang.String billPhone,
java.lang.String shipName,
java.lang.String shipAddr1,
java.lang.String shipAddr2,
java.lang.String shipCity,
java.lang.String shipState,
java.lang.String shipZip,
java.lang.String shipPhone,
java.lang.String creditCard,
java.lang.String ccNum,
java.lang.String ccExpireMonth,
java.lang.String ccExpireYear,
java.lang.String cardHolder,
int shippingMethod,
java.util.Collection<ShoppingCartItem> items)
Create an order with contents of a shopping cart. |
ShoppingCartContents |
getCartContents()
Get the contents of the shopping cart. |
java.util.Collection<ShoppingCartItem> |
getItems()
Get the items in the shopping cart. |
float |
getTotalCost()
Get the total cost of all items in the shopping cart. |
void |
removeItem(ShoppingCartItem item)
Remove an item from the cart. |
void |
setCartContents(ShoppingCartContents cartContents)
Create a shopping cart. |
void |
setItems(java.util.Collection items)
Set the items in the shopping cart. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShoppingCartBean()
Method Detail |
---|
public void setCartContents(ShoppingCartContents cartContents)
setCartContents
in interface ShoppingCart
cartContents
- Contents to populate cart with.public void addItem(ShoppingCartItem new_item)
addItem
in interface ShoppingCart
new_item
- Item to add to the cart.public void removeItem(ShoppingCartItem item)
removeItem
in interface ShoppingCart
item
- Item to remove from cart.public java.util.Collection<ShoppingCartItem> getItems()
getItems
in interface ShoppingCart
public void setItems(java.util.Collection items)
setItems
in interface ShoppingCart
items
- A Vector of ShoppingCartItem's.public float getTotalCost()
getTotalCost
in interface ShoppingCart
public void checkInventory(ShoppingCartItem si)
checkInventory
in interface ShoppingCart
si
- - Store itempublic void checkInventory(java.util.Collection<ShoppingCartItem> items)
checkInventory
in interface ShoppingCart
items
- public ShoppingCartContents getCartContents()
getCartContents
in interface ShoppingCart
public OrderInfo createOrder(java.lang.String customerID, java.lang.String billName, java.lang.String billAddr1, java.lang.String billAddr2, java.lang.String billCity, java.lang.String billState, java.lang.String billZip, java.lang.String billPhone, java.lang.String shipName, java.lang.String shipAddr1, java.lang.String shipAddr2, java.lang.String shipCity, java.lang.String shipState, java.lang.String shipZip, java.lang.String shipPhone, java.lang.String creditCard, java.lang.String ccNum, java.lang.String ccExpireMonth, java.lang.String ccExpireYear, java.lang.String cardHolder, int shippingMethod, java.util.Collection<ShoppingCartItem> items)
createOrder
in interface ShoppingCart
customerID
- customer's IDbillName
- billing namebillAddr1
- billing address line 1billAddr2
- billing address line 2billCity
- billing address citybillState
- billing address statebillZip
- billing address zip codebillPhone
- billing phoneshipName
- shippng nameshipAddr1
- shippng address line 1shipAddr2
- shippng address line 2shipCity
- shippng address cityshipState
- shippng address stateshipZip
- shippng address zip codeshipPhone
- shippng phonecreditCard
- credit cardccNum
- credit card numberccExpireMonth
- credit card expiration monthccExpireYear
- credit card expiration yearcardHolder
- credit card holder nameshippingMethod
- int of shipping method useditems
- vector of StoreItems ordered
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |