package customerSession;

/**
 * Insert the type's description here. Creation date: (9/1/00 11:07:47 AM)
 * 
 * @author: Administrator
 */

import javax.naming.*;
import javax.rmi.PortableRemoteObject;

import customerCMP13.CustomerCMPEntity;

import java.math.*;
import java.util.*;
import java.util.Properties;

import irwwbase.*;
import java.math.BigDecimal;

public class Client extends IRWWBase {

	private CustomerSessionLocal customerSessionLocal;

	private static java.lang.String _className;

	private static javax.ejb.EJBObject cacheCustomerSessionRef = null;

	private CustomerSession customerSessionRef = null;

	private customerSession.CustomerSessionAccessBean customerSessionAccessBean;

	private InitialContext initialContext = null;

	private CustomerSessionHome customerSessionHome = null;

	private CustomerSession customerSessionEntity = null;

	private String portNumber = null;

	private String hostName = null;

	private static final String DEFAULT_PROTOCOL = "IIOP";

	private static final String DEFAULT_HOST = "localhost";

	public static int waitTime;

	//private static final short remotePercentage = 85;
	private static final short idPercentage = 40;

	//private static final int maxPay = 5000;

	private java.lang.String[] oput = new String[28];

	private CustomerOutput customerOut = null;

	private short customerId;

	private short customerDistrictId;

	private short customerWarehouseId;

	private short numberCustomerId;

	private short numberCustomerDistrictId;

	private short numberCustomerWarehouseId;

	private short lowCustomerCreditLimit;

	private short highCustomerCreditLimit;

	private short numGCs, numBCs;

	private String customerState;

	private java.lang.String customerLastName;

	private String customerCredit;

	private boolean byLastName;

	private java.lang.String clientIdentifier;

	private boolean useCmp;

	private boolean distributed = true;

	private short entityType;

	private String outputLines[] = null;

	private String[] states = { "AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC",
			"DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA",
			"ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH",
			"NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC",
			"SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY" };

	private String orderType, aggType;

	private short cid;

	private short wid;

	private short did;

	private Collection resultCollection;

	private long result;

	private Vector resultsVector;

	/**
	 * PaymentClient constructor comment.
	 */
	public Client() {

		super();
		_className = (Client.class).getName();
	}

	/**
	 * Insert the method's description here. Creation date: (9/1/00 4:37:17 PM)
	 * 
	 * @return paySessionPackage.PayInput
	 * @param db
	 *            byte
	 */

	private CustomerInput generateCustomerInput(byte db) {
		ExtendedRandom rand = new ExtendedRandom();

		CustomerInput input = new CustomerInput();

		input.setCustomerWarehouseId((short) (rand.nextInt(MaxValues
				.warehouseId(db)) + 1));
		input.setCustomerDistrictId((short) (rand.nextInt(MaxValues
				.districtId(db)) + 1));

		if (rand.nextBoolProb(idPercentage, 100)) {
			input.setByLastName(false);
			input
					.setCustomerId((short) (rand.nextInt(MaxValues
							.customerId(db)) + 1));
			debugOut("%%% customerId = " + input.getCustomerId());
			input.setCustomerLastName(" ");
		} else {
			input.setByLastName(true);
			input.setCustomerLastName(rand.nextName(db));
			input.setCustomerId((short) 0);
		}

		//   input.useQueryServices = 1;
		input.setClientIdentifier(" ");

		return input;

	}

	//**
	/*
	 * Insert the method's description here. Creation date: (9/1/00 4:38:11 PM)
	 * @return paySessionPackage.PayOutput
	 */
	private CustomerOutput generateCustomerOutput() {

		CustomerOutput output = new CustomerOutput();

		output.setCustomerId((short) 0);
		output.setCustomerDistrictId((short) 0);
		output.setCustomerWarehouseId((short) 0);
		output.setCustomerFirstName(" ");
		output.setCustomerMiddleName(" ");
		output.setCustomerLastName(" ");
		output.setCustomerStreet1(" ");
		output.setCustomerStreet2(" ");
		output.setCustomerCity(" ");
		output.setCustomerState(" ");
		output.setCustomerZip(" ");
		output.setCustomerPhone(" ");
		output.setCustomerSince(" ");
		output.setCustomerCredit(" ");
		output.setCustomerCreditLimit(new java.math.BigDecimal(0));
		output.setCustomerDiscount(new java.math.BigDecimal(0));
		output.setCustomerBalance(new java.math.BigDecimal(0));
		output.setCustomerYTDPayment(new java.math.BigDecimal(0));
		output.setCustomerPaymentCount(new java.math.BigDecimal(0));
		output.setCustomerDeliveryCount(new java.math.BigDecimal(0));
		output.setCustomerData(" ");

		return output;

	}

	/**
	 * Insert the method's description here. Creation date: (9/1/00 4:39:28 PM)
	 */
	private void genOput(CustomerOutput output, CustomerInput input) {
		this.oput[0] = "****************************************************************************";
		this.oput[1] = "*                       ERWW Customer (second display)                     *";
		this.oput[2] = "*                                                                          *";
		this.oput[3] = "* Customer ID:           " + output.getCustomerId();
		this.oput[4] = "* Customer District ID:  "
				+ output.getCustomerDistrictId();
		this.oput[5] = "* Customer Warehouse ID: "
				+ output.getCustomerWarehouseId();
		this.oput[6] = "* ";
		this.oput[7] = "* Customer First Name:   "
				+ output.getCustomerFirstName();
		this.oput[8] = "* Customer Middle Name:  "
				+ output.getCustomerMiddleName();
		this.oput[9] = "* Customer Last Name:    "
				+ output.getCustomerLastName();
		this.oput[10] = "* Customer Street 1:     "
				+ output.getCustomerStreet1();
		this.oput[11] = "* Customer Street 2:     "
				+ output.getCustomerStreet2();
		this.oput[12] = "* Customer City:         " + output.getCustomerCity();
		this.oput[13] = "* Customer State:        " + output.getCustomerState();
		this.oput[14] = "* Customer Zip:          " + output.getCustomerZip();
		this.oput[15] = "* Customer Phone:        " + output.getCustomerPhone();
		this.oput[16] = "* ";
		this.oput[17] = "* Customer Since:        " + output.getCustomerSince();
		this.oput[18] = "* Customer Credit:       "
				+ output.getCustomerCredit();
		this.oput[19] = "* Customer Credit Limit: "
				+ output.getCustomerCreditLimit();
		this.oput[20] = "* Customer Discount:     "
				+ output.getCustomerDiscount();
		this.oput[21] = "* Customer Balance:      "
				+ output.getCustomerBalance();
		this.oput[22] = "* Customer YTD Payment:  "
				+ output.getCustomerYTDPayment();
		this.oput[23] = "* Customer Payment Count: "
				+ output.getCustomerPaymentCount();
		this.oput[24] = "* Customer Delivery Count: "
				+ output.getCustomerDeliveryCount();
		this.oput[25] = "* Customer Data:         " + output.getCustomerData();
		this.oput[26] = "*                                                                          *";
		this.oput[27] = "****************************************************************************";

	}

	/**
	 * Insert the method's description here. Creation date: (8/21/00 11:04:23
	 * AM)
	 * 
	 * @return javax.ejb.EJBObject
	 */
	public static javax.ejb.EJBObject getCacheCusotmerSessionRef() {
		return cacheCustomerSessionRef;
	}

	/**
	 * Insert the method's description here. Creation date: (10/3/2001 2:41:46
	 * PM)
	 * 
	 * @return java.lang.String[]
	 */
	public java.lang.String[] getOput() {
		return oput;
	}

	/**
	 * Insert the method's description here. Creation date: (8/21/00 11:04:57
	 * AM)
	 * 
	 * @return priceQuoteSessionPackage.PriceQuoteSession
	 */
	public CustomerSession getCustomerSessionRef() {
		return customerSessionRef;
	}

	/**
	 * Insert the method's description here. Creation date: (9/1/00 4:39:00 PM)
	 */
	private void initialDisplay(CustomerInput input) {
		System.out
				.println("****************************************************************************");
		System.out
				.println("*                      ERWW Customer (initial display)                      *");
		System.out
				.println("*                                                                          *");
		System.out.println("* Customer Warehouse ID:          "
				+ input.getCustomerWarehouseId());
		System.out.println("* Customer District ID:           "
				+ input.getCustomerDistrictId());
		if (input.isByLastName() == false) {
			System.out.println("* Customer ID:           "
					+ input.getCustomerId());
		} else {
			System.out.println("* Customer ID:           n/a");
		}
		if (input.isByLastName() == true) {
			System.out.println("* Customer Last Name:    "
					+ input.getCustomerLastName());
		} else {
			System.out.println("* Customer Last Name:    n/a");
		}
		System.out
				.println("*                                                                          *");
		System.out
				.println("****************************************************************************");

	}

	/**
	 * Starts the application.
	 * 
	 * @param args
	 *            an array of command-line arguments
	 */
	public static void main(java.lang.String[] args) throws UserException {

	}

	/**
	 * Insert the method's description here. Creation date: (9/1/00 11:22:20 AM)
	 * 
	 * @return customerSessionPackage.CustomerOutput
	 * @param input
	 *            customerSessionPackage.CustomerInput
	 * @exception javax.ejb.CreateException
	 *                The exception description.
	 * @exception java.rmi.RemoteException
	 *                The exception description.
	 * @exception javax.naming.NamingException
	 *                The exception description.
	 * @exception javax.ejb.FinderException
	 *                The exception description.
	 */
	/**
	 * Insert the method's description here. Creation date: (9/1/00 4:39:28 PM)
	 */
	private void secondDisplay(CustomerOutput output, CustomerInput input) {
		System.out
				.println("****************************************************************************");
		System.out
				.println("*                       Customer Output (second display)                     *");
		System.out
				.println("*                                                                          *");
		System.out
				.println("* Customer ID:           " + output.getCustomerId());
		System.out.println("* Customer District ID:  "
				+ output.getCustomerDistrictId());
		System.out.println("* Customer Warehouse ID: "
				+ output.getCustomerWarehouseId());
		System.out.println("* ");
		System.out
				.println("* Customer ID:           " + output.getCustomerId());
		System.out.println("* Customer District ID:  "
				+ output.getCustomerDistrictId());
		System.out.println("* Customer Warehouse ID: "
				+ output.getCustomerWarehouseId());
		System.out.println("* Customer First Name:   "
				+ output.getCustomerFirstName());
		System.out.println("* Customer Middle Name:  "
				+ output.getCustomerMiddleName());
		System.out.println("* Customer Last Name:    "
				+ output.getCustomerLastName());
		System.out.println("* Customer Street 1:     "
				+ output.getCustomerStreet1());
		System.out.println("* Customer Street 2:     "
				+ output.getCustomerStreet2());
		System.out.println("* Customer City:         "
				+ output.getCustomerCity());
		System.out.println("* Customer State:        "
				+ output.getCustomerState());
		System.out.println("* Customer Zip:          "
				+ output.getCustomerZip());
		System.out.println("* Customer Phone:        "
				+ output.getCustomerPhone());
		System.out.println("* ");
		System.out.println("* Customer Since:        "
				+ output.getCustomerSince());
		System.out.println("* Customer Credit:       "
				+ output.getCustomerCredit());
		System.out.println("* Customer Credit Limit: "
				+ output.getCustomerCreditLimit());
		System.out.println("* Customer Discount:     "
				+ output.getCustomerDiscount());
		System.out.println("* Customer Balance:      "
				+ output.getCustomerBalance());

		System.out.println("* Customer YTD Payment:  "
				+ output.getCustomerYTDPayment());
		System.out.println("* Customer Payment Count: "
				+ output.getCustomerPaymentCount());
		System.out.println("* Customer Delivery Count: "
				+ output.getCustomerDeliveryCount());
		System.out.println("* Customer Data:         "
				+ output.getCustomerData());
		System.out
				.println("*                                                                          *");
		System.out
				.println("****************************************************************************");

	}

	/**
	 * Insert the method's description here. Creation date: (8/21/00 11:04:23
	 * AM)
	 * 
	 * @param newCacheCustomerSessionRef
	 *            javax.ejb.EJBObject
	 */
	public static void setCacheCustomerSessionRef(
			javax.ejb.EJBObject newCacheCustomerSessionRef) {
		cacheCustomerSessionRef = newCacheCustomerSessionRef;
	}

	/**
	 * Insert the method's description here. Creation date: (10/3/2001 2:41:46
	 * PM)
	 * 
	 * @param newOput
	 *            java.lang.String[]
	 */
	public void setOput(java.lang.String[] newOput) {
		oput = newOput;
	}

	/**
	 * Insert the method's description here. Creation date: (8/21/00 11:04:57
	 * AM)
	 * 
	 * @param newCustomerSessionRef
	 *            customerSessionPackage.CustomerSession
	 */
	public void setCustomerSessionRef(CustomerSession newCustomerSessionRef) {
		customerSessionRef = newCustomerSessionRef;
	}

	public void webHoldableCursor() throws UserException {

		ExtendedRandom rand = new ExtendedRandom();
		String s = new String();
		displayOut("Running Web Customer - Holdable Cursor path");
		displayOut("Starting Time is: " + new java.util.Date().toString()
				+ ", milliseconds: "
				+ String.valueOf(System.currentTimeMillis()));

		CustomerHoldableCursorInput input = new CustomerHoldableCursorInput();
		CustomerHoldableCursorOutput output = null;

		//customerOutput = this.generateCustomerOutput();
		byte database = 1;
		database = dbSize();

		input.setCustomerWarehouseId(this.getCustomerWarehouseId());
		input.setNumberCustomerWarehouseId(this.getNumberCustomerWarehouseId());
		input.setCustomerDistrictId(this.getCustomerDistrictId());
		input.setNumberCustomerDistrictId(this.getNumberCustomerDistrictId());
		input.setCustomerId(this.getCustomerId());
		input.setNumberCustomerId(this.getNumberCustomerId());
		input.setLowCustomerCreditLimit(this.getLowCustomerCreditLimit());
		input.setHighCustomerCreditLimit(this.getHighCustomerCreditLimit());

		CustomerSessionAccessBean customerSessionAccessBean = new CustomerSessionAccessBean();

		customerSessionAccessBean
				.setInit_JNDIName("java:comp/env/ejb/customerSessionHome");

		try {
			output = customerSessionAccessBean.customerHoldableCursor(input);
		} catch (UserException uEx) {
			this.handleMainException(uEx, "Main", _className);
		} catch (java.lang.Exception uEx) {
			this.handleMainException(uEx, "Main", _className);
		}

		displayOut("Web Customer Holdable Cursor ran successfully");
		displayOut("Ending Time is: " + new java.util.Date().toString()
				+ ", milliseconds: "
				+ String.valueOf(System.currentTimeMillis()));

		this.setCustomerWarehouseId(output.getCustomerWarehouseId());
		this
				.setNumberCustomerWarehouseId(output
						.getNumberCustomerWarehouseId());
		this.setCustomerDistrictId(output.getCustomerDistrictId());
		this.setNumberCustomerDistrictId(output.getNumberCustomerDistrictId());
		this.setCustomerId(output.getCustomerId());
		this.setNumberCustomerId(output.getNumberCustomerId());
		this.setOutputLines(output.getOutputLines());

	}

	/**
	 * Insert the method's description here. Creation date: (10/3/2001 2:42:14
	 * PM)
	 */
	public void webMOR() throws UserException {

		ExtendedRandom rand = new ExtendedRandom();
		String s = new String();
		displayOut("Running Web Customer - AutoGen Multi-Open Result sets path");
		displayOut("Starting Time is: " + new java.util.Date().toString()
				+ ", milliseconds: "
				+ String.valueOf(System.currentTimeMillis()));

		CustomerMORInput input = new CustomerMORInput();
		CustomerMOROutput output = null;

		//customerOutput = this.generateCustomerOutput();
		byte database = 1;
		database = dbSize();

		input.setWarehouse((short) (rand.nextInt(MaxValues
				.warehouseId(database)) + 1));
		input.setState(states[rand.nextInt(51)]);

		CustomerSessionAccessBean customerSessionAccessBean = new CustomerSessionAccessBean();

		customerSessionAccessBean
				.setInit_JNDIName("java:comp/env/ejb/customerSessionHome");

		try {
			output = customerSessionAccessBean.queryCustomerCredit(input);
		} catch (UserException uEx) {
			this.handleMainException(uEx, "Main", _className);
		} catch (java.lang.Exception uEx) {
			this.handleMainException(uEx, "Main", _className);
		}

		displayOut("Web Customer MOR ran successfully");
		displayOut("Ending Time is: " + new java.util.Date().toString()
				+ ", milliseconds: "
				+ String.valueOf(System.currentTimeMillis()));

		//set output values int attrs
		customerState = output.getState();
		customerWarehouseId = output.getWarehouse();
		debugOut("<client> number of customers with BC="
				+ output.getBadCredit());
		debugOut("<client> number of customers with GC="
				+ output.getGoodCredit());
		numBCs = output.getBadCredit();
		numGCs = output.getGoodCredit();

	}

