Class DefaultUserFacade
- java.lang.Object
-
- de.hybris.platform.commercefacades.user.impl.DefaultUserFacade
-
- All Implemented Interfaces:
UserFacade
- Direct Known Subclasses:
ChineseUserFacade
public class DefaultUserFacade extends java.lang.Object implements UserFacade
Default implementation ofUserFacade.
-
-
Constructor Summary
Constructors Constructor Description DefaultUserFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAddress(AddressData addressData)Adds the address for the current uservoideditAddress(AddressData addressData)Updates the address for the current userjava.util.List<AddressData>getAddressBook()Get the list of delivery addresses.protected Converter<AddressModel,AddressData>getAddressConverter()AddressDatagetAddressForCode(java.lang.String code)Returns the address with matching code for the current userprotected Populator<AddressData,AddressModel>getAddressReversePopulator()protected Populator<CCPaymentInfoData,CreditCardPaymentInfoModel>getCardPaymentInfoReversePopulator()protected CartServicegetCartService()CCPaymentInfoDatagetCCPaymentInfoForCode(java.lang.String code)Returns the current user's credit card payment info given it's codejava.util.List<CCPaymentInfoData>getCCPaymentInfos(boolean saved)Returns the current user's Credit Card Payment Infosprotected CheckoutCustomerStrategygetCheckoutCustomerStrategy()protected CommerceCommonI18NServicegetCommerceCommonI18NService()protected CommonI18NServicegetCommonI18NService()protected Converter<CreditCardPaymentInfoModel,CCPaymentInfoData>getCreditCardPaymentInfoConverter()protected CustomerModelgetCurrentUserForCheckout()protected CustomerAccountServicegetCustomerAccountService()AddressDatagetDefaultAddress()Returns the default addressprotected ModelServicegetModelService()protected Converter<TitleModel,TitleData>getTitleConverter()java.util.List<TitleData>getTitles()Provide all localized titles.protected UserMatchingServicegetUserMatchingService()protected UserServicegetUserService()java.lang.StringgetUserUID(java.lang.String id)Returns the UID of the found user.booleanisAddressBookEmpty()Deprecated.Since 6.5.booleanisAnonymousUser()Test if the current user is anonymousbooleanisDefaultAddress(java.lang.String addressId)Test if the address id matches with the default address idbooleanisUserExisting(java.lang.String id)Verifies whether the user exists.voidremoveAddress(AddressData addressData)Removes the address for the current uservoidremoveCCPaymentInfo(java.lang.String id)Removes credit card payment info by idvoidsetAddressConverter(Converter<AddressModel,AddressData> addressConverter)voidsetAddressReversePopulator(Populator<AddressData,AddressModel> addressReversePopulator)voidsetCardPaymentInfoReversePopulator(Populator<CCPaymentInfoData,CreditCardPaymentInfoModel> cardPaymentInfoReversePopulator)voidsetCartService(CartService cartService)voidsetCheckoutCustomerStrategy(CheckoutCustomerStrategy checkoutCustomerStrategy)voidsetCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService)voidsetCommonI18NService(CommonI18NService commonI18NService)voidsetCreditCardPaymentInfoConverter(Converter<CreditCardPaymentInfoModel,CCPaymentInfoData> creditCardPaymentInfoConverter)voidsetCurrentUser(java.lang.String id)Sets current user explicitly.voidsetCustomerAccountService(CustomerAccountService customerAccountService)voidsetDefaultAddress(AddressData addressData)Sets the default addressvoidsetDefaultPaymentInfo(CCPaymentInfoData paymentInfoData)Sets the default Payment InfovoidsetModelService(ModelService modelService)voidsetTitleConverter(Converter<TitleModel,TitleData> titleConverter)voidsetUserMatchingService(UserMatchingService userMatchingService)voidsetUserService(UserService userService)voidsyncSessionCurrency()Sets users preferred currency to the current session currencyvoidsyncSessionLanguage()Sets users preferred language to the current session languagevoidunlinkCCPaymentInfo(java.lang.String id)Deprecated.since 6.7.voidupdateCCPaymentInfo(CCPaymentInfoData paymentInfo)Updates current users' payment infoprotected voidupdateDefaultPaymentInfo(CustomerModel currentCustomer)
-
-
-
Method Detail
-
isAnonymousUser
public boolean isAnonymousUser()
Description copied from interface:UserFacadeTest if the current user is anonymous- Specified by:
isAnonymousUserin interfaceUserFacade- Returns:
trueif the current user is anonymous
-
isUserExisting
public boolean isUserExisting(java.lang.String id)
Description copied from interface:UserFacadeVerifies whether the user exists. The givenidis used to find the user in matching strategies that use one of the unique identifiers to recognize the user.- Specified by:
isUserExistingin interfaceUserFacade- Parameters:
id- - ID used to find the user- Returns:
trueif the user exists- See Also:
DefaultUserMatchingService
-
getUserUID
public java.lang.String getUserUID(java.lang.String id)
Description copied from interface:UserFacadeReturns the UID of the found user. The user is searched by a matching strategy that uses one of the unique identifiers to recognize the user.- Specified by:
getUserUIDin interfaceUserFacade- Parameters:
id- one of the unique identifiers used to identify a user- Returns:
- UID of the found user
- See Also:
DefaultUserMatchingService
-
setCurrentUser
public void setCurrentUser(java.lang.String id)
Description copied from interface:UserFacadeSets current user explicitly. The givenidis used to find the user in matching strategies that use one of the unique identifiers to recognize the user.- Specified by:
setCurrentUserin interfaceUserFacade- Parameters:
id- - id used to find the user- See Also:
DefaultUserMatchingService
-
getTitles
public java.util.List<TitleData> getTitles()
Description copied from interface:UserFacadeProvide all localized titles.- Specified by:
getTitlesin interfaceUserFacade- Returns:
- List of
TitleDataobjects
-
isAddressBookEmpty
@Deprecated(since="6.5") public boolean isAddressBookEmpty()
Deprecated.Since 6.5. UseCollectionUtils.isEmpty(Collection)with this.getAddressBook() as paramenter instead.Description copied from interface:UserFacadeTest if the address book is empty.- Specified by:
isAddressBookEmptyin interfaceUserFacade- Returns:
- true if the customer has no addresses
-
getAddressBook
public java.util.List<AddressData> getAddressBook()
Description copied from interface:UserFacadeGet the list of delivery addresses.- Specified by:
getAddressBookin interfaceUserFacade- Returns:
- the delivery addresses
-
addAddress
public void addAddress(AddressData addressData)
Description copied from interface:UserFacadeAdds the address for the current user- Specified by:
addAddressin interfaceUserFacade- Parameters:
addressData- the address to add
-
editAddress
public void editAddress(AddressData addressData)
Description copied from interface:UserFacadeUpdates the address for the current user- Specified by:
editAddressin interfaceUserFacade- Parameters:
addressData- the address to update
-
removeAddress
public void removeAddress(AddressData addressData)
Description copied from interface:UserFacadeRemoves the address for the current user- Specified by:
removeAddressin interfaceUserFacade- Parameters:
addressData- the address to remove
-
getDefaultAddress
public AddressData getDefaultAddress()
Description copied from interface:UserFacadeReturns the default address- Specified by:
getDefaultAddressin interfaceUserFacade- Returns:
- the address
-
setDefaultAddress
public void setDefaultAddress(AddressData addressData)
Description copied from interface:UserFacadeSets the default address- Specified by:
setDefaultAddressin interfaceUserFacade- Parameters:
addressData- the address to make default
-
getAddressForCode
public AddressData getAddressForCode(java.lang.String code)
Description copied from interface:UserFacadeReturns the address with matching code for the current user- Specified by:
getAddressForCodein interfaceUserFacade- Parameters:
code- the address code- Returns:
- the address
-
isDefaultAddress
public boolean isDefaultAddress(java.lang.String addressId)
Description copied from interface:UserFacadeTest if the address id matches with the default address id- Specified by:
isDefaultAddressin interfaceUserFacade- Parameters:
addressId- the address Id- Returns:
- true if address id is the default address id
-
getCCPaymentInfos
public java.util.List<CCPaymentInfoData> getCCPaymentInfos(boolean saved)
Description copied from interface:UserFacadeReturns the current user's Credit Card Payment Infos- Specified by:
getCCPaymentInfosin interfaceUserFacade- Parameters:
saved-trueto retrieve only saved credit card payment infos- Returns:
- list of Credit Card Payment Info Data
-
getCCPaymentInfoForCode
public CCPaymentInfoData getCCPaymentInfoForCode(java.lang.String code)
Description copied from interface:UserFacadeReturns the current user's credit card payment info given it's code- Specified by:
getCCPaymentInfoForCodein interfaceUserFacade- Parameters:
code- the code- Returns:
- the Credit Card Payment Info Data
-
setDefaultPaymentInfo
public void setDefaultPaymentInfo(CCPaymentInfoData paymentInfoData)
Description copied from interface:UserFacadeSets the default Payment Info- Specified by:
setDefaultPaymentInfoin interfaceUserFacade- Parameters:
paymentInfoData- the paymentInfo to make default
-
removeCCPaymentInfo
public void removeCCPaymentInfo(java.lang.String id)
Description copied from interface:UserFacadeRemoves credit card payment info by id- Specified by:
removeCCPaymentInfoin interfaceUserFacade- Parameters:
id- the id
-
unlinkCCPaymentInfo
@Deprecated(since="6.7") public void unlinkCCPaymentInfo(java.lang.String id)
Deprecated.since 6.7. UseUserFacade.removeCCPaymentInfo(String)insteadDescription copied from interface:UserFacadeUnlink the credit card info from the customer by CC id- Specified by:
unlinkCCPaymentInfoin interfaceUserFacade- Parameters:
id- the id
-
updateCCPaymentInfo
public void updateCCPaymentInfo(CCPaymentInfoData paymentInfo)
Description copied from interface:UserFacadeUpdates current users' payment info- Specified by:
updateCCPaymentInfoin interfaceUserFacade- Parameters:
paymentInfo- - new payment info data
-
syncSessionLanguage
public void syncSessionLanguage()
Description copied from interface:UserFacadeSets users preferred language to the current session language- Specified by:
syncSessionLanguagein interfaceUserFacade
-
syncSessionCurrency
public void syncSessionCurrency()
Description copied from interface:UserFacadeSets users preferred currency to the current session currency- Specified by:
syncSessionCurrencyin interfaceUserFacade
-
updateDefaultPaymentInfo
protected void updateDefaultPaymentInfo(CustomerModel currentCustomer)
-
getCurrentUserForCheckout
protected CustomerModel getCurrentUserForCheckout()
-
getCardPaymentInfoReversePopulator
protected Populator<CCPaymentInfoData,CreditCardPaymentInfoModel> getCardPaymentInfoReversePopulator()
-
setCardPaymentInfoReversePopulator
public void setCardPaymentInfoReversePopulator(Populator<CCPaymentInfoData,CreditCardPaymentInfoModel> cardPaymentInfoReversePopulator)
-
getUserService
protected UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getCustomerAccountService
protected CustomerAccountService getCustomerAccountService()
-
setCustomerAccountService
public void setCustomerAccountService(CustomerAccountService customerAccountService)
-
getCommerceCommonI18NService
protected CommerceCommonI18NService getCommerceCommonI18NService()
-
setCommerceCommonI18NService
public void setCommerceCommonI18NService(CommerceCommonI18NService commerceCommonI18NService)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getCommonI18NService
protected CommonI18NService getCommonI18NService()
-
setCommonI18NService
public void setCommonI18NService(CommonI18NService commonI18NService)
-
getCartService
protected CartService getCartService()
-
setCartService
public void setCartService(CartService cartService)
-
getAddressReversePopulator
protected Populator<AddressData,AddressModel> getAddressReversePopulator()
-
setAddressReversePopulator
public void setAddressReversePopulator(Populator<AddressData,AddressModel> addressReversePopulator)
-
getAddressConverter
protected Converter<AddressModel,AddressData> getAddressConverter()
-
setAddressConverter
public void setAddressConverter(Converter<AddressModel,AddressData> addressConverter)
-
getCreditCardPaymentInfoConverter
protected Converter<CreditCardPaymentInfoModel,CCPaymentInfoData> getCreditCardPaymentInfoConverter()
-
setCreditCardPaymentInfoConverter
public void setCreditCardPaymentInfoConverter(Converter<CreditCardPaymentInfoModel,CCPaymentInfoData> creditCardPaymentInfoConverter)
-
getTitleConverter
protected Converter<TitleModel,TitleData> getTitleConverter()
-
setTitleConverter
public void setTitleConverter(Converter<TitleModel,TitleData> titleConverter)
-
getCheckoutCustomerStrategy
protected CheckoutCustomerStrategy getCheckoutCustomerStrategy()
-
setCheckoutCustomerStrategy
public void setCheckoutCustomerStrategy(CheckoutCustomerStrategy checkoutCustomerStrategy)
-
getUserMatchingService
protected UserMatchingService getUserMatchingService()
-
setUserMatchingService
public void setUserMatchingService(UserMatchingService userMatchingService)
-
-