Class DefaultProductInterestService
java.lang.Object
de.hybris.platform.customerinterestsservices.productinterest.impl.DefaultProductInterestService
- All Implemented Interfaces:
ProductInterestService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<NotificationType,Date> buildInterestMap(Map<String, String> interestCreationMap) build interest data as a linked mapprotected voidfillProductModelMap(Map<ProductModel, Map<NotificationType, Date>> productModelMap, String productPk, Map<String, String> interestCreationMap) Finds all interests watched by current customer.protected BaseSiteServiceprotected BaseStoreServiceprotected ModelServicegetProductInterest(ProductModel productModel, CustomerModel customerModel, NotificationType notificationType, BaseStoreModel baseStore, BaseSiteModel baseSite) This method is used to find the ProductInterestModel by productModel, customerModel, notificationType, baseStore,baseSite.protected ProductInterestDaogetProductInterests(CustomerModel customerModel, BaseStoreModel baseStore, BaseSiteModel baseSite) This method is used to find the expired and effective ProductInterestModels by productModel, customerModel, notificationType, baseStore,baseSite.getProductsByCustomerInterests(PageableData pageableData) Finds interests watched by current customer.intgetProductsCountByCustomerInterests(PageableData pageableData) Finds the total size of search result.protected UserServicevoidremoveAllProductInterests(String productCode) This method will remove the interest for the current customer by product.voidremoveProductInterest(ProductInterestModel productInterest) This method will remove the interest.voidsaveProductInterest(ProductInterestModel productInterest) This method will save the new or edited interest.voidsetBaseSiteService(BaseSiteService baseSiteService) voidsetBaseStoreService(BaseStoreService baseStoreService) voidsetModelService(ModelService modelService) voidsetProductInterestDao(ProductInterestDao productInterestDao) voidsetUserService(UserService userService)
-
Constructor Details
-
DefaultProductInterestService
public DefaultProductInterestService()
-
-
Method Details
-
saveProductInterest
Description copied from interface:ProductInterestServiceThis method will save the new or edited interest.- Specified by:
saveProductInterestin interfaceProductInterestService- Parameters:
productInterest- the ProductInterestModel to be saved
-
removeProductInterest
Description copied from interface:ProductInterestServiceThis method will remove the interest.- Specified by:
removeProductInterestin interfaceProductInterestService- Parameters:
productInterest- the ProductInterestModel to be removed
-
getProductInterest
public Optional<ProductInterestModel> getProductInterest(ProductModel productModel, CustomerModel customerModel, NotificationType notificationType, BaseStoreModel baseStore, BaseSiteModel baseSite) Description copied from interface:ProductInterestServiceThis method is used to find the ProductInterestModel by productModel, customerModel, notificationType, baseStore,baseSite.- Specified by:
getProductInterestin interfaceProductInterestService- Parameters:
productModel- the product of the ProductInterestcustomerModel- the customer of the ProductInterestnotificationType- the notificationType of the ProductInterestbaseStore- the baseStore of the ProductInterestbaseSite- the baseSite of the ProductInterest- Returns:
- ProductInterestModel if found and an empty Optional otherwise
-
getProductInterests
public List<ProductInterestModel> getProductInterests(CustomerModel customerModel, BaseStoreModel baseStore, BaseSiteModel baseSite) Description copied from interface:ProductInterestServiceThis method is used to find the expired and effective ProductInterestModels by productModel, customerModel, notificationType, baseStore,baseSite.- Specified by:
getProductInterestsin interfaceProductInterestService- Parameters:
customerModel- the customer of the ProductInterestbaseStore- the baseStore of the ProductInterestbaseSite- the baseSite of the ProductInterest- Returns:
- ProductInterestModel if found and an empty Optional otherwise
-
removeAllProductInterests
Description copied from interface:ProductInterestServiceThis method will remove the interest for the current customer by product.- Specified by:
removeAllProductInterestsin interfaceProductInterestService- Parameters:
productCode- the code of the product
-
getProductsByCustomerInterests
public Map<ProductModel,Map<NotificationType, getProductsByCustomerInterestsDate>> (PageableData pageableData) Description copied from interface:ProductInterestServiceFinds interests watched by current customer.- Specified by:
getProductsByCustomerInterestsin interfaceProductInterestService- Parameters:
pageableData- the pagination data- Returns:
- Map whose key is ProductMode and value is the Map of NotificationType as key and creation time as value.
-
findProductInterestsByCustomer
Description copied from interface:ProductInterestServiceFinds all interests watched by current customer.- Specified by:
findProductInterestsByCustomerin interfaceProductInterestService- Returns:
- Map whose key is ProductMode and value is the Map of NotificationType as key and creation time as value.
-
getProductsCountByCustomerInterests
Description copied from interface:ProductInterestServiceFinds the total size of search result.- Specified by:
getProductsCountByCustomerInterestsin interfaceProductInterestService- Parameters:
pageableData- the pagination data- Returns:
- the total size of search result
-
fillProductModelMap
protected void fillProductModelMap(Map<ProductModel, Map<NotificationType, Date>> productModelMap, String productPk, Map<String, String> interestCreationMap) -
buildInterestMap
build interest data as a linked map- Parameters:
interestCreationMap-- Returns:
-
getModelService
-
setModelService
-
getProductInterestDao
-
setProductInterestDao
-
getUserService
-
setUserService
-
getBaseStoreService
-
setBaseStoreService
-
getBaseSiteService
-
setBaseSiteService
-