|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.konakart.bl.BaseMgr
com.konakart.bl.CustomerMgr
public class CustomerMgr
Customer Manager
| Nested Class Summary | |
|---|---|
protected class |
CustomerMgr.StaticData
Used to store the static data of this manager |
| Field Summary | |
|---|---|
static int |
CUST_TYPE_ADMIN_USER
An Admin user |
static int |
CUST_TYPE_DEFAULT_CUST
Default customer |
static int |
CUST_TYPE_NON_REGISTERED_CUST
A customer that hasn't registered |
static int |
CUST_TYPE_REGISTERED_CUST
A customer that has registered normally |
protected static boolean |
DEFAULT_DELETE_REVIEWS
|
protected static org.apache.commons.logging.Log |
log
the log |
protected static java.lang.String |
mutex
|
protected static java.util.Map<java.lang.String,CustomerMgr.StaticData> |
staticDataHM
Hash Map that contains the static data |
| Fields inherited from class com.konakart.bl.BaseMgr |
|---|
templateBaseDir |
| Constructor Summary | |
|---|---|
CustomerMgr(KKEngIf eng)
Constructor |
|
| Method Summary | |
|---|---|
int |
addAddressToCustomer(java.lang.String sessionId,
AddressIf addr)
The Address object is added to the customer defined by the SessionId. |
void |
addProductNotificationToCustomer(java.lang.String sessionId,
int productId)
Adds a product notification to the customer referenced by the session id |
void |
deleteAddressFromCustomer(java.lang.String sessionId,
int addressId)
The address defined by customerId and addressId is deleted. |
protected void |
deleteCustomer(int custId)
Deletes a customer from the database. |
protected void |
deleteCustomerReviews(int custId,
java.sql.Connection con)
Deletes a customer's reviews from the database. |
void |
deleteProductNotificationFromCustomer(java.lang.String sessionId,
int productId)
Deletes a product notification from the customer referenced by the session id |
protected boolean |
deleteReviews()
Utility method to return the konakart.delete_reviews property value |
protected boolean |
doesCountryExist(int countryId)
|
boolean |
doesCustomerExistForEmail(java.lang.String emailAddr)
Checks to see whether a customer already exists with this email address. |
protected boolean |
doesCustomerExistForId(int custId)
Checks to see whether a customer already exists with this id |
protected boolean |
doesZoneExist(java.lang.String zoneDesc,
int countryId)
If a country has at least one zone defined in the database, then we assume that all zones are defined and ensure that we only allow zones that are defined in the database. |
void |
editCustomer(java.lang.String sessionId,
CustomerIf cust)
Updates the customer data with the data in the Customer object passed in as a parameter. |
void |
editCustomerAddress(java.lang.String sessionId,
AddressIf addr)
The Address object will replace the existing address object in the database with the same id. |
void |
enableCustomer(int customerId)
Enables the customer identified by the customer id. |
int |
forceRegisterCustomer(CustomerRegistrationIf custReg)
A new customer is added to the system. |
Address |
getAddress(int addressId)
Returns the address object for the given address id. |
protected Address[] |
getAddressesPerCustomer(Customer customer)
Returns all of the addresses registered for the given customer. |
Address[] |
getAddressesPerCustomer(java.lang.String sessionId)
Returns all of the addresses registered for the given customer. |
java.lang.String |
getAddressFormatTemplate(int id)
Does a query on the address_format table |
CustomerGroup[] |
getAllCustomerGroups(int languageId)
Returns an array of customer groups for all customer groups that have been defined in the system. |
Address |
getCountryAndZonePerCustomer(Customer cust)
Returns the default address for the given customer. |
Address |
getCountryAndZonePerCustomer(int customerId)
Returns the default address for the given customer. |
Address |
getCountryAndZonePerCustomer(java.lang.String sessionId)
Returns the default address for the given customer. |
Customer |
getCustomer(java.lang.String sessionId)
Returns the customer object for the customer defined by the given sessionId. |
Customer |
getCustomerForEmail(java.lang.String emailAddr)
Checks to see whether a customer already exists with this email address. |
Customer |
getCustomerForId(int customerId)
Returns the customer object for the customer defined by the given id. |
CustomerGroup |
getCustomerGroup(int customerGroupId,
int languageId)
Returns a customer group object for the customerGroupId passed in as a parameter. |
CustomerGroup |
getCustomerGroupFromCache(int customerGroupId)
Gets the CustomerGroup object for the customerGroupId and default language from the cache. |
protected Customer[] |
getCustomers(CustomerSearch custSearch)
Retrieves an array of customers from the database that match the specified criteria in the CustomerSearch input object. |
Address |
getDefaultAddressPerCustomer(Customer cust)
Returns the default address for the given customer. |
Address |
getDefaultAddressPerCustomer(java.lang.String sessionId)
Returns the default address for the given customer. |
Customer |
getDefaultCustomer()
Returns the customer object for the default customer. |
java.lang.String |
getNameFromId(int custId)
|
Product[] |
getProductNotificationsPerCustomer(java.lang.String sessionId,
int languageId)
Returns an array of products for which the customer referenced by sessionId will be notified on. |
Product[] |
getProductNotificationsPerCustomerWithOptions(java.lang.String sessionId,
int languageId,
FetchProductOptionsIf options)
Returns an array of products for which the customer referenced by sessionId will be notified on. |
int |
getTempCustomerId()
Returns an available unique temporary id. |
void |
incrementLogonCount(int customerId)
This method is not exposed to the web interface because it isn't secure. |
protected void |
populateCustomerGroupHashMap(CustomerMgr.StaticData sd)
If the hash map is set to null or the refreshCustGroupMapFlag is set, then we populated the hash map with the customer groups in the default language. |
void |
refreshConfigs()
Refresh the configuration of the Customer manager |
int |
registerCustomer(CustomerRegistrationIf custReg)
A new customer is added to the system. |
int |
registerCustomerPrivate(CustomerRegistrationIf custReg,
boolean force)
A new customer is added to the system. |
KKCriteria |
setAllAddrAttrs(KKCriteria c)
Used by other managers to avoid repeating code. |
void |
setCustomerPassword(int customerId,
java.lang.String password)
Sets the customer password. |
void |
setCustomerType(int customerId,
int type)
Sets the customer type. |
void |
setDefaultAddressPerCustomer(java.lang.String sessionId,
int addressId)
Sets the default address for this customer to be the addressId passed in as a parameter. |
protected void |
updateCustomerReviews(int custId,
java.sql.Connection con)
Updates a customer's reviews by setting the custId to null. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.apache.commons.logging.Log log
public static final int CUST_TYPE_REGISTERED_CUST
public static final int CUST_TYPE_ADMIN_USER
public static final int CUST_TYPE_NON_REGISTERED_CUST
public static final int CUST_TYPE_DEFAULT_CUST
protected static final boolean DEFAULT_DELETE_REVIEWS
protected static java.util.Map<java.lang.String,CustomerMgr.StaticData> staticDataHM
protected static java.lang.String mutex
| Constructor Detail |
|---|
public CustomerMgr(KKEngIf eng)
throws java.lang.Exception
eng -
java.lang.Exception| Method Detail |
|---|
protected boolean deleteReviews()
public int forceRegisterCustomer(CustomerRegistrationIf custReg)
throws java.lang.Exception
forceRegisterCustomer in interface CustomerMgrIfcustReg -
java.lang.Exception
public int registerCustomer(CustomerRegistrationIf custReg)
throws java.lang.Exception
Alter table t Engine = InnoDB;. The standard engine seems to be MyIsam which
doesn't support transactions.
registerCustomer in interface CustomerMgrIfcustReg -
java.lang.Exception
public int registerCustomerPrivate(CustomerRegistrationIf custReg,
boolean force)
throws java.lang.Exception
Alter table t Engine = InnoDB;. The standard engine seems to be MyIsam which
doesn't support transactions.
registerCustomerPrivate in interface CustomerMgrIfcustReg - force - If set, then we modify the registration rather than throwing an exception if the
customer already exists
java.lang.Exception
public void editCustomer(java.lang.String sessionId,
CustomerIf cust)
throws java.lang.Exception
editCustomer in interface CustomerMgrIfsessionId - cust -
java.lang.Exception
public void setCustomerPassword(int customerId,
java.lang.String password)
throws java.lang.Exception
setCustomerPassword in interface CustomerMgrIfcustomerId - password -
java.lang.Exception
public void setCustomerType(int customerId,
int type)
throws java.lang.Exception
setCustomerType in interface CustomerMgrIfcustomerId - type -
java.lang.Exception
public void incrementLogonCount(int customerId)
throws org.apache.torque.TorqueException,
KKException,
com.workingdogs.village.DataSetException
incrementLogonCount in interface CustomerMgrIfcustomerId -
org.apache.torque.TorqueException
KKException
com.workingdogs.village.DataSetException
protected Customer[] getCustomers(CustomerSearch custSearch)
throws java.lang.Exception
custSearch - CustomerSearch object
java.lang.Exception
protected void deleteCustomer(int custId)
throws java.lang.Exception
Removes records from :
Parameters :
custId -
java.lang.Exception
protected void deleteCustomerReviews(int custId,
java.sql.Connection con)
throws java.lang.Exception
Removes records from :
Parameters :
custId - con -
java.lang.Exception
protected void updateCustomerReviews(int custId,
java.sql.Connection con)
throws java.lang.Exception
Updates records from :
Parameters :
custId - con -
java.lang.Exception
public boolean doesCustomerExistForEmail(java.lang.String emailAddr)
throws org.apache.torque.TorqueException,
KKException,
com.workingdogs.village.DataSetException
doesCustomerExistForEmail in interface CustomerMgrIfemailAddr -
org.apache.torque.TorqueException
KKException
com.workingdogs.village.DataSetException
public Customer getCustomerForEmail(java.lang.String emailAddr)
throws java.lang.Exception
getCustomerForEmail in interface CustomerMgrIfemailAddr -
java.lang.Exception
protected boolean doesCustomerExistForId(int custId)
throws org.apache.torque.TorqueException,
KKException
custId -
org.apache.torque.TorqueException
KKException
public java.lang.String getNameFromId(int custId)
throws org.apache.torque.TorqueException,
com.workingdogs.village.DataSetException,
KKException
getNameFromId in interface CustomerMgrIfcustId -
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKException
public Customer getCustomer(java.lang.String sessionId)
throws java.lang.Exception
getCustomer in interface CustomerMgrIfsessionId -
java.lang.Exception
public Customer getCustomerForId(int customerId)
throws java.lang.Exception
getCustomerForId in interface CustomerMgrIfcustomerId -
java.lang.Exception
public Customer getDefaultCustomer()
throws java.lang.Exception
getDefaultCustomer in interface CustomerMgrIfjava.lang.Exception
protected boolean doesCountryExist(int countryId)
throws org.apache.torque.TorqueException,
KKException
countryId -
org.apache.torque.TorqueException
KKException
public Address[] getAddressesPerCustomer(java.lang.String sessionId)
throws java.lang.Exception
getAddressesPerCustomer in interface CustomerMgrIfsessionId -
java.lang.Exception
public Address getDefaultAddressPerCustomer(java.lang.String sessionId)
throws java.lang.Exception
getDefaultAddressPerCustomer in interface CustomerMgrIfsessionId -
java.lang.Exception
public Address getDefaultAddressPerCustomer(Customer cust)
throws java.lang.Exception
getDefaultAddressPerCustomer in interface CustomerMgrIfcust -
java.lang.Exception
public Address getCountryAndZonePerCustomer(java.lang.String sessionId)
throws java.lang.Exception
getCountryAndZonePerCustomer in interface CustomerMgrIfsessionId -
java.lang.Exception
public Address getCountryAndZonePerCustomer(int customerId)
throws java.lang.Exception
getCountryAndZonePerCustomer in interface CustomerMgrIfcustomerId -
java.lang.Exception
public Address getCountryAndZonePerCustomer(Customer cust)
throws java.lang.Exception
getCountryAndZonePerCustomer in interface CustomerMgrIfcust -
java.lang.Exception
public void setDefaultAddressPerCustomer(java.lang.String sessionId,
int addressId)
throws java.lang.Exception
setDefaultAddressPerCustomer in interface CustomerMgrIfsessionId - addressId -
java.lang.Exception
protected Address[] getAddressesPerCustomer(Customer customer)
throws java.lang.Exception
customer -
java.lang.Exception
public Address getAddress(int addressId)
throws java.lang.Exception
getAddress in interface CustomerMgrIfaddressId -
java.lang.Exception
public int addAddressToCustomer(java.lang.String sessionId,
AddressIf addr)
throws java.lang.Exception
addAddressToCustomer in interface CustomerMgrIfsessionId - addr -
java.lang.Exception
public void deleteAddressFromCustomer(java.lang.String sessionId,
int addressId)
throws java.lang.Exception
deleteAddressFromCustomer in interface CustomerMgrIfsessionId - addressId -
java.lang.Exception
public void editCustomerAddress(java.lang.String sessionId,
AddressIf addr)
throws java.lang.Exception
editCustomerAddress in interface CustomerMgrIfsessionId - addr -
java.lang.Exceptionpublic KKCriteria setAllAddrAttrs(KKCriteria c)
CustomerMgrIf
setAllAddrAttrs in interface CustomerMgrIfc -
public java.lang.String getAddressFormatTemplate(int id)
throws org.apache.torque.TorqueException,
com.workingdogs.village.DataSetException,
KKException
getAddressFormatTemplate in interface CustomerMgrIfid -
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKException
public void addProductNotificationToCustomer(java.lang.String sessionId,
int productId)
throws java.lang.Exception
CustomerMgrIf
addProductNotificationToCustomer in interface CustomerMgrIfsessionId - productId -
java.lang.Exception
public void deleteProductNotificationFromCustomer(java.lang.String sessionId,
int productId)
throws java.lang.Exception
CustomerMgrIf
deleteProductNotificationFromCustomer in interface CustomerMgrIfsessionId - productId -
java.lang.Exception
public Product[] getProductNotificationsPerCustomer(java.lang.String sessionId,
int languageId)
throws java.lang.Exception
CustomerMgrIf
getProductNotificationsPerCustomer in interface CustomerMgrIfsessionId - languageId -
java.lang.Exception
public Product[] getProductNotificationsPerCustomerWithOptions(java.lang.String sessionId,
int languageId,
FetchProductOptionsIf options)
throws java.lang.Exception
CustomerMgrIf
getProductNotificationsPerCustomerWithOptions in interface CustomerMgrIfsessionId - languageId - options -
java.lang.Exception
protected boolean doesZoneExist(java.lang.String zoneDesc,
int countryId)
throws java.lang.Exception
zoneDesc - countryId -
java.lang.Exception
public int getTempCustomerId()
throws org.apache.torque.TorqueException,
KKException
CustomerMgrIf
getTempCustomerId in interface CustomerMgrIforg.apache.torque.TorqueException
KKException
public CustomerGroup[] getAllCustomerGroups(int languageId)
throws java.lang.Exception
getAllCustomerGroups in interface CustomerMgrIflanguageId - The id for the language that will be used to determine the customer group name and
description. Value of -1 selects the default language.
java.lang.Exception
public CustomerGroup getCustomerGroup(int customerGroupId,
int languageId)
throws java.lang.Exception
getCustomerGroup in interface CustomerMgrIfcustomerGroupId - languageId - The id for the language that will be used to determine the customer group name and
description. Value of -1 selects the default language.
java.lang.Exception
public CustomerGroup getCustomerGroupFromCache(int customerGroupId)
throws java.lang.Exception
getCustomerGroupFromCache in interface CustomerMgrIfcustomerGroupId -
java.lang.Exception
protected void populateCustomerGroupHashMap(CustomerMgr.StaticData sd)
throws java.lang.Exception
java.lang.Exception
public void refreshConfigs()
throws KKException
refreshConfigs in interface CustomerMgrIfKKException
public void enableCustomer(int customerId)
throws KKException,
org.apache.torque.TorqueException
enableCustomer in interface CustomerMgrIfcustomerId -
org.apache.torque.TorqueException
KKException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||