com.ibm.websphere.samples.plantsbywebsphereejb
Interface ShoppingCart

All Known Implementing Classes:
ShoppingCartBean

public interface ShoppingCart

Remote interface for ShoppingCart stateful session bean.


Method Summary
 void addItem(ShoppingCartItem item)
          Add an item to the cart.
 void checkInventory(java.util.Collection<ShoppingCartItem> items)
          Method checkInventory.
 void checkInventory(ShoppingCartItem si)
          Metho 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 c)
           
 void setItems(java.util.Collection<ShoppingCartItem> items)
          Set the items in the shopping cart.
 

Method Detail

addItem

void addItem(ShoppingCartItem item)
Add an item to the cart.

Parameters:
item - Item to add to the cart.

removeItem

void removeItem(ShoppingCartItem item)
Remove an item from the cart.

Parameters:
item - Item to remove from cart.

getItems

java.util.Collection<ShoppingCartItem> getItems()
Get the items in the shopping cart.

Returns:
A Vector of the items.

setItems

void setItems(java.util.Collection<ShoppingCartItem> items)
Set the items in the shopping cart.

Parameters:
items - A Vector of the items.

getTotalCost

float getTotalCost()
Get the total cost of all items in the shopping cart.

Returns:
The total cost of all items in the shopping cart.

getCartContents

ShoppingCartContents getCartContents()
Get the contents of the shopping cart.

Returns:
The contents of the shopping cart.

setCartContents

void setCartContents(ShoppingCartContents c)

createOrder

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.

Parameters:
customerID - customer's ID
billName - billing name
billAddr1 - billing address line 1
billAddr2 - billing address line 2
billCity - billing address city
billState - billing address state
billZip - billing address zip code
billPhone - billing phone
shipName - shippng name
shipAddr1 - shippng address line 1
shipAddr2 - shippng address line 2
shipCity - shippng address city
shipState - shippng address state
shipZip - shippng address zip code
shipPhone - shippng phone
creditCard - credit card
ccNum - credit card number
ccExpireMonth - credit card expiration month
ccExpireYear - credit card expiration year
cardHolder - credit card holder name
shippingMethod - index of shipping method used
items - collection of StoreItems ordered
Returns:
OrderInfo

checkInventory

void checkInventory(java.util.Collection<ShoppingCartItem> items)
Method checkInventory.

Parameters:
items -
Throws:
java.rmi.RemoteException

checkInventory

void checkInventory(ShoppingCartItem si)
Metho checkInventory.

Parameters:
si -
Throws:
java.rmi.RemoteException