com.konakart.bl
Class CustomerMgr

java.lang.Object
  extended by com.konakart.bl.BaseMgr
      extended by com.konakart.bl.CustomerMgr
All Implemented Interfaces:
CustomerMgrIf

public class CustomerMgr
extends BaseMgr
implements CustomerMgrIf

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 com.konakart.bl.BaseMgr
addInsertAttr, addInsertAttr, checkRequired, executeQuery, executeQuery, getAdminEngMgr, getBasketMgr, getBillingMgr, getBookableProductMgr, getCatMgr, getConfigMgr, getCookieMgr, getCurrMgr, getCustMgr, getCustomerIdFromSession, getCustomerStatsMgr, getCustomerTagMgr, getEmailMgr, getEng, getLangMgr, getManuMgr, getMiscItemMgr, getMode, getModeString, getMqMgr, getMultiStoreMgr, getNewCriteria, getNewCriteria, getOrderIntegrationMgr, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getPromMgr, getPunchOutMgr, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreId, getTaxMgr, getTemplate, getTemplateRoot, getVelocityContextMgr, getWishListMgr, init, isDeadlockException, isEnterprise, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareProducts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the log


CUST_TYPE_REGISTERED_CUST

public static final int CUST_TYPE_REGISTERED_CUST
A customer that has registered normally

See Also:
Constant Field Values

CUST_TYPE_ADMIN_USER

public static final int CUST_TYPE_ADMIN_USER
An Admin user

See Also:
Constant Field Values

CUST_TYPE_NON_REGISTERED_CUST

public static final int CUST_TYPE_NON_REGISTERED_CUST
A customer that hasn't registered

See Also:
Constant Field Values

CUST_TYPE_DEFAULT_CUST

public static final int CUST_TYPE_DEFAULT_CUST
Default customer

See Also:
Constant Field Values

DEFAULT_DELETE_REVIEWS

protected static final boolean DEFAULT_DELETE_REVIEWS
See Also:
Constant Field Values

staticDataHM

protected static java.util.Map<java.lang.String,CustomerMgr.StaticData> staticDataHM
Hash Map that contains the static data


mutex

protected static java.lang.String mutex
Constructor Detail

CustomerMgr

public CustomerMgr(KKEngIf eng)
            throws java.lang.Exception
Constructor

Parameters:
eng -
Throws:
java.lang.Exception
Method Detail

deleteReviews

protected boolean deleteReviews()
Utility method to return the konakart.delete_reviews property value

Returns:
Value of the property value (true or false)

forceRegisterCustomer

public int forceRegisterCustomer(CustomerRegistrationIf custReg)
                          throws java.lang.Exception
A new customer is added to the system. The process for adding a new customer is to :
  1. Insert information in the Customers table where a new primary key is generated
  2. Insert address information in the address_book table
  3. Update the customer record with the address id
  4. Insert a customers_info record with the same PK as the customer
If the customer already exists, we modify the registration rather than throwing an exception.

Specified by:
forceRegisterCustomer in interface CustomerMgrIf
Parameters:
custReg -
Returns:
int : Customer Id
Throws:
java.lang.Exception

registerCustomer

public int registerCustomer(CustomerRegistrationIf custReg)
                     throws java.lang.Exception
A new customer is added to the system. The process for adding a new customer is to :
  1. Insert information in the Customers table where a new primary key is generated
  2. Insert address information in the address_book table
  3. Update the customer record with the address id
  4. Insert a customers_info record with the same PK as the customer
All of the above actions are performed as a transaction. In the case of MySQL, the transaction doesn't work unless the tables are defined as using the InnoDB or BDB engines. A table can be transformed using the following syntax : Alter table t Engine = InnoDB;. The standard engine seems to be MyIsam which doesn't support transactions.

Specified by:
registerCustomer in interface CustomerMgrIf
Parameters:
custReg -
Returns:
int : Customer Id
Throws:
java.lang.Exception

registerCustomerPrivate

public int registerCustomerPrivate(CustomerRegistrationIf custReg,
                                   boolean force)
                            throws java.lang.Exception
A new customer is added to the system. The process for adding a new customer is to :
  1. Insert information in the Customers table where a new primary key is generated
  2. Insert address information in the address_book table
  3. Update the customer record with the address id
  4. Insert a customers_info record with the same PK as the customer
All of the above actions are performed as a transaction. In the case of MySQL, the transaction doesn't work unless the tables are defined as using the InnoDB or BDB engines. A table can be transformed using the following syntax : Alter table t Engine = InnoDB;. The standard engine seems to be MyIsam which doesn't support transactions.

Specified by:
registerCustomerPrivate in interface CustomerMgrIf
Parameters:
custReg -
force - If set, then we modify the registration rather than throwing an exception if the customer already exists
Returns:
int : Customer Id
Throws:
java.lang.Exception

editCustomer

public void editCustomer(java.lang.String sessionId,
                         CustomerIf cust)
                  throws java.lang.Exception
Updates the customer data with the data in the Customer object passed in as a parameter. We also update the default address of the customer if it originally existed.

Specified by:
editCustomer in interface CustomerMgrIf
Parameters:
sessionId -
cust -
Throws:
java.lang.Exception

setCustomerPassword

public void setCustomerPassword(int customerId,
                                java.lang.String password)
                         throws java.lang.Exception
Sets the customer password.

Specified by:
setCustomerPassword in interface CustomerMgrIf
Parameters:
customerId -
password -
Throws:
java.lang.Exception

setCustomerType

public void setCustomerType(int customerId,
                            int type)
                     throws java.lang.Exception
Sets the customer type.

Specified by:
setCustomerType in interface CustomerMgrIf
Parameters:
customerId -
type -
Throws:
java.lang.Exception

incrementLogonCount

public void incrementLogonCount(int customerId)
                         throws org.apache.torque.TorqueException,
                                KKException,
                                com.workingdogs.village.DataSetException
This method is not exposed to the web interface because it isn't secure. It increments the logon count attribute of the customers_info table.

Specified by:
incrementLogonCount in interface CustomerMgrIf
Parameters:
customerId -
Throws:
org.apache.torque.TorqueException
KKException
com.workingdogs.village.DataSetException

getCustomers

protected Customer[] getCustomers(CustomerSearch custSearch)
                           throws java.lang.Exception
Retrieves an array of customers from the database that match the specified criteria in the CustomerSearch input object. If custId is specified (>=0) that alone is used and only one customer will be returned. Otherwise any non-null values for the following attributes are used:
  1. firstname
  2. lastname
  3. dob
  4. emailaddr

Parameters:
custSearch - CustomerSearch object
Returns:
Customer[] : an array of Customer Records or nil if no customers are found
Throws:
java.lang.Exception

deleteCustomer

protected void deleteCustomer(int custId)
                       throws java.lang.Exception
Deletes a customer from the database. If the property "delete_reviews" is set to "on" the reviews created by this customer will be removed. If not, the customerID associated with the reviews will be set to null but the reviews will remain.

Removes records from :

Parameters :

Parameters:
custId -
Throws:
java.lang.Exception

deleteCustomerReviews

protected void deleteCustomerReviews(int custId,
                                     java.sql.Connection con)
                              throws java.lang.Exception
Deletes a customer's reviews from the database. This is a dependent transaction - commits, rollbacks should be handled by the caller.

Removes records from :

Parameters :

Parameters:
custId -
con -
Throws:
java.lang.Exception

updateCustomerReviews

protected void updateCustomerReviews(int custId,
                                     java.sql.Connection con)
                              throws java.lang.Exception
Updates a customer's reviews by setting the custId to null. This is a dependent transaction - commits, rollbacks should be handled by the caller.

Updates records from :

Parameters :

Parameters:
custId -
con -
Throws:
java.lang.Exception

doesCustomerExistForEmail

public boolean doesCustomerExistForEmail(java.lang.String emailAddr)
                                  throws org.apache.torque.TorqueException,
                                         KKException,
                                         com.workingdogs.village.DataSetException
Checks to see whether a customer already exists with this email address. If a customer does exist, but it is a non registered customer then we act as if no customer exists.

Specified by:
doesCustomerExistForEmail in interface CustomerMgrIf
Parameters:
emailAddr -
Returns:
Returns true if the customer already exists
Throws:
org.apache.torque.TorqueException
KKException
com.workingdogs.village.DataSetException

getCustomerForEmail

public Customer getCustomerForEmail(java.lang.String emailAddr)
                             throws java.lang.Exception
Checks to see whether a customer already exists with this email address.

Specified by:
getCustomerForEmail in interface CustomerMgrIf
Parameters:
emailAddr -
Returns:
Returns a Customer object if the customer already exists
Throws:
java.lang.Exception

