Class ProductDetailExternalClient
java.lang.Object
com.broadleafcommerce.catalogbrowse.service.provider.external.catalog.ProductDetailExternalClient
- All Implemented Interfaces:
com.broadleafcommerce.common.extension.intercommunication.ExternalClient,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware
public class ProductDetailExternalClient
extends Object
implements com.broadleafcommerce.common.extension.intercommunication.ExternalClient, org.springframework.beans.factory.BeanFactoryAware
Handles external calls to catalog services to retrieve product details.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionProductDetailExternalClient(com.broadleafcommerce.common.extension.intercommunication.ExternalClientProperties properties, ExternalCatalogProviderProperties providerProperties, org.springframework.web.reactive.function.client.WebClient webClient, com.broadleafcommerce.data.tracking.core.context.ContextInfoWebRequestResolver requestResolver, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectconvertQueryParamsToDto(org.springframework.util.MultiValueMap<String, String> queryParams, Class<?> clazz) This method suppose to do what OOB spring binding for request params to DTO does, but through object mapper Since OOB spring binding will not populate attributes map with not matching params we make in null.protected com.broadleafcommerce.data.tracking.core.context.ContextInfoextractContext(com.broadleafcommerce.common.extension.intercommunication.ExternalRequest request, org.springframework.web.util.UriComponents uriComponents) <T,R extends Exception>
Tget(com.broadleafcommerce.common.extension.intercommunication.ExternalRequest request) protected Class<?>protected Methodprotected com.fasterxml.jackson.databind.ObjectMapperprotected com.fasterxml.jackson.databind.ObjectMapperprotected com.broadleafcommerce.common.extension.intercommunication.ExternalClientPropertiesprotected ExternalCatalogProviderPropertiesprotected com.broadleafcommerce.data.tracking.core.context.ContextInfoWebRequestResolverprotected org.springframework.web.reactive.function.client.WebClientprotected booleanvoidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
-
Field Details
-
ATTRIBUTES_PROPERTY_NAME
- See Also:
-
-
Constructor Details
-
ProductDetailExternalClient
public ProductDetailExternalClient(com.broadleafcommerce.common.extension.intercommunication.ExternalClientProperties properties, ExternalCatalogProviderProperties providerProperties, org.springframework.web.reactive.function.client.WebClient webClient, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfoWebRequestResolver requestResolver, @Nullable com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException - Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Throws:
org.springframework.beans.BeansException
-
get
public <T,R extends Exception> T get(com.broadleafcommerce.common.extension.intercommunication.ExternalRequest request) throws R - Specified by:
getin interfacecom.broadleafcommerce.common.extension.intercommunication.ExternalClient- Throws:
R extends Exception
-
convertQueryParamsToDto
protected Object convertQueryParamsToDto(org.springframework.util.MultiValueMap<String, String> queryParams, Class<?> clazz) This method suppose to do what OOB spring binding for request params to DTO does, but through object mapper Since OOB spring binding will not populate attributes map with not matching params we make in null.- Parameters:
queryParams- - a query params as MultiValueMapclazz- - class to convert to- Returns:
- - an instance of the clazz with populated poperties matched from the queryParams
-
extractContext
protected com.broadleafcommerce.data.tracking.core.context.ContextInfo extractContext(com.broadleafcommerce.common.extension.intercommunication.ExternalRequest request, org.springframework.web.util.UriComponents uriComponents) -
isCatalogServiceOnClasspath
protected boolean isCatalogServiceOnClasspath() -
getProperties
protected com.broadleafcommerce.common.extension.intercommunication.ExternalClientProperties getProperties() -
getProviderProperties
-
getWebClient
protected org.springframework.web.reactive.function.client.WebClient getWebClient() -
getRequestResolver
protected com.broadleafcommerce.data.tracking.core.context.ContextInfoWebRequestResolver getRequestResolver() -
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
getProductDetailsConversionMapper
protected com.fasterxml.jackson.databind.ObjectMapper getProductDetailsConversionMapper() -
getEndpoint
-
getMethod
-
getEndpointSupplier
-