Class AbstractRestApiExternalProvider

java.lang.Object
com.broadleafcommerce.dataexchange.service.provider.external.AbstractRestApiExternalProvider
All Implemented Interfaces:
NodeBuilder
Direct Known Subclasses:
ExternalAdvancedTagProvider, ExternalCatalogProvider, ExternalInventoryProvider, ExternalPriceProvider, ExternalProductAssetProvider

public abstract class AbstractRestApiExternalProvider extends Object implements NodeBuilder
Author:
Kelly Tisdell (ktisdell)
  • Constructor Details

    • AbstractRestApiExternalProvider

      public AbstractRestApiExternalProvider(com.fasterxml.jackson.databind.ObjectMapper mapper, org.springframework.web.reactive.function.client.WebClient webClient, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
  • Method Details

    • getHeaders

      protected org.springframework.http.HttpHeaders getHeaders(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Builds the headers to be passed along with the request to the provider.
      Parameters:
      contextInfo - ContextInfo from the original request containing tenant and sandbox info
      Returns:
      The headers to be passed along with the request to the provider.
    • setCorrelationIds

      protected <T extends ExchangeObject> T setCorrelationIds(T beforeSave, T afterSave)
      Set the correlation ids on created/updated entities after saving.
      Type Parameters:
      T - the type of entity
      Parameters:
      beforeSave - the entity before saving
      afterSave - the entity after saving
      Returns:
      the entity after saving with correlation ids set
    • getMostDerivedType

      protected <D> Class<D> getMostDerivedType(Class<?> type)
    • getRequest

      protected org.springframework.web.reactive.function.client.WebClient.RequestHeadersSpec<?> getRequest(String uri, BatchContext<?> batchContext)
    • getRequest

      protected org.springframework.web.reactive.function.client.WebClient.RequestHeadersSpec<?> getRequest(String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • postRequest

      protected org.springframework.web.reactive.function.client.WebClient.RequestBodySpec postRequest(String uri, BatchContext<?> batchContext)
    • postRequest

      protected org.springframework.web.reactive.function.client.WebClient.RequestBodySpec postRequest(String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • patchRequest

      protected org.springframework.web.reactive.function.client.WebClient.RequestBodySpec patchRequest(String uri, BatchContext<?> batchContext)
    • patchRequest

      protected org.springframework.web.reactive.function.client.WebClient.RequestBodySpec patchRequest(String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • putRequest

      protected org.springframework.web.reactive.function.client.WebClient.RequestBodySpec putRequest(String uri, BatchContext<?> batchContext)
    • putRequest

      protected org.springframework.web.reactive.function.client.WebClient.RequestBodySpec putRequest(String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • deleteRequest

      protected org.springframework.web.reactive.function.client.WebClient.RequestHeadersSpec<?> deleteRequest(String uri, BatchContext<?> batchContext)
    • deleteRequest

      protected org.springframework.web.reactive.function.client.WebClient.RequestHeadersSpec<?> deleteRequest(String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • narrowedPageParams

      protected org.springframework.util.MultiValueMap<String,String> narrowedPageParams()
    • addNarrowedPageableParams

      protected void addNarrowedPageableParams(org.springframework.util.MultiValueMap<String,String> params)
    • getFilterParams

      protected org.springframework.util.MultiValueMap<String,String> getFilterParams(@Nullable cz.jirutka.rsql.parser.ast.Node node)
    • getFilterParams

      protected org.springframework.util.MultiValueMap<String,String> getFilterParams(@Nullable String filter)
    • getServiceClient

      protected abstract String getServiceClient()
      Returns:
      Returns the service client name to be used for the request.
    • getMapper

      protected com.fasterxml.jackson.databind.ObjectMapper getMapper()
    • getWebClient

      protected org.springframework.web.reactive.function.client.WebClient getWebClient()
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()