com.elasticpath.service.catalog
Interface ProductSkuService

All Superinterfaces:
EpPersistenceService, EpService
All Known Implementing Classes:
ProductSkuServiceImpl

public interface ProductSkuService
extends EpPersistenceService

Provides productSku-related business services.


Method Summary
 ProductSku add(ProductSku productSku)
          Adds the given product sku.
 java.util.List findByProductUid(long productUid)
          Returns a list of ProductSku based on the given product Uid.
 ProductSku findBySkuCode(java.lang.String skuCode)
          Finds a ProductSku by its SKU Code.
 ProductSku findBySkuCodeWithAll(java.lang.String skuCode)
          Finds a ProductSku by its SKU Code and populates all lazy-loaded references.
 java.util.List findProductSkuCodeLikeWithRestriction(java.lang.String criteriaValue, long parentCategoryUid)
          Retrieve the list of productSkus, whose name matches the given criteria and belongs to direct or indirect subcategory of the specified parent category.
 java.util.List findProductSkuLike(java.lang.String propertyName, java.lang.String criteriaValue)
          Retrieve the list of productSkus, whose specified property contain the given criteria value.
 ProductSku get(long productSkuUid)
          Get the productSku with the given UID.
 java.lang.Object getObject(long uid)
          Generic get method for all persistable domain models.
 ProductSku getWithProduct(long productSkuUid)
          Get the productSku with the given UID and load the parent product as well.
 ProductSku getWithPromotions(long productSkuUid, ShoppingCart shoppingCart)
          Get the productSku with the given UID.
 void removeProductSkuTree(long productSkuUid)
          Deletes the product sku and all it associations.
 void saveOrUpdate(ProductSku sku)
          Save or update the given product sku.
 
Methods inherited from interface com.elasticpath.service.EpPersistenceService
getPersistenceEngine, setPersistenceEngine
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Method Detail

add

ProductSku add(ProductSku productSku)
               throws EpServiceException
Adds the given product sku.

Parameters:
productSku - the product sku to add
Returns:
the persisted instance of product sku
Throws:
EpServiceException - - in case of any errors

findByProductUid

java.util.List findByProductUid(long productUid)
Returns a list of ProductSku based on the given product Uid.

Parameters:
productUid - the product Uid
Returns:
a list of ProductSku

findBySkuCode

ProductSku findBySkuCode(java.lang.String skuCode)
Finds a ProductSku by its SKU Code.

Parameters:
skuCode - the sku code
Returns:
a ProductSku or null if no matching SKU is found

findBySkuCodeWithAll

ProductSku findBySkuCodeWithAll(java.lang.String skuCode)
Finds a ProductSku by its SKU Code and populates all lazy-loaded references.

Parameters:
skuCode - the sku code
Returns:
a ProductSku or null if no matching SKU is found

findProductSkuCodeLikeWithRestriction

java.util.List findProductSkuCodeLikeWithRestriction(java.lang.String criteriaValue,
                                                     long parentCategoryUid)
                                                     throws EpServiceException
Retrieve the list of productSkus, whose name matches the given criteria and belongs to direct or indirect subcategory of the specified parent category.

Parameters:
criteriaValue - criteria value to be used for searching.
parentCategoryUid - Parent Category used to restricted the search results.
Returns:
list of productSkus matching the given criteria.
Throws:
EpServiceException - in case of any error

findProductSkuLike

java.util.List findProductSkuLike(java.lang.String propertyName,
                                  java.lang.String criteriaValue)
                                  throws EpServiceException
Retrieve the list of productSkus, whose specified property contain the given criteria value.

Parameters:
propertyName - productSku property to search on.
criteriaValue - criteria value to be used for searching.
Returns:
list of productSkus matching the given criteria.
Throws:
EpServiceException - in case of any error

get

ProductSku get(long productSkuUid)
               throws EpServiceException
Get the productSku with the given UID. Return null if no matching record exists.

Parameters:
productSkuUid - the ProductSku UID.
Returns:
the productSku if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

getObject

java.lang.Object getObject(long uid)
                           throws EpServiceException
Generic get method for all persistable domain models.

Specified by:
getObject in interface EpPersistenceService
Parameters:
uid - the persisted instance uid
Returns:
the persisted instance if exists, otherwise null
Throws:
EpServiceException - - in case of any errors

getWithProduct

ProductSku getWithProduct(long productSkuUid)
                          throws EpServiceException
Get the productSku with the given UID and load the parent product as well. Return null if no matching record exists.

Parameters:
productSkuUid - the ProductSku UID.
Returns:
the productSku if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

getWithPromotions

ProductSku getWithPromotions(long productSkuUid,
                             ShoppingCart shoppingCart)
                             throws EpServiceException
Get the productSku with the given UID. Return null if no matching record exists. The SKU is fully populated and will have rules applied if the shopping cart is passed in.

Parameters:
productSkuUid - the ProductSku UID.
shoppingCart - pass in the shopping cart to apply promotion rules.
Returns:
the productSku if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

removeProductSkuTree

void removeProductSkuTree(long productSkuUid)
                          throws EpServiceException
Deletes the product sku and all it associations.

Parameters:
productSkuUid - the uid of product sku to remove
Throws:
EpServiceException - in case of any errors

saveOrUpdate

void saveOrUpdate(ProductSku sku)
                  throws EpServiceException
Save or update the given product sku.

Parameters:
sku - the product sku to save or update
Throws:
EpServiceException - - in case of any errors