doesCustomerExistForId

protected boolean doesCustomerExistForId(int custId)
                                  throws org.apache.torque.TorqueException,
                                         KKException
Checks to see whether a customer already exists with this id

Parameters:
custId -
Returns:
Returns true if the customer already exists
Throws:
org.apache.torque.TorqueException
KKException

getNameFromId

public java.lang.String getNameFromId(int custId)
                               throws org.apache.torque.TorqueException,
                                      com.workingdogs.village.DataSetException,
                                      KKException
Specified by:
getNameFromId in interface CustomerMgrIf
Parameters:
custId -
Returns:
Returns the customer's name
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKException

getCustomer

public Customer getCustomer(java.lang.String sessionId)
                     throws java.lang.Exception
Returns the customer object for the customer defined by the given sessionId. Throws an exception if the session has expired.

Specified by:
getCustomer in interface CustomerMgrIf
Parameters:
sessionId -
Returns:
Customer Object or Null if the customer doesn't exist.
Throws:
java.lang.Exception

getCustomerForId

public Customer getCustomerForId(int customerId)
                          throws java.lang.Exception
Returns the customer object for the customer defined by the given id.

Specified by:
getCustomerForId in interface CustomerMgrIf
Parameters:
customerId -
Returns:
Customer Object or Null if the customer doesn't exist.
Throws:
java.lang.Exception

getDefaultCustomer

public Customer getDefaultCustomer()
                            throws java.lang.Exception
Returns the customer object for the default customer. If more than one default customer exists, it returns one of the customers found. The default customer can be configured in the Admin App. It is a fictitious customer with a real address that is used to create a temporary order even when a customer is not logged in or hasn't registered yet. The order totals of this temporary order are displayed in the cart details screen to give an indication of shipping costs and to display any available discounts.

Specified by:
getDefaultCustomer in interface CustomerMgrIf
Returns:
Customer Object or Null if the default customer doesn't exist.
Throws:
java.lang.Exception

doesCountryExist

protected boolean doesCountryExist(int countryId)
                            throws org.apache.torque.TorqueException,
                                   KKException
Parameters:
countryId -
Returns:
True if the country referenced by countryId exists. Otherwise return false.
Throws:
org.apache.torque.TorqueException
KKException

getAddressesPerCustomer

public Address[] getAddressesPerCustomer(java.lang.String sessionId)
                                  throws java.lang.Exception
Returns all of the addresses registered for the given customer. An exception is thrown if the sessionid isn't valid.

Specified by:
getAddressesPerCustomer in interface CustomerMgrIf
Parameters:
sessionId -
Returns:
An array of address objects where the first one is the primary address. Returns an empty array if no addresses exist.
Throws:
java.lang.Exception

getDefaultAddressPerCustomer

public Address getDefaultAddressPerCustomer(java.lang.String sessionId)
                                     throws java.lang.Exception
Returns the default address for the given customer. An exception is thrown if the sessionid isn't valid.

Specified by:
getDefaultAddressPerCustomer in interface CustomerMgrIf
Parameters:
sessionId -
Returns:
An address object
Throws:
java.lang.Exception

getDefaultAddressPerCustomer

public Address getDefaultAddressPerCustomer(Customer cust)
                                     throws java.lang.Exception
Returns the default address for the given customer. An exception is thrown if the cust is null.

Specified by:
getDefaultAddressPerCustomer in interface CustomerMgrIf
Parameters:
cust -
Returns:
An address object
Throws:
java.lang.Exception

getCountryAndZonePerCustomer

public Address getCountryAndZonePerCustomer(java.lang.String sessionId)
                                     throws java.lang.Exception
Returns the default address for the given customer. An exception is thrown if the sessionid isn't valid. The default address is only populated with countryId and zoneId.

Specified by:
getCountryAndZonePerCustomer in interface CustomerMgrIf
Parameters:
sessionId -
Returns:
An address object
Throws:
java.lang.Exception

getCountryAndZonePerCustomer

public Address getCountryAndZonePerCustomer(int customerId)
                                     throws java.lang.Exception
Returns the default address for the given customer. The default address is only populated with countryId and zoneId.

Specified by:
getCountryAndZonePerCustomer in interface CustomerMgrIf
Parameters:
customerId -
Returns:
An address object
Throws:
java.lang.Exception

getCountryAndZonePerCustomer

public Address getCountryAndZonePerCustomer(Customer cust)
                                     throws java.lang.Exception
Returns the default address for the given customer. The default address is only populated with countryId and zoneId.

Specified by:
getCountryAndZonePerCustomer in interface CustomerMgrIf
Parameters:
cust -
Returns:
An address object
Throws:
java.lang.Exception

setDefaultAddressPerCustomer

public void setDefaultAddressPerCustomer(java.lang.String sessionId,
                                         int addressId)
                                  throws java.lang.Exception
Sets the default address for this customer to be the addressId passed in as a parameter. First we check that an address exists with that id and that it belongs to the customer logged in with the session id.

Specified by:
setDefaultAddressPerCustomer in interface CustomerMgrIf
Parameters:
sessionId -
addressId -
Throws:
java.lang.Exception

getAddressesPerCustomer

protected Address[] getAddressesPerCustomer(Customer customer)
                                     throws java.lang.Exception
Returns all of the addresses registered for the given customer.

Parameters:
customer -
Returns:
An array of address objects where the first one is the primary address. Returns an empty array if no addresses exist.
Throws:
java.lang.Exception

getAddress

public Address getAddress(int addressId)
                   throws java.lang.Exception
Returns the address object for the given address id. Returns null if it doesn't exist.

Specified by:
getAddress in interface CustomerMgrIf
Parameters:
addressId -
Returns:
An address object or null if it doesn't exist.
Throws:
java.lang.Exception

addAddressToCustomer

public int addAddressToCustomer(java.lang.String sessionId,
                                AddressIf addr)
                         throws java.lang.Exception
The Address object is added to the customer defined by the SessionId. The id of the address object is ignored since it is calculated during the insertion process. The zoneId is also calculated unless addr.isUseZoneId()is set to true. In this case the zoneId from the address object is used. The customerId of the address object is also ignored. An exception is thrown if the sessionId isn't valid.

Specified by:
addAddressToCustomer in interface CustomerMgrIf
Parameters:
sessionId -
addr -
Returns:
Id of the new address object
Throws:
java.lang.Exception

deleteAddressFromCustomer

public void deleteAddressFromCustomer(java.lang.String sessionId,
                                      int addressId)
                               throws java.lang.Exception
The address defined by customerId and addressId is deleted. The customerId is retrieved from the session. An exception is thrown if the session isn't valid or we are trying to delete the default address.

Specified by:
deleteAddressFromCustomer in interface CustomerMgrIf
Parameters:
sessionId -
addressId -
Throws:
java.lang.Exception

editCustomerAddress

public void editCustomerAddress(java.lang.String sessionId,
                                AddressIf addr)
                         throws java.lang.Exception
The Address object will replace the existing address object in the database with the same id. A check is made to verify that the address object belongs to the customer logged in with the sessionId passed in as a parameter. The zoneId is ignored since it is calculated during the insertion process, unless addr.isUseZoneId()is set to true. In this case the zoneId from the address object is used. The addressId is used to identify the address object. The customerId of the address object is ignored since it is obtained from the sessionId. An exception is thrown if the session isn't valid.

Specified by:
editCustomerAddress in interface CustomerMgrIf
Parameters:
sessionId -
addr -
Throws:
java.lang.Exception

setAllAddrAttrs

public KKCriteria setAllAddrAttrs(KKCriteria c)
Description copied from interface: CustomerMgrIf
Used by other managers to avoid repeating code. It returns the criteria object with all address attributes set.

Specified by:
setAllAddrAttrs in interface CustomerMgrIf
Parameters:
c -
Returns:
The criteria object with all address attributes set

getAddressFormatTemplate

public java.lang.String getAddressFormatTemplate(int id)
                                          throws org.apache.torque.TorqueException,
                                                 com.workingdogs.village.DataSetException,
                                                 KKException
Does a query on the address_format table

Specified by:
getAddressFormatTemplate in interface CustomerMgrIf
Parameters:
id -
Returns:
Returns the template referenced by the id parameter
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKException

addProductNotificationToCustomer

public void addProductNotificationToCustomer(java.lang.String sessionId,
                                             int productId)
                                      throws java.lang.Exception
Description copied from interface: CustomerMgrIf
Adds a product notification to the customer referenced by the session id

Specified by:
addProductNotificationToCustomer in interface CustomerMgrIf
Parameters:
sessionId -
productId -
Throws:
java.lang.Exception

deleteProductNotificationFromCustomer

public void deleteProductNotificationFromCustomer(java.lang.String sessionId,
                                                  int productId)
                                           throws java.lang.Exception
Description copied from interface: CustomerMgrIf
Deletes a product notification from the customer referenced by the session id

Specified by:
deleteProductNotificationFromCustomer in interface CustomerMgrIf
Parameters:
sessionId -
productId -
Throws:
java.lang.Exception

getProductNotificationsPerCustomer

public Product[] getProductNotificationsPerCustomer(java.lang.String sessionId,
                                                    int languageId)
                                             throws java.lang.Exception
Description copied from interface: CustomerMgrIf
Returns an array of products for which the customer referenced by sessionId will be notified on.

Specified by:
getProductNotificationsPerCustomer in interface CustomerMgrIf
Parameters:
sessionId -
languageId -
Returns:
Array of products
Throws:
java.lang.Exception

getProductNotificationsPerCustomerWithOptions

public Product[] getProductNotificationsPerCustomerWithOptions(java.lang.String sessionId,
                                                               int languageId,
                                                               FetchProductOptionsIf options)
                                                        throws java.lang.Exception
Description copied from interface: CustomerMgrIf
Returns an array of products for which the customer referenced by sessionId will be notified on. An options object is passed in to customize from where some of the product attributes (such as price and quantity) are fetched from.

Specified by:
getProductNotificationsPerCustomerWithOptions in interface CustomerMgrIf
Parameters:
sessionId -
languageId -
options -
Returns:
Array of products
Throws:
java.lang.Exception

doesZoneExist

protected boolean doesZoneExist(java.lang.String zoneDesc,
                                int countryId)
                         throws java.lang.Exception
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. Otherwise we allow the user to register an address with any string as the zone.

Parameters:
zoneDesc -
countryId -
Returns:
True if the zone exists in the country referenced by countryId or the country has no zones defined. Otherwise return false.
Throws:
java.lang.Exception

getTempCustomerId

public int getTempCustomerId()
                      throws org.apache.torque.TorqueException,
                             KKException
Description copied from interface: CustomerMgrIf
Returns an available unique temporary id.

Specified by:
getTempCustomerId in interface CustomerMgrIf
Returns:
The latest temporaryId
Throws:
org.apache.torque.TorqueException
KKException

getAllCustomerGroups

public CustomerGroup[] getAllCustomerGroups(int languageId)
                                     throws java.lang.Exception
Returns an array of customer groups for all customer groups that have been defined in the system. The groups returned are those for the language defined by languageId.

Specified by:
getAllCustomerGroups in interface CustomerMgrIf
Parameters:
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.
Returns:
An array of customer group objects.
Throws:
java.lang.Exception

getCustomerGroup

public CustomerGroup getCustomerGroup(int customerGroupId,
                                      int languageId)
                               throws java.lang.Exception
Returns a customer group object for the customerGroupId passed in as a parameter.

Specified by:
getCustomerGroup in interface CustomerMgrIf
Parameters:
customerGroupId -
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.
Returns:
A customer group object.
Throws:
java.lang.Exception

getCustomerGroupFromCache

public CustomerGroup getCustomerGroupFromCache(int customerGroupId)
                                        throws java.lang.Exception
Gets the CustomerGroup object for the customerGroupId and default language from the cache.

Specified by:
getCustomerGroupFromCache in interface CustomerMgrIf
Parameters:
customerGroupId -
Returns:
Returns a CustomerGroup object
Throws:
java.lang.Exception

populateCustomerGroupHashMap

protected void populateCustomerGroupHashMap(CustomerMgr.StaticData sd)
                                     throws java.lang.Exception
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. Otherwise we just return.

Throws:
java.lang.Exception

refreshConfigs

public void refreshConfigs()
                    throws KKException
Refresh the configuration of the Customer manager

Specified by:
refreshConfigs in interface CustomerMgrIf
Throws:
KKException

enableCustomer

public void enableCustomer(int customerId)
                    throws KKException,
                           org.apache.torque.TorqueException
Enables the customer identified by the customer id. If the customer doesn't exist then an exception is thrown.

Specified by:
enableCustomer in interface CustomerMgrIf
Parameters:
customerId -
Throws:
org.apache.torque.TorqueException
KKException


Copyright © 2011 DS Data Systems UK Ltd.