Class AbstractRestApiExternalProvider
java.lang.Object
com.broadleafcommerce.dataexchange.service.provider.external.AbstractRestApiExternalProvider
- All Implemented Interfaces:
NodeBuilder
- Direct Known Subclasses:
ExternalAdvancedTagProvider
,ExternalCatalogProvider
,ExternalInventoryProvider
,ExternalPriceProvider
,ExternalProductAssetProvider
- Author:
- Kelly Tisdell (ktisdell)
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractRestApiExternalProvider
(com.fasterxml.jackson.databind.ObjectMapper mapper, org.springframework.web.reactive.function.client.WebClient webClient, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addNarrowedPageableParams
(org.springframework.util.MultiValueMap<String, String> params) 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) getFilterParams
(cz.jirutka.rsql.parser.ast.Node node) getFilterParams
(String filter) 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>
getMostDerivedType
(Class<?> type) 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 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>
TsetCorrelationIds
(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
Methods inherited from interface com.broadleafcommerce.dataexchange.service.NodeBuilder
buildAndNode, buildAndNode, buildEqualsNode, buildInNode, buildInNode, buildOrNode, buildOrNode, emptyNode, escapeSpecialCharacters, filterEmptyNodes, filterEmptyNodes, isEmptyNodeOrNull
-
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
Set the correlation ids on created/updated entities after saving.- Type Parameters:
T
- the type of entity- Parameters:
beforeSave
- the entity before savingafterSave
- the entity after saving- Returns:
- the entity after saving with correlation ids set
-
getMostDerivedType
-
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
-
addNarrowedPageableParams
-
getFilterParams
-
getFilterParams
-
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()
-