// OrderEntryClerk.java

package org.objectweb.jonas.stests.appli;

import java.util.Vector;
import java.rmi.RemoteException;
import javax.ejb.EJBObject;

/**
 * OrderEntryClerk remote interface
 */
public interface OrderEntryClerk extends EJBObject {

   /**
     * Retrieve all available customers
     *
     * @return Vector
     * @exception java.rmi.RemoteException Remote exception
     */
 
    public Vector findAllCustomers() throws RemoteException;

    /**
     * Set the current cutomer for this stateful Session Bean.
     * <p>
     * @param cid Customer ID to set <i>(Mandatory)</i>
     * @return void
     * @exception CpwejbException Application exception
     * @exception java.rmi.RemoteException Remote exception
     */
   public void setCustomer(Integer cid) throws RemoteException, CpwejbException;

   /**
     * Find all available items
     * <p>
     * <strong>Note:</strong> This method will return a Vector of String Arrays 
     * each String Array contains:
     * <ul>
     * <li> String 0 - Item ID
     * <li> String 1 - Item Description
     * <li> String 2 - Item Price
     * <li> String 3 - Item Quantity in Stock
     * <li> String 4 - Item Data
     * </ul>
     * @return Vector
     * @exception java.rmi.RemoteException Remote exception
     */
   public Vector findAllItems() throws RemoteException;
   /**
     * Retrieve available items within a range of item IDs
     * <p>
     * <strong>Note:</strong> This method will return a Vector of String Arrays 
     * each String Array contains:
     * <ul>
     * <li> String 0 - Item ID
     * <li> String 1 - Item Description
     * <li> String 2 - Item Price
     * <li> String 3 - Item Quantity in Stock
     * <li> String 4 - Item Data
     * </ul>
     * @return Vector
     * @exception java.rmi.RemoteException Remote exception
     */
  
    public Vector findRangeOfItems(Integer lowID, Integer highID) throws RemoteException;

 
    /**
     * Create an order detail (order line).  Add an item and quantity to the order.
     * <p>
     * @param iid Item ID to set <i>(Mandatory)</i>
     * @param quantity amount of the item to be placed on order <i>(Mandatory)</i>
     * @return void
     * @exception java.rmi.RemoteException Remote exception
     */
 
    public void addOrderLine(Integer iid, int quantity) throws RemoteException;

 
    /* The undoAll method : added by BULL */
    /**
     * Reset the OrderEntryClerk state ie the current customer and the current order
     */
 
    public void undoAll() throws RemoteException;

 
    /**
     * Verify the existence of a customer in this districts tables.
     * <p>
     * @param cid Customer ID to check for <i>(Mandatory)</i>
     * @return boolean
     * @exception java.rmi.RemoteException Remote exception
     */
 
    public boolean verifyCustomer(Integer cid) throws RemoteException;

 
    /**
     * Place an order.
     * If successful, this method will return the order number
     * <p>
     * @return String
     * @exception CpwejbException Application exception
     * @exception java.rmi.RemoteException Remote exception
     */
 
    public String placeOrder() throws RemoteException, CpwejbException;

    /**
     * Get the cutomer for a given order.  The order is located by its warehouse,
     * district, and order number.  The returned information is:
     * <ul>
     * <li> String 0 - Customer ID
     * <li> String 1 - Customer first name
     * <li> String 2 - Customer initials
     * <li> String 3 - Customer last name
     * </ul>
     * <p>
     * @param wid Warehouse ID
     * @param did District ID
     * @param oid Order ID
     * @return String
     * @exception CpwejbException Application exception
     * @exception java.rmi.RemoteException Remote exception
     */

    public String[] getCustomerForOrder(String wid, int did, int oid) 
        throws RemoteException, CpwejbException;


    /**
     * Get the items list for a given order.  The order is located by its warehouse,
     * district, and order number.  The return information is:
     * <ul>
     * <li> String 0 - Order line number
     * <li> String 1 - Item description
     * <li> String 2 - Item quanity
     * <li> String 3 - Order line amount
     * </ul>
     * <p>
     * @param wid Warehouse ID
     * @param did District ID
     * @param oid Order ID
     * @return Vector
     * @exception CpwejbException Application exception
     * @exception java.rmi.RemoteException Remote exception
     */

    public Vector getItemsForOrder(String wid, int did, int oid) 
        throws RemoteException, CpwejbException;

    // only for testing purpose
    public void createAllTables() throws RemoteException, CpwejbException;
  
}