	/**
	 * Insert the method's description here. Creation date: (10/3/2001 2:42:14
	 * PM)
	 */
	public void webPortfolio() throws UserException {

		ExtendedRandom rand = new ExtendedRandom();
		String s = new String();
		displayOut("Running Web Customer - AutoGen Customer Portfolio path");
		displayOut("Starting Time is: " + new java.util.Date().toString()
				+ ", milliseconds: "
				+ String.valueOf(System.currentTimeMillis()));

		//customerOutput = this.generateCustomerOutput();
		byte database = 1;
		database = dbSize();

		cid = (short) (rand.nextInt(MaxValues.customerId(database)) + 1);
		did = (short) (rand.nextInt(MaxValues.districtId(database)) + 1);
		wid = (short) (rand.nextInt(MaxValues.warehouseId(database)) + 1);

		int num = rand.nextInt(0, 3);

		if (num == 0)
			aggType = "total";
		else if (num == 1)
			aggType = "min";
		else if (num == 2)
			aggType = "max";
		else if (num == 3)
			aggType = "average";
		else
			aggType = "total";

		CustomerSessionAccessBean customerSessionAccessBean = new CustomerSessionAccessBean();

		customerSessionAccessBean
				.setInit_JNDIName("java:comp/env/ejb/customerSessionHome");

		try {
			result = customerSessionAccessBean
					.portfolio(aggType, cid, did, wid);
		} catch (java.lang.Exception uEx) {
			this.handleMainException(uEx, "Main", _className);
		}

		num = rand.nextInt(0, 1);
		if (num == 0)
			orderType = "asc";
		else
			orderType = "desc";

		try {
			resultCollection = customerSessionAccessBean.balances(orderType,
					cid, wid);
		} catch (java.lang.Exception uEx) {
			this.handleMainException(uEx, "Main", _className);
		}
		/*Iterator it = resultCollection.iterator();
		resultsVector = new Vector();
		try {
			while (it.hasNext()) {
				CustomerCMPEntity ce = (CustomerCMPEntity) it.next();
				resultsVector.add(ce.getCustomerBalance());
			}
		} catch (Exception e) {
			e.printStackTrace();
			throw new UserException("error iterating over results and/or adding elements to vector",e.getMessage());
		}*/

		displayOut("Web Customer Portfolio ran successfully");
		displayOut("Ending Time is: " + new java.util.Date().toString()
				+ ", milliseconds: "
				+ String.valueOf(System.currentTimeMillis()));

	}

	/**
	 * Insert the method's description here. Creation date: (10/3/2001 2:42:14
	 * PM)
	 */
	public void web() throws UserException {

		String s = new String();
		displayOut("Running Web Customer - AutoGen path");
		displayOut("Starting Time is: " + new java.util.Date().toString()
				+ ", milliseconds: "
				+ String.valueOf(System.currentTimeMillis()));

		CustomerInput customerInput = new CustomerInput();
		CustomerOutput customerOutput = null;
		customerOutput = this.generateCustomerOutput();
		byte database = 1;
		database = dbSize();

		customerInput = this.generateCustomerInput(database);
		CustomerSessionAccessBean customerSessionAccessBean = null;
		try {

			if (isDistributed()) {
				customerSessionAccessBean = new CustomerSessionAccessBean();
				customerSessionAccessBean
						.setInit_JNDIName("java:comp/env/ejb/customerSessionHome");
			} else {
				if (customerSessionLocal == null) {
					InitialContext ic = new InitialContext();
					CustomerSessionLocalHome customerSessionLocalHome = (CustomerSessionLocalHome) ic
							.lookup("java:comp/env/ejb/customerSessionLocalHome");
					customerSessionLocal = customerSessionLocalHome.create();
				}
			}

		} catch (java.lang.Exception uEx) {
			this.handleMainException(uEx, "Main", _className);
		}

		customerInput.setUseCmp(getUseCmp());

		debugOut("entityType is " + this.getEntityType() + " in Client class.");
		customerInput.setEntityType(this.getEntityType());
		customerInput.setDistributed(isDistributed());

		try {
			if (isDistributed())
				customerOutput = customerSessionAccessBean
						.customerSession(customerInput);
			else
				customerOutput = customerSessionLocal
						.customerSession(customerInput);
		} catch (UserException uEx) {
			this.handleMainException(uEx, "Main", _className);
		} catch (java.lang.Exception uEx) {
			this.handleMainException(uEx, "Main", _className);
		}

		this.setCustomerCredit(customerOutput.getCustomerCredit());
		this.setCustomerOut(customerOutput);

		displayOut("Web Customer ran successfully");
		displayOut("Ending Time is: " + new java.util.Date().toString()
				+ ", milliseconds: "
				+ String.valueOf(System.currentTimeMillis()));

		//System.out.println("<<<length: "+this.getOput().length);
		this.genOput(customerOutput, customerInput);

	}

	public void webWithoutGen() throws UserException {

		String s = new String();
		displayOut("Running Web Customer - Manual Path ");
		displayOut("Starting Time is: " + new java.util.Date().toString()
				+ ", milliseconds: "
				+ String.valueOf(System.currentTimeMillis()));

		CustomerInput customerInput = new CustomerInput();
		CustomerOutput customerOutput = null;
		customerOutput = this.generateCustomerOutput();
		byte database = 1;
		database = dbSize();
		customerInput.setDistributed(isDistributed());

		try {

			if (isDistributed()) {
				customerSessionAccessBean = new CustomerSessionAccessBean();
				customerSessionAccessBean
						.setInit_JNDIName("java:comp/env/ejb/customerSessionHome");
			} else {
				if (customerSessionLocal == null) {
					InitialContext ic = new InitialContext();
					CustomerSessionLocalHome customerSessionLocalHome = (CustomerSessionLocalHome) ic
							.lookup("java:comp/env/ejb/customerSessionLocalHome");
					customerSessionLocal = customerSessionLocalHome.create();
				}
			}

		} catch (java.lang.Exception uEx) {
			this.handleMainException(uEx, "Main", _className);
		}

		customerInput.setUseCmp(getUseCmp());

		debugOut("entityType is " + this.getEntityType() + " in Client class.");
		customerInput.setEntityType(this.getEntityType());

		if (customerLastName == null || customerLastName.equals(" ")
				|| customerLastName.length() == 0) {
			customerInput.setByLastName(false);
		} else {
			customerInput.setByLastName(true);
		}

		if (getCustomerId() != 0) {
			customerInput.setCustomerId(getCustomerId());
		}

		if (getCustomerDistrictId() != 0) {
			customerInput.setCustomerDistrictId(getCustomerDistrictId());
		}

		if (getCustomerWarehouseId() != 0) {
			customerInput.setCustomerWarehouseId(getCustomerWarehouseId());
		}

		if (getCustomerLastName() != null) {
			customerInput.setCustomerLastName(getCustomerLastName());
		}

		if (getClientIdentifier() != null) {
			customerInput.setClientIdentifier(getClientIdentifier());
		}

		try {
			if (isDistributed())
				customerOutput = customerSessionAccessBean
						.customerSession(customerInput);
			else
				customerOutput = customerSessionLocal
						.customerSession(customerInput);
		} catch (UserException uEx) {
			this.handleMainException(uEx, "Main", _className);
		} catch (java.lang.Exception uEx) {
			this.handleMainException(uEx, "Main", _className);
		}

		displayOut("Web Customer ran successfully");
		displayOut("Ending Time is: " + new java.util.Date().toString()
				+ ", milliseconds: "
				+ String.valueOf(System.currentTimeMillis()));

		this.genOput(customerOutput, customerInput);

	}

	/**
	 * Gets the useCmp
	 * 
	 * @return Returns a boolean
	 */
	public boolean getUseCmp() {
		return useCmp;
	}

	/**
	 * Sets the useCmp
	 * 
	 * @param useCmp
	 *            The useCmp to set
	 */
	public void setUseCmp(boolean useCmp) {
		this.useCmp = useCmp;
	}

	/**
	 * Gets the customerId
	 * 
	 * @return Returns a short
	 */
	public short getCustomerId() {
		return customerId;
	}

	/**
	 * Sets the customerId
	 * 
	 * @param customerId
	 *            The customerId to set
	 */
	public void setCustomerId(short customerId) {
		this.customerId = customerId;
	}

	/**
	 * Gets the customerDistrictId
	 * 
	 * @return Returns a short
	 */
	public short getCustomerDistrictId() {
		return customerDistrictId;
	}

