|
|||||||||
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.ProductServiceImpl
public class ProductServiceImpl
The default implementation of ProductService
.
Constructor Summary | |
---|---|
ProductServiceImpl()
|
Method Summary | |
---|---|
Product |
add(Product product)
Adds the given product. |
java.util.List |
findAllUids()
Returns all product uids as a list. |
java.util.List |
findAvailableUids()
Returns all available product uids as a list. |
java.util.List |
findAvailableUidsByModifiedDate(java.util.Date date)
Retrieves list of Product uids where the last modified date is later than the specified date. |
java.util.List |
findByBrandUid(long brandUid)
Returns a list of Product based on the given brand Uid. |
java.util.List |
findByBrandUid(long brandUid,
ProductLoadTuner loadTuner)
Returns a list of Product based on the given brand Uid. |
java.util.List |
findByCategoryUid(long categoryUid)
Returns a list of Product based on the given category Uid. |
java.util.List |
findByCategoryUid(long categoryUid,
ProductLoadTuner loadTuner)
Returns a list of Product based on the given category Uid. |
java.util.List |
findByCategoryUidPaginated(long categoryUid,
int startIndex,
int numProducts,
ProductLoadTuner loadTuner)
Returns a list of Product s based on the given category Uid. |
Product |
findByGuid(java.lang.String guid)
Find the product with the given guid, for product, i.e. |
java.util.List |
findByModifiedDate(java.util.Date date)
Retrieves list of Product where the last modified date is later than the specified date. |
java.util.List |
findByUids(java.util.Collection productUids,
ProductLoadTuner loadTuner)
Returns a list of Product based on the given uids. |
java.util.List |
findProductByCriteria(ProductSearchCriteria productSearchCriteria)
Retrieve the list of products, whose specified property contain the given criteria value. |
java.util.List |
findProductTopSeller(int topCount,
ProductLoadTuner productLoadTuner)
Retrieve a list of top sellers of the whole store. |
java.util.List |
findProductTopSellerForCategory(long categoryUid)
Retrieve the list of top selling products that belongs to the category or its subcategories. |
long |
findUidById(java.lang.String productId)
Get the product UID of the given product identifier. |
java.util.List |
findUidsByCategoryUids(java.util.Collection categoryUids)
Retrieves list of product uids belongs to either category uids given. |
java.util.List |
findUidsByDeletedDate(java.util.Date date)
Retrieves list of product uids where the deleted date is later than the specified date. |
java.util.List |
findUidsByModifiedDate(java.util.Date date)
Retrieves list of Product uids where the last modified date is later than the specified date. |
Product |
get(long productUid)
Get the product with the given UID. |
java.lang.Object |
getObject(long uid)
Generic get method for all persistable domain models. |
ProductCategory |
getProductCategoryByProCatUid(long productUid,
long categoryUid)
Get a ProductCategory by the product uidPk and category uidPk. |
ProductLoadTuner |
getProductLoadTunerMinimal()
Returns the ProductLoadTuner for populating a minimal data set. |
int |
getProductSkuCount(long productUid)
Get a count of ProductSku s belong to this product. |
Product |
getTuned(long productUid,
ProductLoadTuner loadTuner,
ShoppingCart shoppingCart)
Get the product with the given UID. |
Utility |
getUtility()
Returns the utility instance. |
Product |
getWithCategories(long productUid)
Load the product with the given UID. |
boolean |
guidExists(java.lang.String guid)
Checks whether the given product guid exists or not, for product, i.e. |
java.util.List |
list()
List all products stored in the database. |
Product |
load(long productUid)
Load the product with the given Uid. |
void |
removeProductList(java.util.List productUidList)
Deletes the list of products. |
void |
removeProductTree(long productUid)
Deletes the product and all it associations. |
void |
resetProductCategoryFeatured(long productUid,
long categoryUid)
Disable a ProductCategory as a featured product, if the featuredProductOrder is set to 0, means this productCategory is not
featured. |
void |
saveOrUpdate(Product product)
Save or update the given product. |
void |
setCategoryService(CategoryService categoryService)
Set the CategoryService singleton. |
void |
setIndexSearchService(IndexSearchService indexSearchService)
Set the indexSearchService instance. |
void |
setLazyLoadHelper(LazyLoadHelper lazyLoadHelper)
Sets the lazy load helper. |
int |
setProductCategoryFeatured(long productUid,
long categoryUid)
Set a ProductCategory as a featured product, if the featuredProductOrder is set to be greater than 0, means this
productCategory is featured. |
void |
setProductLoadTunerAll(ProductLoadTuner productLoadTunerAll)
Sets the ProductLoadTuner for populating all data. |
void |
setProductLoadTunerForDefaultCategory(ProductLoadTuner productLoadTunerForDefaultCategory)
Sets the ProductLoadTuner for populating the default category. |
void |
setProductLoadTunerMinimal(ProductLoadTuner productLoadTunerMinimal)
Sets the ProductLoadTuner for populating a minimal data set. |
void |
setRuleEngine(EpRuleEngine epRuleEngine)
Sets the rule engine. |
void |
setUtility(Utility utility)
Sets the utility. |
void |
updateFeaturedProductOrder(long productUid,
long categoryUid,
long productUid2)
Swap two ProductCategory featured product order. |
void |
updateLastModifiedTime(Product product)
Update the product's last modified timestamp. |
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 ProductServiceImpl()
Method Detail |
---|
public Product add(Product product) throws EpServiceException
add
in interface ProductService
product
- the product to add
EpServiceException
- - in case of any errorspublic java.util.List findAllUids()
findAllUids
in interface ProductService
public java.util.List findAvailableUids()
findAvailableUids
in interface ProductService
public java.util.List findAvailableUidsByModifiedDate(java.util.Date date)
Product
uids where the last modified date is later than the specified date.
findAvailableUidsByModifiedDate
in interface ProductService
date
- date to compare with the last modified date
Product
whose last modified date is later than the specified datepublic java.util.List findByBrandUid(long brandUid)
Product
based on the given brand Uid.
findByBrandUid
in interface ProductService
brandUid
- the brand Uid
Product
public java.util.List findByBrandUid(long brandUid, ProductLoadTuner loadTuner)
Product
based on the given brand Uid. The returned products will be populated based on the given load tuner.
findByBrandUid
in interface ProductService
brandUid
- the brand UidloadTuner
- the load tuner, give null
to populate all related data
Product
public java.util.List findByCategoryUid(long categoryUid)
Product
based on the given category Uid.
findByCategoryUid
in interface ProductService
categoryUid
- the category Uid
Product
public java.util.List findByCategoryUid(long categoryUid, ProductLoadTuner loadTuner)
Product
based on the given category Uid. The returned products will be populated based on the given load
tuner.
findByCategoryUid
in interface ProductService
categoryUid
- the category UidloadTuner
- the load tuner, give null
to populate all related data
Product
public java.util.List findByCategoryUidPaginated(long categoryUid, int startIndex, int numProducts, ProductLoadTuner loadTuner)
Product
s based on the given category Uid. The returned products will be populated based on the given load
tuner. This method allows a subset of the products to be returned at a time by giving the starting index of the first product and the number
of products to be returned.
findByCategoryUidPaginated
in interface ProductService
categoryUid
- the category UidstartIndex
- the starting index of the first product to be returnednumProducts
- the number of products to be returned, starting from the start indexloadTuner
- the load tuner, give null
to populate all related data
Product
spublic Product findByGuid(java.lang.String guid) throws EpServiceException
findByGuid
in interface ProductService
guid
- the product code.
EpServiceException
- - in case of any errorspublic java.util.List findByModifiedDate(java.util.Date date)
Product
where the last modified date is later than the specified date.
findByModifiedDate
in interface ProductService
date
- date to compare with the last modified date
Product
whose last modified date is later than the specified datepublic java.util.List findByUids(java.util.Collection productUids, ProductLoadTuner loadTuner)
Product
based on the given uids. The returned products will be populated based on the given load tuner.
findByUids
in interface ProductService
productUids
- a collection of product uidsloadTuner
- the load tuner
Product
spublic java.util.List findProductByCriteria(ProductSearchCriteria productSearchCriteria)
findProductByCriteria
in interface ProductService
productSearchCriteria
- criteria for product search.
public java.util.List findProductTopSeller(int topCount, ProductLoadTuner productLoadTuner) throws EpServiceException
findProductTopSeller
in interface ProductService
topCount
- the number of top seller products to retrieveproductLoadTuner
- the product load tunner to control data get loaded
EpServiceException
- in case of any errorpublic java.util.List findProductTopSellerForCategory(long categoryUid) throws EpServiceException
findProductTopSellerForCategory
in interface ProductService
categoryUid
- the category id
EpServiceException
- in case of any errorpublic long findUidById(java.lang.String productId) throws EpServiceException
long
value, itself will be dealt as UID.
findUidById
in interface ProductService
productId
- the Product Guid or UID.
EpServiceException
- - in case of any errorspublic java.util.List findUidsByCategoryUids(java.util.Collection categoryUids)
findUidsByCategoryUids
in interface ProductService
categoryUids
- category uids
public java.util.List findUidsByDeletedDate(java.util.Date date)
findUidsByDeletedDate
in interface ProductService
date
- date to compare with the deleted date
public java.util.List findUidsByModifiedDate(java.util.Date date)
Product
uids where the last modified date is later than the specified date.
findUidsByModifiedDate
in interface ProductService
date
- date to compare with the last modified date
Product
whose last modified date is later than the specified datepublic Product get(long productUid) throws EpServiceException
get
in interface ProductService
productUid
- the Product UID.
EpServiceException
- - in case of any errorspublic java.lang.Object getObject(long uid) throws EpServiceException
getObject
in interface EpPersistenceService
uid
- the persisted instance uid
EpServiceException
- - in case of any errorspublic ProductCategory getProductCategoryByProCatUid(long productUid, long categoryUid)
ProductCategory
by the product uidPk and category uidPk.
getProductCategoryByProCatUid
in interface ProductService
productUid
- the unique identifier for the productcategoryUid
- the unique identifier for the category
public ProductLoadTuner getProductLoadTunerMinimal()
ProductLoadTuner
for populating a minimal data set.
ProductLoadTuner
for populating a minimal data set.public int getProductSkuCount(long productUid)
ProductSku
s belong to this product.
getProductSkuCount
in interface ProductService
productUid
- the uid of the product.
ProductSku
s belong to this product.public Product getTuned(long productUid, ProductLoadTuner loadTuner, ShoppingCart shoppingCart) throws EpServiceException
By giving a shopping cart, promotion rules will be applied to the returned product.
getTuned
in interface ProductService
productUid
- the Product UID.loadTuner
- the product load tunershoppingCart
- the shopping cart, give null
if you don't have it.
EpServiceException
- - in case of any errorspublic Utility getUtility()
public Product getWithCategories(long productUid) throws EpServiceException
getWithCategories
in interface ProductService
productUid
- the product UID
EpServiceException
- - in case of any errorspublic boolean guidExists(java.lang.String guid) throws EpServiceException
guidExists
in interface ProductService
guid
- the product code.
EpServiceException
- - in case of any errorspublic java.util.List list() throws EpServiceException
list
in interface ProductService
EpServiceException
- - in case of any errorspublic Product load(long productUid) throws EpServiceException
load
in interface ProductService
productUid
- the product Uid
EpServiceException
- - in case of any errorspublic void removeProductList(java.util.List productUidList) throws EpServiceException
removeProductList
in interface ProductService
productUidList
- the product Uid List to be removed
EpServiceException
- - in case of any errorspublic void removeProductTree(long productUid) throws EpServiceException
removeProductTree
in interface ProductService
productUid
- the uid of product to remove
EpServiceException
- in case of any errorspublic void resetProductCategoryFeatured(long productUid, long categoryUid)
ProductCategory
as a featured product, if the featuredProductOrder is set to 0, means this productCategory is not
featured.
resetProductCategoryFeatured
in interface ProductService
productUid
- the unique identifier for the productcategoryUid
- the unique identifier for the categorypublic void saveOrUpdate(Product product) throws EpServiceException
saveOrUpdate
in interface ProductService
product
- the product to save or update
EpServiceException
- - in case of any errorspublic void setCategoryService(CategoryService categoryService)
CategoryService
singleton.
categoryService
- the CategoryService
singleton.public void setIndexSearchService(IndexSearchService indexSearchService)
indexSearchService
- the indexSearchService instance.public void setLazyLoadHelper(LazyLoadHelper lazyLoadHelper)
lazyLoadHelper
- the lazy load helperpublic int setProductCategoryFeatured(long productUid, long categoryUid)
ProductCategory
as a featured product, if the featuredProductOrder is set to be greater than 0, means this
productCategory is featured.
setProductCategoryFeatured
in interface ProductService
productUid
- the unique identifier for the productcategoryUid
- the unique identifier for the category
ProductCategory
public void setProductLoadTunerAll(ProductLoadTuner productLoadTunerAll)
ProductLoadTuner
for populating all data.
productLoadTunerAll
- the ProductLoadTuner
for populating all data.public void setProductLoadTunerForDefaultCategory(ProductLoadTuner productLoadTunerForDefaultCategory)
ProductLoadTuner
for populating the default category.
productLoadTunerForDefaultCategory
- the ProductLoadTuner
for populating the default category.public void setProductLoadTunerMinimal(ProductLoadTuner productLoadTunerMinimal)
ProductLoadTuner
for populating a minimal data set.
productLoadTunerMinimal
- the ProductLoadTuner
public void setRuleEngine(EpRuleEngine epRuleEngine)
epRuleEngine
- the rule enginepublic void setUtility(Utility utility)
utility
- the utility to setpublic void updateFeaturedProductOrder(long productUid, long categoryUid, long productUid2)
ProductCategory
featured product order.
updateFeaturedProductOrder
in interface ProductService
productUid
- the unique identifier for the productcategoryUid
- the unique identifier for the categoryproductUid2
- the unique identifier for the product to be swapedpublic void updateLastModifiedTime(Product product)
updateLastModifiedTime
in interface ProductService
product
- the product whose timestamp is to be updated.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |