Class ExternalCatalogProvider<P extends Product>
java.lang.Object
com.broadleafcommerce.subscriptionoperation.service.provider.external.AbstractExternalProvider
com.broadleafcommerce.subscriptionoperation.service.provider.external.ExternalCatalogProvider<P>
- All Implemented Interfaces:
CatalogProvider<P>
public class ExternalCatalogProvider<P extends Product>
extends AbstractExternalProvider
implements CatalogProvider<P>
-
Field Summary
FieldsFields inherited from class com.broadleafcommerce.subscriptionoperation.service.provider.external.AbstractExternalProvider
ENTITY_NOT_FOUND, RSQL_FILTER_PARAM, SANDBOX_AWARE_HEADER -
Constructor Summary
ConstructorsConstructorDescriptionExternalCatalogProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalCatalogProviderProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringbuildReadProductsByIdsFilters(@NonNull Collection<String> productIds) Build the RSQL filters in a String form used for reading the products by IDs.protected org.springframework.web.util.UriComponentsBuilderGets the base URI common to all requests this provider will make.protected org.springframework.core.ParameterizedTypeReference<ResponsePageGenerator<P>>Gets the type reference for a page generator of item list items.protected ExternalCatalogProviderPropertiesprotected StringreadProductById(String productId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves theProductbased on the given id.org.springframework.data.domain.Page<P>readProductsByIds(@NonNull Collection<String> productIds, org.springframework.data.domain.Pageable pageable, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) RetrievesProductsbased on the given ids.Methods inherited from class com.broadleafcommerce.subscriptionoperation.service.provider.external.AbstractExternalProvider
addOffsetOrPageNumber, buildNotFoundException, executeRequest, getHeaders, getObjectMapper, getTypeFactory, getWebClient, isEntityNotFound, pageableToParams, uriVars
-
Field Details
-
ID_IN_QUERY_PARAM
- See Also:
-
-
Constructor Details
-
ExternalCatalogProvider
public ExternalCatalogProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalCatalogProviderProperties properties)
-
-
Method Details
-
readProductById
public P readProductById(String productId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CatalogProviderRetrieves theProductbased on the given id.- Specified by:
readProductByIdin interfaceCatalogProvider<P extends Product>- Parameters:
productId- the product idcontextInfo- context information around multi-tenant state- Returns:
- the
Product
-
readProductsByIds
public org.springframework.data.domain.Page<P> readProductsByIds(@NonNull @NonNull Collection<String> productIds, @Nullable org.springframework.data.domain.Pageable pageable, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CatalogProviderRetrievesProductsbased on the given ids.- Specified by:
readProductsByIdsin interfaceCatalogProvider<P extends Product>- Parameters:
productIds- list of product idspageable- pageablecontextInfo- context information around multi-tenant state- Returns:
- page of
Products
-
buildReadProductsByIdsFilters
Build the RSQL filters in a String form used for reading the products by IDs.- Parameters:
productIds- the list of product ids.- Returns:
- the RSQL filters in a String form used for reading the products by IDs
-
getPageType
protected org.springframework.core.ParameterizedTypeReference<ResponsePageGenerator<P>> getPageType()Gets the type reference for a page generator of item list items.- Returns:
- type reference for a page generator of item list items
-
getBaseUri
protected org.springframework.web.util.UriComponentsBuilder getBaseUri()Gets the base URI common to all requests this provider will make.- Returns:
- a URI components builder with the base URI set up
-
getServiceClient
-
getProperties
-