	/**
	 * Sets the customerDistrictId
	 * 
	 * @param customerDistrictId
	 *            The customerDistrictId to set
	 */
	public void setCustomerDistrictId(short customerDistrictId) {
		this.customerDistrictId = customerDistrictId;
	}

	/**
	 * Gets the customerWarehouseId
	 * 
	 * @return Returns a short
	 */
	public short getCustomerWarehouseId() {
		return customerWarehouseId;
	}

	/**
	 * Sets the customerWarehouseId
	 * 
	 * @param customerWarehouseId
	 *            The customerWarehouseId to set
	 */
	public void setCustomerWarehouseId(short customerWarehouseId) {
		this.customerWarehouseId = customerWarehouseId;
	}

	/**
	 * Gets the customerLastName
	 * 
	 * @return Returns a java.lang.String
	 */
	public java.lang.String getCustomerLastName() {
		return customerLastName;
	}

	/**
	 * Sets the customerLastName
	 * 
	 * @param customerLastName
	 *            The customerLastName to set
	 */
	public void setCustomerLastName(java.lang.String customerLastName) {
		this.customerLastName = customerLastName;
	}

	/**
	 * Gets the byLastName
	 * 
	 * @return Returns a boolean
	 */
	public boolean getByLastName() {
		return byLastName;
	}

	/**
	 * Sets the byLastName
	 * 
	 * @param byLastName
	 *            The byLastName to set
	 */
	public void setByLastName(boolean byLastName) {
		this.byLastName = byLastName;
	}

	/**
	 * Gets the clientIdentifier
	 * 
	 * @return Returns a java.lang.String
	 */
	public java.lang.String getClientIdentifier() {
		return clientIdentifier;
	}

	/**
	 * Sets the clientIdentifier
	 * 
	 * @param clientIdentifier
	 *            The clientIdentifier to set
	 */
	public void setClientIdentifier(java.lang.String clientIdentifier) {
		this.clientIdentifier = clientIdentifier;
	}

	/**
	 * @return
	 */
	public String getPortNumber() {
		return portNumber;
	}

	/**
	 * @param string
	 */
	public void setPortNumber(String string) {
		portNumber = string;
	}

	/**
	 * @return
	 */
	public String getHostName() {
		return hostName;
	}

	/**
	 * @param string
	 */
	public void setHostName(String string) {
		hostName = string;
	}

	/**
	 * @return
	 */
	public static java.lang.String get_className() {
		return _className;
	}

	/**
	 * @return
	 */
	public static String getDEFAULT_HOST() {
		return DEFAULT_HOST;
	}

	/**
	 * @return
	 */
	public static String getDEFAULT_PROTOCOL() {
		return DEFAULT_PROTOCOL;
	}

	/**
	 * @return
	 */
	public static short getIdPercentage() {
		return idPercentage;
	}

	/**
	 * @return
	 */
	/*
	 * public static int getMaxPay() { return maxPay; }
	 */

	/**
	 * @return
	 */
	/*
	 * public static short getRemotePercentage() { return remotePercentage; }
	 */

	/**
	 * @return
	 */
	public static int getWaitTime() {
		return waitTime;
	}

	/**
	 * @return
	 */
	public InitialContext getInitialContext() {
		return initialContext;
	}

	/**
	 * @return
	 */
	public customerSession.CustomerSessionAccessBean getCustomerSessionAccessBean() {
		return customerSessionAccessBean;
	}

	/**
	 * @return
	 */
	public CustomerSession getCustomerSessionEntity() {
		return customerSessionEntity;
	}

	/**
	 * @return
	 */
	public CustomerSessionHome getCustomerSessionHome() {
		return customerSessionHome;
	}

	/**
	 * @param string
	 */
	public static void set_className(java.lang.String string) {
		_className = string;
	}

	/**
	 * @param i
	 */
	public static void setWaitTime(int i) {
		waitTime = i;
	}

	/**
	 * @param context
	 */
	public void setInitialContext(InitialContext context) {
		initialContext = context;
	}

	/**
	 * @param bean
	 */
	public void setCustomerSessionAccessBean(
			customerSession.CustomerSessionAccessBean bean) {
		customerSessionAccessBean = bean;
	}

	/**
	 * @param session
	 */
	public void setCustomerSessionEntity(CustomerSession session) {
		customerSessionEntity = session;
	}

	/**
	 * @param home
	 */
	public void setCustomerSessionHome(CustomerSessionHome home) {
		customerSessionHome = home;
	}

	/**
	 * @return
	 */
	public String getCustomerState() {
		return customerState;
	}

	/**
	 * @return
	 */
	public short getNumBCs() {
		return numBCs;
	}

	/**
	 * @return
	 */
	public short getNumGCs() {
		return numGCs;
	}

	/**
	 * @param string
	 */
	public void setCustomerState(String string) {
		customerState = string;
	}

	/**
	 * @param s
	 */
	public void setNumBCs(short s) {
		numBCs = s;
	}

	/**
	 * @param s
	 */
	public void setNumGCs(short s) {
		numGCs = s;
	}

	/**
	 * @return
	 */
	public short getEntityType() {
		return entityType;
	}

	/**
	 * @param s
	 */
	public void setEntityType(short s) {
		entityType = s;
	}

	/**
	 * @return
	 */
	public short getNumberCustomerId() {
		return numberCustomerId;
	}

	/**
	 * @param s
	 */
	public void setNumberCustomerId(short s) {
		numberCustomerId = s;
	}

	/**
	 * @return
	 */
	public short getNumberCustomerDistrictId() {
		return numberCustomerDistrictId;
	}

	/**
	 * @param s
	 */
	public void setNumberCustomerDistrictId(short s) {
		numberCustomerDistrictId = s;
	}

	/**
	 * @return
	 */
	public short getNumberCustomerWarehouseId() {
		return numberCustomerWarehouseId;
	}

	/**
	 * @param s
	 */
	public void setNumberCustomerWarehouseId(short s) {
		numberCustomerWarehouseId = s;
	}

	/**
	 * @return
	 */
	public short getLowCustomerCreditLimit() {
		return lowCustomerCreditLimit;
	}

	/**
	 * @param s
	 */
	public void setLowCustomerCreditLimit(short s) {
		lowCustomerCreditLimit = s;
	}

	/**
	 * @return
	 */
	public short getHighCustomerCreditLimit() {
		return highCustomerCreditLimit;
	}

	/**
	 * @param s
	 */
	public void setHighCustomerCreditLimit(short s) {
		highCustomerCreditLimit = s;
	}

	/**
	 * @return
	 */
	public boolean isDistributed() {
		return distributed;
	}

	/**
	 * @param b
	 */
	public void setDistributed(boolean b) {
		distributed = b;
	}

	/**
	 * @return
	 */
	public String[] getOutputLines() {
		return outputLines;
	}

	/**
	 * @param strings
	 */
	public void setOutputLines(String[] strings) {
		outputLines = strings;
	}

	/**
	 * @return Returns the customerCredit.
	 */
	public String getCustomerCredit() {
		return customerCredit;
	}

	/**
	 * @param customerCredit
	 *            The customerCredit to set.
	 */
	public void setCustomerCredit(String customerCredit) {
		this.customerCredit = customerCredit;
	}

	/**
	 * @return Returns the customerOut.
	 */
	public CustomerOutput getCustomerOut() {
		return customerOut;
	}

	/**
	 * @param customerOut
	 *            The customerOut to set.
	 */
	public void setCustomerOut(CustomerOutput customerOut) {
		this.customerOut = customerOut;
	}

	public long getResult() {
		return result;
	}

	public void setResult(long result) {
		this.result = result;
	}

	public Collection getResultCollection() {
		return resultCollection;
	}

	public void setResultCollection(Collection resultCollection) {
		this.resultCollection = resultCollection;
	}

	public String getAggType() {
		return aggType;
	}

	public void setAggType(String aggType) {
		this.aggType = aggType;
	}

	public String getOrderType() {
		return orderType;
	}

	public void setOrderType(String orderType) {
		this.orderType = orderType;
	}

	public short getCid() {
		return cid;
	}

	public void setCid(short cid) {
		this.cid = cid;
	}

	public short getDid() {
		return did;
	}

	public void setDid(short did) {
		this.did = did;
	}

	public short getWid() {
		return wid;
	}

	public void setWid(short wid) {
		this.wid = wid;
	}
	public Vector getResultsVector() {
		return resultsVector;
	}
	public void setResultsVector(Vector resultsVector) {
		this.resultsVector = resultsVector;
	}
}