com.ibm.websphere.samples.pbw.ejb
Class CatalogMgr

java.lang.Object
  extended by com.ibm.websphere.samples.pbw.ejb.CatalogMgr

public class CatalogMgr
extends Object

The CatalogMgr provides transactional access to the catalog of items the store is willing to sell to customers.

See Also:
Inventory

Constructor Summary
CatalogMgr()
           
 
Method Summary
 boolean addItem(Inventory item)
          Add an inventory item.
 byte[] getItemImageBytes(String inventoryID)
          Get the image for the inventory item.
 Inventory getItemInventory(String inventoryID)
          Get the Inventory item for the given ID.
 Vector<Inventory> getItemsByCategory(int category)
          Get all inventory items for the given category.
 void setItemImageBytes(String inventoryID, byte[] imgbytes)
          Set the image for the inventory item.
 void setItemQuantity(String inventoryID, int quantity)
          Set the inventory item's quantity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatalogMgr

public CatalogMgr()
Method Detail

getItemsByCategory

public Vector<Inventory> getItemsByCategory(int category)
Get all inventory items for the given category.

Parameters:
category - of items desired.
Returns:
Vector of Inventory.

getItemInventory

public Inventory getItemInventory(String inventoryID)
Get the Inventory item for the given ID.

Parameters:
inventoryID - - ID of the Inventory item desired.
Returns:
Inventory

addItem

public boolean addItem(Inventory item)
Add an inventory item.

Parameters:
item - The Inventory to add.
Returns:
True, if item added.

getItemImageBytes

public byte[] getItemImageBytes(String inventoryID)
Get the image for the inventory item.

Parameters:
inventoryID - The id of the inventory item wanted.
Returns:
Buffer containing the image.

setItemImageBytes

public void setItemImageBytes(String inventoryID,
                              byte[] imgbytes)
Set the image for the inventory item.

Parameters:
inventoryID - The id of the inventory item wanted.
imgbytes - Buffer containing the image.

setItemQuantity

public void setItemQuantity(String inventoryID,
                            int quantity)
Set the inventory item's quantity.

Parameters:
inventoryID - The inventory item's ID.
quantity - The inventory item's new quantity.


Copyright © 2011. All Rights Reserved.