Class VendorRatingCalculationJob
- java.lang.Object
-
- de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable<CronJobModel>
-
- de.hybris.platform.marketplaceservices.cronjob.VendorRatingCalculationJob
-
- All Implemented Interfaces:
JobPerformable<CronJobModel>
public class VendorRatingCalculationJob extends AbstractJobPerformable<CronJobModel>
Calculate the vendor ratings
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
flexibleSearchService, modelService, sessionService
-
-
Constructor Summary
Constructors Constructor Description VendorRatingCalculationJob()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected doublecalculateAverage(VendorModel vendor)protected doublecalculateRating(java.util.Collection<CustomerVendorReviewModel> reviews, java.util.function.ToDoubleFunction<CustomerVendorReviewModel> mapper)protected CustomerVendorReviewServicegetCustomerVendorReviewService()protected VendorServicegetVendorService()PerformResultperform(CronJobModel job)The execution body for aServicelayerJob.voidsetCustomerVendorReviewService(CustomerVendorReviewService customerVendorReviewService)voidsetVendorService(VendorService vendorService)-
Methods inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
clearAbortRequestedIfNeeded, isAbortable, isPerformable, setFlexibleSearchService, setModelService, setSessionService
-
-
-
-
Method Detail
-
perform
public PerformResult perform(CronJobModel job)
Description copied from interface:JobPerformableThe execution body for aServicelayerJob. Implement here your execution logic. It can be called synchronous or asynchronous. So be aware of thread-safety. Method will return a result object saying if the execution has reached end and if it was successful.- Specified by:
performin interfaceJobPerformable<CronJobModel>- Specified by:
performin classAbstractJobPerformable<CronJobModel>- Parameters:
job- the related CronJob in whose context the execution will be performed.- Returns:
- a
PerformResultthat indicates whether theexecutionwas successfully executed or not and has finished or not.
-
calculateRating
protected double calculateRating(java.util.Collection<CustomerVendorReviewModel> reviews, java.util.function.ToDoubleFunction<CustomerVendorReviewModel> mapper)
-
calculateAverage
protected double calculateAverage(VendorModel vendor)
-
getVendorService
protected VendorService getVendorService()
-
setVendorService
public void setVendorService(VendorService vendorService)
-
getCustomerVendorReviewService
protected CustomerVendorReviewService getCustomerVendorReviewService()
-
setCustomerVendorReviewService
public void setCustomerVendorReviewService(CustomerVendorReviewService customerVendorReviewService)
-
-