Class ExternalCatalogProvider
- java.lang.Object
-
- com.broadleafcommerce.cartoperation.service.provider.external.AbstractExternalProvider
-
- com.broadleafcommerce.cartoperation.service.provider.external.ExternalCatalogProvider
-
- All Implemented Interfaces:
CatalogProvider
public class ExternalCatalogProvider extends AbstractExternalProvider implements CatalogProvider
This particular implementation ofCatalogProvider
is designed to interact with a provider that will provide fully hydrated catalog entities, i.e., there is no need for additional calls to get a product's variants or item choices.- Author:
- Chad Harchar (charchar), Nathan Moore (nathandmoore)
-
-
Constructor Summary
Constructors Constructor Description ExternalCatalogProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalCatalogProperties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getRetrieveItemProductMappingsUrl()
protected String
getRetrieveProductsUrl(Collection<String> productIds)
protected String
getServiceClient()
List<CartItemMappingProperties.FieldMapping>
retrieveCartItemProductMappings(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Retrieve a list of cart item to product mappingsProduct
retrieveProduct(String productId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Retrieve the product for the context information provided.ProductList
retrieveProducts(Collection<String> productIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Retrieve the products for the context information provided.-
Methods inherited from class com.broadleafcommerce.cartoperation.service.provider.external.AbstractExternalProvider
executeRequest, getHeaders, getObjectMapper, getTypeFactory, getWebClient, pageableToParams, uriVars
-
-
-
-
Constructor Detail
-
ExternalCatalogProvider
public ExternalCatalogProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalCatalogProperties properties)
-
-
Method Detail
-
retrieveProduct
public Product retrieveProduct(String productId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:CatalogProvider
Retrieve the product for the context information provided. The product should be fully hydrated with all of its relationships including pricing (although not offers).- Specified by:
retrieveProduct
in interfaceCatalogProvider
- Parameters:
productId
- The id of the product to be retrieved.contextInfo
- Context information around sandbox and multitenant state.- Returns:
- The product for the id and application provided.
-
retrieveProducts
public ProductList retrieveProducts(Collection<String> productIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:CatalogProvider
Retrieve the products for the context information provided. The products should be fully hydrated with all of their relationships including pricing (although not offers).- Specified by:
retrieveProducts
in interfaceCatalogProvider
- Parameters:
productIds
- The ids of the products to be retrieved.contextInfo
- Context information around sandbox and multitenant state.- Returns:
- The products for the ids and application provided.
-
retrieveCartItemProductMappings
public List<CartItemMappingProperties.FieldMapping> retrieveCartItemProductMappings(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:CatalogProvider
Retrieve a list of cart item to product mappings- Specified by:
retrieveCartItemProductMappings
in interfaceCatalogProvider
- Parameters:
contextInfo
- Context information around sandbox and multitenant state.- Returns:
- The list of FieldMapping
-
getRetrieveProductsUrl
protected String getRetrieveProductsUrl(Collection<String> productIds)
-
getRetrieveItemProductMappingsUrl
protected String getRetrieveItemProductMappingsUrl()
-
getServiceClient
protected String getServiceClient()
-
-