com.ibm.websphere.samples.plantsbywebsphereejb
Interface ShoppingCart

All Superinterfaces:
javax.ejb.EJBObject, java.rmi.Remote

public interface ShoppingCart
extends javax.ejb.EJBObject

Local interface for ShoppingCart stateful session bean.


Method Summary
 void addItem(StoreItem item)
          Add an item to the cart.
 void checkInventory(StoreItem si)
          Metho checkInventory.
 void checkInventory(java.util.Vector items)
          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.Vector items)
          Create an order with contents of a shopping cart.
 ShoppingCartContents getCartContents()
          Get the contents of the shopping cart.
 java.util.Vector getItems()
          Get the items in the shopping cart.
 float getTotalCost()
          Get the total cost of all items in the shopping cart.
 void removeItem(StoreItem item)
          Remove an item from the cart.
 void setItems(java.util.Vector items)
          Set the items in the shopping cart.
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

addItem

void addItem(StoreItem item)
             throws java.rmi.RemoteException
Add an item to the cart.

Parameters:
item - Item to add to the cart.
Throws:
java.rmi.RemoteException

removeItem

void removeItem(StoreItem item)
                throws java.rmi.RemoteException
Remove an item from the cart.

Parameters:
item - Item to remove from cart.
Throws:
java.rmi.RemoteException

getItems

java.util.Vector getItems()
                          throws java.rmi.RemoteException
Get the items in the shopping cart.

Returns:
A Vector of the items.
Throws:
java.rmi.RemoteException

setItems

void setItems(java.util.Vector items)
              throws java.rmi.RemoteException
Set the items in the shopping cart.

Parameters:
items - A Vector of the items.
Throws:
java.rmi.RemoteException

getTotalCost

float getTotalCost()
                   throws java.rmi.RemoteException
Get the total cost of all items in the shopping cart.

Returns:
The total cost of all items in the shopping cart.
Throws:
java.rmi.RemoteException

getCartContents

ShoppingCartContents getCartContents()
                                     throws java.rmi.RemoteException
Get the contents of the shopping cart.

Returns:
The contents of the shopping cart.
Throws:
java.rmi.RemoteException

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.Vector items)
                      throws java.rmi.RemoteException
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 - vector of StoreItems ordered
Returns:
OrderInfo
Throws:
java.rmi.RemoteException

checkInventory

void checkInventory(java.util.Vector items)
                    throws java.rmi.RemoteException
Method checkInventory.

Parameters:
items -
Throws:
java.rmi.RemoteException

checkInventory

void checkInventory(StoreItem si)
                    throws java.rmi.RemoteException
Metho checkInventory.

Parameters:
si -
Throws:
java.rmi.RemoteException