public class DefaultCustomerFacade extends java.lang.Object implements CustomerFacade
CustomerFacade.| Constructor and Description |
|---|
DefaultCustomerFacade() |
| Modifier and Type | Method and Description |
|---|---|
void |
changeGuestToCustomer(java.lang.String pwd,
java.lang.String orderGUID)
Create a regular customer from a guest customer who has just completed the guest checkout.
|
void |
changePassword(java.lang.String oldPassword,
java.lang.String newPassword)
Changes current user password.
|
void |
changeUid(java.lang.String newUid,
java.lang.String currentPassword)
Change the current customer's UID.
|
CustomerData |
closeAccount()
Close Account for current session user.
|
void |
createGuestUserForAnonymousCheckout(java.lang.String email,
java.lang.String name)
Creates a new guest customer for anonymousCheckout and sets the email and name.
|
void |
forgottenPassword(java.lang.String uid)
Sends a forgotten password request for the customer specified.
|
java.lang.String |
generateGUID()
Generates a customer ID during registration
|
protected Converter<AddressModel,AddressData> |
getAddressConverter() |
protected Populator<AddressData,AddressModel> |
getAddressReversePopulator() |
protected BaseSiteService |
getBaseSiteService() |
protected BaseStoreService |
getBaseStoreService() |
protected CartCleanStrategy |
getCartCleanStrategy() |
protected CartService |
getCartService() |
protected CommerceCartService |
getCommerceCartService() |
protected CommonI18NService |
getCommonI18NService() |
protected Converter<CreditCardPaymentInfoModel,CCPaymentInfoData> |
getCreditCardPaymentInfoConverter() |
CustomerData |
getCurrentCustomer()
Returns the current session user.
|
java.lang.String |
getCurrentCustomerUid()
Returns the uid of current session user.
|
protected CustomerModel |
getCurrentSessionCustomer() |
protected UserModel |
getCurrentUser() |
protected CustomerAccountService |
getCustomerAccountService() |
protected Converter<UserModel,CustomerData> |
getCustomerConverter() |
protected CustomerNameStrategy |
getCustomerNameStrategy() |
protected Populator<CustomerData,UserModel> |
getCustomerReversePopulator() |
EventService |
getEventService() |
protected ModelService |
getModelService() |
protected OrderFacade |
getOrderFacade() |
protected PasswordEncoderService |
getPasswordEncoderService() |
protected SessionService |
getSessionService() |
protected StoreSessionFacade |
getStoreSessionFacade() |
protected Converter<TitleModel,TitleData> |
getTitleConverter() |
protected UserFacade |
getUserFacade() |
CustomerData |
getUserForUID(java.lang.String userId)
Gets the user for UID.
|
protected UserService |
getUserService() |
protected AbstractCommerceUserEvent |
initializeCommerceEvent(AbstractCommerceUserEvent event,
CustomerModel customerModel) |
void |
loginSuccess()
updates the session currency and language to the user settings, assigns the cart to the current user and
calculates the cart
|
void |
register(RegisterData registerData)
Register a user with given parameters
|
void |
rememberMeLoginSuccessWithUrlEncoding(boolean languageEncoding,
boolean currencyEncoding)
This method will be used by rememberMeServices when there is encoding attributes for language and currency.
|
void |
setAddressConverter(Converter<AddressModel,AddressData> addressConverter) |
void |
setAddressReversePopulator(Populator<AddressData,AddressModel> addressReversePopulator) |
void |
setBaseSiteService(BaseSiteService siteService) |
void |
setBaseStoreService(BaseStoreService service) |
void |
setCartCleanStrategy(CartCleanStrategy cartCleanStrategy) |
void |
setCartService(CartService cartService) |
void |
setCommerceCartService(CommerceCartService commerceCartService) |
void |
setCommonI18NService(CommonI18NService commonI18NService) |
void |
setCreditCardPaymentInfoConverter(Converter<CreditCardPaymentInfoModel,CCPaymentInfoData> creditCardPaymentInfoConverter) |
void |
setCustomerAccountService(CustomerAccountService customerAccountService) |
void |
setCustomerConverter(Converter<UserModel,CustomerData> customerConverter) |
void |
setCustomerNameStrategy(CustomerNameStrategy customerNameStrategy) |
void |
setCustomerReversePopulator(Populator<CustomerData,UserModel> customerReversePopulator) |
void |
setEventService(EventService eventService) |
void |
setModelService(ModelService modelService) |
void |
setOrderFacade(OrderFacade orderFacade) |
void |
setPasswordEncoderService(PasswordEncoderService passwordEncoderService) |
void |
setSessionService(SessionService sessionService) |
void |
setStoreSessionFacade(StoreSessionFacade storeSessionFacade) |
void |
setTitleConverter(Converter<TitleModel,TitleData> titleConverter) |
protected void |
setUidForRegister(RegisterData registerData,
CustomerModel customer)
Initializes a customer with given registerData
|
void |
setUserFacade(UserFacade userFacade) |
void |
setUserService(UserService userService) |
void |
updateCartWithGuestForAnonymousCheckout(CustomerData guestCustomerData)
Guest customer which is created for anonymous checkout will be the cart user.
|
void |
updateFullProfile(CustomerData customerData)
Updates current customer's profile with given parameters
|
void |
updatePassword(java.lang.String token,
java.lang.String newPassword)
Update the password for the user by decrypting and validating the token.
|
void |
updateProfile(CustomerData customerData)
Updates current customer's profile with given parameters
|
protected boolean |
updateSessionCurrency(CurrencyData preferredCurrency,
CurrencyData defaultCurrency) |
protected boolean |
updateSessionLanguage(LanguageData preferredLanguage,
LanguageData defaultLanguage) |
protected void |
validateDataBeforeUpdate(CustomerData customerData) |
public CustomerData getCurrentCustomer()
CustomerFacadegetCurrentCustomer in interface CustomerFacadeprotected UserModel getCurrentUser()
public java.lang.String getCurrentCustomerUid()
CustomerFacadegetCurrentCustomerUid in interface CustomerFacadepublic void changePassword(java.lang.String oldPassword,
java.lang.String newPassword)
throws PasswordMismatchException
CustomerFacadechangePassword in interface CustomerFacadeoldPassword - old password to confirmnewPassword - new password to setPasswordMismatchException - if the given old password does not match the one stored in the systempublic void register(RegisterData registerData) throws DuplicateUidException
CustomerFacaderegister in interface CustomerFacaderegisterData - the user data the user will be registered withDuplicateUidException - if the login is not uniquepublic void createGuestUserForAnonymousCheckout(java.lang.String email,
java.lang.String name)
throws DuplicateUidException
CustomerFacadecreateGuestUserForAnonymousCheckout in interface CustomerFacadeemail - the email address of the anonymous customername - the name of the anonymous customerDuplicateUidExceptionpublic java.lang.String generateGUID()
generateGUID in interface CustomerFacadepublic void changeGuestToCustomer(java.lang.String pwd,
java.lang.String orderGUID)
throws DuplicateUidException
CustomerFacadechangeGuestToCustomer in interface CustomerFacadepwd - the new password entered by the userorderGUID - the order codeDuplicateUidException - if the login is not uniqueprotected void setUidForRegister(RegisterData registerData, CustomerModel customer)
public void updateProfile(CustomerData customerData) throws DuplicateUidException
CustomerFacadeupdateProfile in interface CustomerFacadecustomerData - the updated customer dataDuplicateUidException - if the login is not uniqueprotected void validateDataBeforeUpdate(CustomerData customerData)
public void updateFullProfile(CustomerData customerData) throws DuplicateUidException
CustomerFacadeupdateFullProfile in interface CustomerFacadecustomerData - the updated customer dataDuplicateUidException - if the login is not uniquepublic void updatePassword(java.lang.String token,
java.lang.String newPassword)
throws TokenInvalidatedException
CustomerFacadeupdatePassword in interface CustomerFacadetoken - the token to identify the the customer to reset the password for.newPassword - the new password to setTokenInvalidatedException - if the token was already used or there is a newer tokenpublic void forgottenPassword(java.lang.String uid)
CustomerFacadeforgottenPassword in interface CustomerFacadeuid - the uid of the customer to send the forgotten password mail forpublic void loginSuccess()
CustomerFacadeloginSuccess in interface CustomerFacadepublic void changeUid(java.lang.String newUid,
java.lang.String currentPassword)
throws DuplicateUidException,
PasswordMismatchException
CustomerFacadechangeUid in interface CustomerFacadenewUid - the new UID for the current customercurrentPassword - current user password to validate userDuplicateUidException - thrown if the newUid is already in usePasswordMismatchException - thrown if the password is invalidpublic void updateCartWithGuestForAnonymousCheckout(CustomerData guestCustomerData)
CustomerFacadeupdateCartWithGuestForAnonymousCheckout in interface CustomerFacadeguestCustomerData - customer data to update the cart withpublic void rememberMeLoginSuccessWithUrlEncoding(boolean languageEncoding,
boolean currencyEncoding)
CustomerFacaderememberMeLoginSuccessWithUrlEncoding in interface CustomerFacadelanguageEncoding - enable/disable language encodingcurrencyEncoding - enable/disable currency encodingprotected boolean updateSessionCurrency(CurrencyData preferredCurrency, CurrencyData defaultCurrency)
protected boolean updateSessionLanguage(LanguageData preferredLanguage, LanguageData defaultLanguage)
protected CustomerModel getCurrentSessionCustomer()
public CustomerData getUserForUID(java.lang.String userId)
CustomerFacadegetUserForUID in interface CustomerFacadeuserId - the user idpublic CustomerData closeAccount()
CustomerFacadecloseAccount in interface CustomerFacadeUserModel.DEACTIVATIONDATE attributeprotected AbstractCommerceUserEvent initializeCommerceEvent(AbstractCommerceUserEvent event, CustomerModel customerModel)
protected UserService getUserService()
public void setUserService(UserService userService)
protected CustomerAccountService getCustomerAccountService()
public void setCustomerAccountService(CustomerAccountService customerAccountService)
protected CommonI18NService getCommonI18NService()
public void setCommonI18NService(CommonI18NService commonI18NService)
protected ModelService getModelService()
public void setModelService(ModelService modelService)
protected StoreSessionFacade getStoreSessionFacade()
public void setStoreSessionFacade(StoreSessionFacade storeSessionFacade)
protected CommerceCartService getCommerceCartService()
public void setCommerceCartService(CommerceCartService commerceCartService)
protected CartService getCartService()
public void setCartService(CartService cartService)
protected Populator<AddressData,AddressModel> getAddressReversePopulator()
public void setAddressReversePopulator(Populator<AddressData,AddressModel> addressReversePopulator)
protected Converter<AddressModel,AddressData> getAddressConverter()
public void setAddressConverter(Converter<AddressModel,AddressData> addressConverter)
protected Converter<CreditCardPaymentInfoModel,CCPaymentInfoData> getCreditCardPaymentInfoConverter()
public void setCreditCardPaymentInfoConverter(Converter<CreditCardPaymentInfoModel,CCPaymentInfoData> creditCardPaymentInfoConverter)
protected Converter<UserModel,CustomerData> getCustomerConverter()
public void setCustomerConverter(Converter<UserModel,CustomerData> customerConverter)
protected Converter<TitleModel,TitleData> getTitleConverter()
public void setTitleConverter(Converter<TitleModel,TitleData> titleConverter)
protected CustomerNameStrategy getCustomerNameStrategy()
public void setCustomerNameStrategy(CustomerNameStrategy customerNameStrategy)
protected UserFacade getUserFacade()
public void setUserFacade(UserFacade userFacade)
protected PasswordEncoderService getPasswordEncoderService()
public void setPasswordEncoderService(PasswordEncoderService passwordEncoderService)
protected Populator<CustomerData,UserModel> getCustomerReversePopulator()
public void setCustomerReversePopulator(Populator<CustomerData,UserModel> customerReversePopulator)
protected SessionService getSessionService()
public void setSessionService(SessionService sessionService)
protected OrderFacade getOrderFacade()
public void setOrderFacade(OrderFacade orderFacade)
protected CartCleanStrategy getCartCleanStrategy()
public void setCartCleanStrategy(CartCleanStrategy cartCleanStrategy)
public EventService getEventService()
public void setEventService(EventService eventService)
protected BaseStoreService getBaseStoreService()
public void setBaseStoreService(BaseStoreService service)
protected BaseSiteService getBaseSiteService()
public void setBaseSiteService(BaseSiteService siteService)
Copyright © 2018 SAP SE. All Rights Reserved.