// CustomerHome.java

package org.objectweb.jonas.stests.appli;

import java.rmi.RemoteException;
import java.util.Enumeration;

import javax.ejb.CreateException;
import javax.ejb.EJBHome;
import javax.ejb.FinderException;


/**
 * Home interface for the Customer.  This will handle all lifecycle
 * related operations for the class of Customers:  creation, location,
 * deletion.
 * <p>
 * Several finder methods are provided to locate customers according
 * to various search criteria.
 */

public interface CustomerHome extends EJBHome {


	/**
     * Create a new Customer with minimal information.
	 * <p>
     * @param id Customer ID for the customer being created, must be unique
     * @param fN First name of the customer
     * @param lN Last name of the customer
     * @param phone Phone number of the customer
     * @return Customer
     * @exception javax.ejb.CreateException Creation Exception
     * @exception java.rmi.RemoteException Remote Exception
     */
 
    public Customer create(Integer Id, String fN, String lN, String phone)
        throws CreateException, RemoteException;
 

	/**
     * Create a new Customer with all parameters, except balances which will automatically
     * be initialized to zero
	 * <p>
     * @param id Customer ID for the customer being created, must be unique
     * @param fN First name of the customer
     * @param lN Last name of the customer
     * @param inits Middle initials of the customer
     * @param phone Phone number of the customer
     * @param addr1 First address line of the customer
     * @param addr2 Second address line of the customer
     * @param city City of the customer's mailing address
     * @param state State of the customer's mailing address
     * @param zip Zip code of the customer's mailing address
     * @param creditLimit Credit limit allowed for this cusomter
     * @return Customer
     * @exception javax.ejb.CreateException Creation Exception
     * @exception java.rmi.RemoteException Remote Exception
	 */

    public Customer create(Integer Id, String fN, String lN, String inits, 
                           String addr1, String addr2,
                           String city, String state, String zip,
                           String phone,
                           float creditLimit)
        throws CreateException, RemoteException;


	/**
     * Retrieve an individual customer by their customer ID number.
	 * <p>
     * @param primaryKey Primary key to find the customer with
     * @return Customer
     * @exception javax.ejb.FinderException Find Exception
     * @exception java.rmi.RemoteException Remote Exception
	 */

    public Customer findByPrimaryKey(Integer primaryKey)
        throws FinderException, RemoteException;


	/**
     * Retrieve all of the customers with a given last name.
	 * <p>
     * <strong>Note:</strong>This returns a list of 1 or more customers with the specified last name
     * @param primaryKey Primary key to find the customer with
     * @return Customer
     * @exception javax.ejb.FinderException Find Exception
     * @exception java.rmi.RemoteException Remote Exception
	 */

    public Enumeration findCustomers(String lastName)
        throws FinderException, RemoteException;


	/**
     * Retrieve all of the customers.
	 * <p>
     * @return Enumeration
     * @exception javax.ejb.FinderException Find Exception
     * @exception java.rmi.RemoteException Remote Exception
	 */

    public Enumeration findAllCustomers()
        throws FinderException, RemoteException;

}

