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 Details

  • 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:
      setBeanFactory in interface org.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:
      get in interface com.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 MultiValueMap
      clazz - - 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

      protected ExternalCatalogProviderProperties 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

      protected Class<?> getEndpoint()
    • getMethod

      protected Method getMethod()
    • getEndpointSupplier

      protected Supplier<Object> getEndpointSupplier()