Class AbstractExternalProvider
java.lang.Object
com.broadleafcommerce.tabby.provider.external.AbstractExternalProvider
- Direct Known Subclasses:
- ExternalCustomerOrderInfoProvider,- ExternalTabbyProvider
An abstract class that is used to execute the requests to the gateway API using the
 
WebClient.- 
Constructor SummaryConstructorsConstructorDescriptionAbstractExternalProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected <T> TexecuteRequest(Supplier<T> request) Executes a request with default Web Client error handling.protected org.springframework.http.HttpHeadersgetHeaders(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.ObjectMapperprotected org.springframework.web.reactive.function.client.WebClientprotected StringorderToParamValue(org.springframework.data.domain.Sort.Order order) Converts a sort order into a query parameter value (e.g.pageableToParams(org.springframework.data.domain.Pageable pageable) Converts a pageable into its corresponding query parameters.Convenience method to generate a map of variables.
- 
Constructor Details- 
AbstractExternalProviderpublic AbstractExternalProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper) 
 
- 
- 
Method Details- 
executeRequestExecutes a request with default Web Client error handling.- Type Parameters:
- T- the return type of the request operation
- Parameters:
- request- the request to execute
- Returns:
- the value generated by the supplier
 
- 
getHeadersprotected 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-- ContextInfofrom the original request containing tenant and sandbox info
- Returns:
- The headers to be passed along with the request to the provider.
 
- 
pageableToParamsprotected org.springframework.util.MultiValueMap<String,String> pageableToParams(@Nullable org.springframework.data.domain.Pageable pageable) Converts a pageable into its corresponding query parameters.- Parameters:
- pageable- the pageable to convert
- Returns:
- a map of query parameters
 
- 
orderToParamValueConverts a sort order into a query parameter value (e.g. name,asc).- Parameters:
- order- the sort order to convert
- Returns:
- the query parameter value for the sort order
 
- 
uriVarsConvenience method to generate a map of variables.- Parameters:
- keysAndValues- the keys and values (in pairs, alternating) to transform into a map
- Returns:
- the keys and values as a map
 
- 
getWebClientprotected org.springframework.web.reactive.function.client.WebClient getWebClient()
- 
getObjectMapperprotected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
 
-