public abstract class AbstractExternalProvider extends Object
Constructor and Description |
---|
AbstractExternalProvider(org.springframework.web.reactive.function.client.WebClient webClient,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
com.broadleafcommerce.common.extension.TypeFactory typeFactory) |
Modifier and Type | Method and Description |
---|---|
protected <T> T |
executeRequest(Supplier<T> request)
Executes a request with default Web Client error handling.
|
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 |
getObjectMapper() |
protected com.broadleafcommerce.common.extension.TypeFactory |
getTypeFactory() |
protected org.springframework.web.reactive.function.client.WebClient |
getWebClient() |
protected org.springframework.util.MultiValueMap<String,String> |
pageableToParams(org.springframework.data.domain.Pageable pageable)
Converts a pageable into its corresponding query parameters.
|
protected Map<String,Object> |
uriVars(Object... keysAndValues)
Convenience method to generate a map of variables.
|
public AbstractExternalProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
protected org.springframework.http.HttpHeaders getHeaders(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
contextInfo
- ContextInfo
from the original request containing tenant and
sandbox infoprotected <T> T executeRequest(Supplier<T> request)
T
- the return type of the request operationrequest
- the request to executeprotected Map<String,Object> uriVars(Object... keysAndValues)
keysAndValues
- the keys and values (in pairs, alternating) to transform into a mapprotected org.springframework.util.MultiValueMap<String,String> pageableToParams(@Nullable org.springframework.data.domain.Pageable pageable)
pageable
- the pageable to convertprotected org.springframework.web.reactive.function.client.WebClient getWebClient()
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
Copyright © 2021. All rights reserved.