Interface ProductDetailsService
- All Known Implementing Classes:
DefaultProductDetailsService
public interface ProductDetailsService
This service is responsible for retrieving
ProductDetails
for
ProductDetailsRequests
. It is responsible for building the details;
however, it typically should defer the hydration of the related domain to the available
ProductDetailsContributors
- Author:
- Nathan Moore (nathandmoore)
-
Method Summary
Modifier and TypeMethodDescriptiongetAssetsForProducts
(Collection<String> productIds, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Gets theProductAssets
that match theproductIds
provided.default ProductDetailsList
getDetailsForProducts
(Collection<? extends Product> products, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Gets theProductDetailsList
for the providedproducts
.getDetailsForProducts
(Collection<? extends Product> products, Set<String> productIdsNotFound, Set<String> productUrisNotFound, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Gets theProductDetailsList
for the providedproducts
.getProductDetailsForRequest
(ProductDetailsRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Gets aProductDetails
for theProductDetailsRequest
.getTagDetailsForProducts
(Collection<String> productIds, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Gets theProductTags
for the givenproductIds
.
-
Method Details
-
getProductDetailsForRequest
Optional<ProductDetailsList> getProductDetailsForRequest(ProductDetailsRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Gets aProductDetails
for theProductDetailsRequest
.- Parameters:
request
- theProductDetailsRequest
with additional request context for identifying the products for which to retrieve details and defining the how much detail to go into.contextInfo
- context information surrounding sandboxing/multitenant state- Returns:
ProductDetailsList
for theProductDetailsRequests
.- Throws:
ProductDetailsRequestException
- Thrown if the request is invalid such as missing both the product URI and ID.
-
getAssetsForProducts
Map<String,List<ProductAsset>> getAssetsForProducts(Collection<String> productIds, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Gets theProductAssets
that match theproductIds
provided. The results are mapped by the product ID.- Parameters:
productIds
- IDs of theProducts
whose assets to fetch.filters
- additional filters to apply in the query.contextInfo
- context information surrounding sandboxing/multitenant state.- Returns:
- the
ProductAssets
that match theproductIds
provided.
-
getDetailsForProducts
default ProductDetailsList getDetailsForProducts(Collection<? extends Product> products, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Gets theProductDetailsList
for the providedproducts
.- Parameters:
products
-Products
for which to get aProductDetailsList
.contextInfo
- context information surrounding sandboxing/multitenant state- Returns:
ProductDetailsList
for theproducts
.
-
getDetailsForProducts
ProductDetailsList getDetailsForProducts(Collection<? extends Product> products, Set<String> productIdsNotFound, Set<String> productUrisNotFound, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Gets theProductDetailsList
for the providedproducts
.- Parameters:
products
-Products
for which to get aProductDetailsList
.productIdsNotFound
- Set of IDs in the request that did not match any productsproductUrisNotFound
- Set of URIs in the request that did not match any productscontextInfo
- context information surrounding sandboxing/multitenant state- Returns:
ProductDetailsList
for theproducts
.
-
getTagDetailsForProducts
Map<String,List<ProductTagDetail>> getTagDetailsForProducts(Collection<String> productIds, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Gets theProductTags
for the givenproductIds
. The results are mapped by the owning product ID.- Parameters:
productIds
- IDs of theProducts
whose assets to fetch.filters
- additional filters to apply in the query.contextInfo
- context information surrounding sandboxing/multitenant state.- Returns:
- The
ProductTags
for the givenproductIds
.
-