|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.elasticpath.service.impl.AbstractEpServiceImpl
com.elasticpath.service.impl.AbstractEpPersistenceServiceImpl
com.elasticpath.service.customer.impl.CustomerServiceImpl
public class CustomerServiceImpl
The default implementation of CustomerService.
| Constructor Summary | |
|---|---|
CustomerServiceImpl()
|
|
| Method Summary | |
|---|---|
Customer |
add(Customer customer)
Adds the given customer. |
Customer |
addCustomerAddress(Customer customer,
CustomerAddress address)
Adds an address to a customer. |
Customer |
addCustomerCreditCard(Customer customer,
CustomerCreditCard creditCard)
Adds a credit card to a customer. |
Customer |
deleteCustomerAddresses(Customer customer)
This is a workaround for deleteing address(s) since Hibernate can not cascade delete entity object in a collection if it not removed from the collection loaded in the same session. |
Customer |
deleteCustomerCreditCards(Customer customer)
This is a workaround for deleteing credit card(s) since Hibernate can not cascade delete entity object in a collection if it not removed from the collection loaded in the same session. |
boolean |
emailExists(Customer customer)
Check the given customer's email exists or not. |
java.util.List |
findAllUids()
Returns all customer uids as a list. |
java.util.List |
findByEmail(java.lang.String email)
Find the customer with the given email address. |
Customer |
findByGuid(java.lang.String guid)
Retrieve the customer with the given guid. |
java.util.List |
findByUids(java.util.Collection customerUids)
Returns a list of Customer based on the given uids. |
java.util.List |
findByUserId(java.lang.String userId)
Find the customer with the given userId address. |
java.util.List |
findCustomerByCriteria(CustomerSearchCriteria customerSearchCriteria)
Retrieve the list of customers, whose specified property contain the given criteria value. |
java.util.List |
findCustomerLike(java.lang.String propertyName,
java.lang.String criteriaValue)
Retrieve the list of customers, whose specified property contain the given criteria value. |
Customer |
findNonAnonymousByEmail(java.lang.String email)
Find the non-anonymous customer with the given email address. |
Customer |
findNonAnonymousByUserId(java.lang.String userId)
Find the non-anonymous customer with the given userId address. |
java.util.List |
findUidsByDeletedDate(java.util.Date date)
Retrieves list of customer uids where the deleted date is later than the specified date. |
java.util.List |
findUidsByModifiedDate(java.util.Date date)
Retrieves list of Customer uids where the last modified date is later than the specified date. |
Customer |
get(long customerUid)
Get the customer with the given UID. |
java.lang.Object |
getObject(long uid)
Generic load method for all persistable domain models. |
boolean |
isEmailExists(java.lang.String email)
Checks the given email exists or not. |
boolean |
isUserIdExists(java.lang.String userId)
Checks the given user Id exists or not. |
java.util.List |
list()
Lists all customers stored in the database. |
Customer |
load(long customerUid)
Load the customer with the given UID. |
void |
remove(Customer customer)
Deletes the customer. |
void |
resetPassword(java.lang.String userId)
Resets the customer's password for the specified email. |
void |
setCustomerDefaultGroup(Customer customer)
Adds a customer to the default customer group (ensuring that they have the default role). |
void |
setCustomerGroupService(CustomerGroupService customerGroupService)
Set the customerGroupService instance. |
void |
setCustomerSessionService(CustomerSessionService customerSessionService)
Set the customerSessionService instance. |
void |
setEmailService(EmailService emailService)
Set the emailService. |
void |
setIndexSearchService(IndexSearchService indexSearchService)
Set the indexSearchService instance. |
void |
setPassword(Customer customer,
java.lang.String newPassword)
Changes the password for the specified customer. |
void |
setUserIdentityService(UserIdentityService userIdentityService)
Set the userIdentityService instance. |
void |
setUtility(Utility utility)
Sets the utility. |
Customer |
update(Customer customer)
Updates the given customer. |
boolean |
userIdExists(Customer customer)
Check the given customer's user Id exists or not. |
void |
validateNewCustomer(Customer customer)
Validate the new customer has the valid email address (not used by any existing non-anonymous customer). |
| Methods inherited from class com.elasticpath.service.impl.AbstractEpPersistenceServiceImpl |
|---|
getPersistenceEngine, setPersistenceEngine |
| Methods inherited from class com.elasticpath.service.impl.AbstractEpServiceImpl |
|---|
getElasticPath, setElasticPath |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.elasticpath.service.EpPersistenceService |
|---|
getPersistenceEngine, setPersistenceEngine |
| Methods inherited from interface com.elasticpath.service.EpService |
|---|
getElasticPath, setElasticPath |
| Constructor Detail |
|---|
public CustomerServiceImpl()
| Method Detail |
|---|
public Customer add(Customer customer)
throws UserIdExistException
add in interface CustomerServicecustomer - the customer to add
UserIdExistException - - if trying to add an customer using an user Id.
public Customer addCustomerAddress(Customer customer,
CustomerAddress address)
addCustomerAddress in interface CustomerServicecustomer - The customer who is adding an addressaddress - The address to be added to the customer
public Customer addCustomerCreditCard(Customer customer,
CustomerCreditCard creditCard)
addCustomerCreditCard in interface CustomerServicecustomer - The customer who is adding a credit cardcreditCard - The credit card to be added to the customer
public Customer deleteCustomerAddresses(Customer customer)
deleteCustomerAddresses in interface CustomerServicecustomer - The customer whose address list has been updated
public Customer deleteCustomerCreditCards(Customer customer)
deleteCustomerCreditCards in interface CustomerServicecustomer - The customer whose credit card list has been updated
public boolean emailExists(Customer customer)
throws EpServiceException
emailExists in interface CustomerServicecustomer - the customer to check
EpServiceException - - in case of any errorspublic java.util.List findAllUids()
findAllUids in interface CustomerService
public java.util.List findByEmail(java.lang.String email)
throws EpServiceException
findByEmail in interface CustomerServiceemail - the customer email address
EpServiceException - - in case of any errors
public Customer findByGuid(java.lang.String guid)
throws EpServiceException
findByGuid in interface CustomerServiceguid - the guid of the customer
EpServiceException - in case of any errorpublic java.util.List findByUids(java.util.Collection customerUids)
Customer based on the given uids. The returned customers will be populated based on the given load tuner.
findByUids in interface CustomerServicecustomerUids - a collection of customer uids
Customers
public java.util.List findByUserId(java.lang.String userId)
throws EpServiceException
findByUserId in interface CustomerServiceuserId - the customer userId address
EpServiceException - - in case of any errorspublic java.util.List findCustomerByCriteria(CustomerSearchCriteria customerSearchCriteria)
findCustomerByCriteria in interface CustomerServicecustomerSearchCriteria - criteria for customer search.
public java.util.List findCustomerLike(java.lang.String propertyName,
java.lang.String criteriaValue)
findCustomerLike in interface CustomerServicepropertyName - customer property to search on.criteriaValue - criteria value to be used for searching.
public Customer findNonAnonymousByEmail(java.lang.String email)
throws EpServiceException
findNonAnonymousByEmail in interface CustomerServiceemail - the customer email address
EpServiceException - - in case of any errors
public Customer findNonAnonymousByUserId(java.lang.String userId)
throws EpServiceException
findNonAnonymousByUserId in interface CustomerServiceuserId - the customer userId address
EpServiceException - - in case of any errorspublic java.util.List findUidsByDeletedDate(java.util.Date date)
findUidsByDeletedDate in interface CustomerServicedate - date to compare with the deleted date
public java.util.List findUidsByModifiedDate(java.util.Date date)
Customer uids where the last modified date is later than the specified date.
findUidsByModifiedDate in interface CustomerServicedate - date to compare with the last modified date
Customer whose last modified date is later than the specified date
public Customer get(long customerUid)
throws EpServiceException
get in interface CustomerServicecustomerUid - the customer UID
EpServiceException - - in case of any errors
public java.lang.Object getObject(long uid)
throws EpServiceException
getObject in interface EpPersistenceServiceuid - the persisted instance uid
EpServiceException - - in case of any errors
public boolean isEmailExists(java.lang.String email)
throws EpServiceException
isEmailExists in interface CustomerServiceemail - the user Id
EpServiceException - - in case of any errors
public boolean isUserIdExists(java.lang.String userId)
throws EpServiceException
isUserIdExists in interface CustomerServiceuserId - the user Id
EpServiceException - - in case of any errors
public java.util.List list()
throws EpServiceException
list in interface CustomerServiceEpServiceException - - in case of any errors
public Customer load(long customerUid)
throws EpServiceException
load in interface CustomerServicecustomerUid - the customer UID
EpServiceException - - in case of any errors
public void remove(Customer customer)
throws EpServiceException
remove in interface CustomerServicecustomer - the customer to remove
EpServiceException - - in case of any errors
public void resetPassword(java.lang.String userId)
throws UserIdNonExistException
resetPassword in interface CustomerServiceuserId - The user Id of the customer whose password is to be reset
UserIdNonExistException - if the user Id isn't found
public void setCustomerDefaultGroup(Customer customer)
throws EpServiceException
setCustomerDefaultGroup in interface CustomerServicecustomer - the customer upon which to set the default group
EpServiceException - in case of any errors.public void setCustomerGroupService(CustomerGroupService customerGroupService)
customerGroupService - the customerGroupService instance.public void setCustomerSessionService(CustomerSessionService customerSessionService)
setCustomerSessionService in interface CustomerServicecustomerSessionService - the customerSessionService instance.public void setEmailService(EmailService emailService)
emailService - the emailServicepublic void setIndexSearchService(IndexSearchService indexSearchService)
indexSearchService - the indexSearchService instance.
public void setPassword(Customer customer,
java.lang.String newPassword)
setPassword in interface CustomerServicecustomer - the customer whose password is to be changednewPassword - the new password (clear text)public void setUserIdentityService(UserIdentityService userIdentityService)
setUserIdentityService in interface CustomerServiceuserIdentityService - the userIdentityService instance.public void setUtility(Utility utility)
utility - the utility to set
public Customer update(Customer customer)
throws UserIdExistException
update in interface CustomerServicecustomer - the customer to update
UserIdExistException - - if the customer's new user Id is already in use by another existing customer.
public boolean userIdExists(Customer customer)
throws EpServiceException
userIdExists in interface CustomerServicecustomer - the customer to check
EpServiceException - - in case of any errors
public void validateNewCustomer(Customer customer)
throws EmailExistException
validateNewCustomer in interface CustomerServicecustomer - the nre customer.
EmailExistException - - if the new customer's email address already exists in system.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||