|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.elasticpath.service.impl.AbstractEpServiceImpl com.elasticpath.service.impl.AbstractEpPersistenceServiceImpl com.elasticpath.service.catalog.impl.TopSellerServiceImpl
public class TopSellerServiceImpl
The default implementation of TopSellerService
.
Constructor Summary | |
---|---|
TopSellerServiceImpl()
|
Method Summary | |
---|---|
boolean |
calculateSalesCount()
Calculate the number of sales for a product and update its sales count based on the number of items ordered in the order. |
TopSeller |
findTopSellerByCategoryUid(long categoryUid)
Find top sellers of the given category uid. |
java.lang.Object |
getObject(long uid)
Get a persistent instance with the given id. |
TimeService |
getTimeService()
Returns the time service. |
org.apache.commons.collections.map.ListOrderedMap |
getTopCategoriesFromDate(java.util.Date startDate,
int numResults)
Get map of leaf Categories and number of sales since a specific date. |
org.apache.commons.collections.map.ListOrderedMap |
getTopProductsFromDate(java.util.Date startDate,
int numResults)
Get map of Products and number of sales since a specific date. |
void |
saveOrUpdate(TopSeller topSeller)
Save or update the given top seller. |
void |
setCategoryService(CategoryService categoryService)
Set the category service. |
void |
setOrderService(OrderService orderService)
Set the order service. |
void |
setProductService(ProductService productService)
Set the product service. |
void |
setPropertiesDao(PropertiesDao propertiesDao)
Sets the DAO used to load properties. |
void |
setTimeService(TimeService timeService)
Sets the time service. |
void |
setUtility(Utility utility)
Set the utility class. |
void |
updateTopSellers()
Calculate the number of sales for a particular product and update its sales count. |
void |
updateTopSellersForCategories()
Populate top sellers for each categories. |
void |
updateTopSellersForTheStore()
Populate top sellers for the store. |
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 TopSellerServiceImpl()
Method Detail |
---|
public boolean calculateSalesCount()
calculateSalesCount
in interface TopSellerService
true
if has updatespublic TopSeller findTopSellerByCategoryUid(long categoryUid)
findTopSellerByCategoryUid
in interface TopSellerService
categoryUid
- the category uid, give 0 to find top sellers for the whole store
TopSeller
if found, otherwise null
public java.lang.Object getObject(long uid) throws EpServiceException
getObject
in interface EpPersistenceService
uid
- the persistent instance uid
EpServiceException
- - in case of any errorspublic TimeService getTimeService()
public org.apache.commons.collections.map.ListOrderedMap getTopCategoriesFromDate(java.util.Date startDate, int numResults)
getTopCategoriesFromDate
in interface TopSellerService
startDate
- Date to start calculation fromnumResults
- The maximum number of products to return
public org.apache.commons.collections.map.ListOrderedMap getTopProductsFromDate(java.util.Date startDate, int numResults)
getTopProductsFromDate
in interface TopSellerService
startDate
- Date to start calculation fromnumResults
- The maximum number of products to return
public void saveOrUpdate(TopSeller topSeller) throws EpServiceException
topSeller
- the category to save or update
EpServiceException
- - in case of any errorspublic void setCategoryService(CategoryService categoryService)
setCategoryService
in interface TopSellerService
categoryService
- the category servicepublic void setOrderService(OrderService orderService)
setOrderService
in interface TopSellerService
orderService
- the order servicepublic void setProductService(ProductService productService)
setProductService
in interface TopSellerService
productService
- the product servicepublic void setPropertiesDao(PropertiesDao propertiesDao)
setPropertiesDao
in interface TopSellerService
propertiesDao
- the properties DAO used to retrieve properties informationpublic void setTimeService(TimeService timeService)
timeService
- the time servicepublic void setUtility(Utility utility)
setUtility
in interface TopSellerService
utility
- the utility classpublic void updateTopSellers()
updateTopSellers
in interface TopSellerService
public void updateTopSellersForCategories()
updateTopSellersForCategories
in interface TopSellerService
public void updateTopSellersForTheStore()
updateTopSellersForTheStore
in interface TopSellerService
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |