Class AbstractRestApiExternalProvider

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

public abstract class AbstractRestApiExternalProvider extends Object
Author:
Kelly Tisdell (ktisdell)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    protected cz.jirutka.rsql.parser.ast.Node
    buildAndNode(cz.jirutka.rsql.parser.ast.Node... nodes)
     
    protected cz.jirutka.rsql.parser.ast.Node
    buildAndNode(Collection<cz.jirutka.rsql.parser.ast.Node> nodes)
     
    protected cz.jirutka.rsql.parser.ast.Node
    buildEqualsNode(String propName, String value)
     
    protected cz.jirutka.rsql.parser.ast.Node
    buildInNode(String propName, String... values)
     
    protected cz.jirutka.rsql.parser.ast.Node
    buildInNode(String propName, Collection<String> values)
     
    protected cz.jirutka.rsql.parser.ast.Node
    buildOrNode(cz.jirutka.rsql.parser.ast.Node... nodes)
     
    protected cz.jirutka.rsql.parser.ast.Node
    buildOrNode(Collection<cz.jirutka.rsql.parser.ast.Node> nodes)
     
    protected org.springframework.web.reactive.function.client.WebClient.RequestHeadersSpec<?>
    deleteRequest(String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    protected org.springframework.web.reactive.function.client.WebClient.RequestHeadersSpec<?>
    deleteRequest(String uri, BatchContext<?> batchContext)
     
    protected cz.jirutka.rsql.parser.ast.Node
     
    protected List<cz.jirutka.rsql.parser.ast.Node>
    filterEmptyNodes(cz.jirutka.rsql.parser.ast.Node... nodes)
     
    protected List<cz.jirutka.rsql.parser.ast.Node>
    filterEmptyNodes(Collection<cz.jirutka.rsql.parser.ast.Node> nodes)
     
    protected org.springframework.http.HttpHeaders
    getHeaders(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Builds the headers to be passed along with the request to the provider.
    protected com.fasterxml.jackson.databind.ObjectMapper
     
    protected <D> Class<D>
     
    protected org.springframework.web.reactive.function.client.WebClient.RequestHeadersSpec<?>
    getRequest(String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    protected org.springframework.web.reactive.function.client.WebClient.RequestHeadersSpec<?>
    getRequest(String uri, BatchContext<?> batchContext)
     
    protected abstract String
     
    protected com.broadleafcommerce.common.extension.TypeFactory
     
    protected org.springframework.web.reactive.function.client.WebClient
     
    protected boolean
    isEmptyNodeOrNull(cz.jirutka.rsql.parser.ast.Node node)
     
    protected org.springframework.util.MultiValueMap<String,String>
     
    protected org.springframework.web.reactive.function.client.WebClient.RequestBodySpec
    patchRequest(String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    protected org.springframework.web.reactive.function.client.WebClient.RequestBodySpec
    patchRequest(String uri, BatchContext<?> batchContext)
     
    protected org.springframework.web.reactive.function.client.WebClient.RequestBodySpec
    postRequest(String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    protected org.springframework.web.reactive.function.client.WebClient.RequestBodySpec
    postRequest(String uri, BatchContext<?> batchContext)
     
    protected org.springframework.web.reactive.function.client.WebClient.RequestBodySpec
    putRequest(String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    protected org.springframework.web.reactive.function.client.WebClient.RequestBodySpec
    putRequest(String uri, BatchContext<?> batchContext)
     
    protected <T extends ExchangeObject>
    T
    setCorrelationIds(T beforeSave, T afterSave)
    Set the correlation ids on created/updated entities after saving.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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)
    • isEmptyNodeOrNull

      protected boolean isEmptyNodeOrNull(@Nullable cz.jirutka.rsql.parser.ast.Node node)
    • 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()
    • buildInNode

      protected cz.jirutka.rsql.parser.ast.Node buildInNode(String propName, Collection<String> values)
    • buildInNode

      protected cz.jirutka.rsql.parser.ast.Node buildInNode(String propName, String... values)
    • buildOrNode

      protected cz.jirutka.rsql.parser.ast.Node buildOrNode(@NonNull cz.jirutka.rsql.parser.ast.Node... nodes)
    • buildOrNode

      protected cz.jirutka.rsql.parser.ast.Node buildOrNode(@NonNull Collection<cz.jirutka.rsql.parser.ast.Node> nodes)
    • buildEqualsNode

      protected cz.jirutka.rsql.parser.ast.Node buildEqualsNode(String propName, String value)
    • buildAndNode

      protected cz.jirutka.rsql.parser.ast.Node buildAndNode(@NonNull cz.jirutka.rsql.parser.ast.Node... nodes)
    • buildAndNode

      protected cz.jirutka.rsql.parser.ast.Node buildAndNode(Collection<cz.jirutka.rsql.parser.ast.Node> nodes)
    • emptyNode

      protected cz.jirutka.rsql.parser.ast.Node emptyNode()
    • filterEmptyNodes

      protected List<cz.jirutka.rsql.parser.ast.Node> filterEmptyNodes(Collection<cz.jirutka.rsql.parser.ast.Node> nodes)
    • filterEmptyNodes

      protected List<cz.jirutka.rsql.parser.ast.Node> filterEmptyNodes(cz.jirutka.rsql.parser.ast.Node... nodes)
    • 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()