Class AbstractExternalProvider
- java.lang.Object
-
- com.broadleafcommerce.orderoperation.service.provider.external.AbstractExternalProvider
-
- Direct Known Subclasses:
ExternalCampaignProvider,ExternalCartProvider,ExternalFulfillmentProvider,ExternalOfferProvider,ExternalOrderProvider,ExternalPaymentProvider,ExternalResourceLockProvider,ExternalReturnAuthorizationProvider
public abstract class AbstractExternalProvider extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringRSQL_FILTER_PARAM
-
Constructor Summary
Constructors Constructor Description AbstractExternalProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <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.ObjectMappergetObjectMapper()protected com.broadleafcommerce.common.extension.TypeFactorygetTypeFactory()protected org.springframework.web.reactive.function.client.WebClientgetWebClient()protected org.springframework.util.MultiValueMap<String,String>pageableToParams(org.springframework.data.domain.Pageable pageable)Converts a pageable into its corresponding query parameters.
-
-
-
Field Detail
-
RSQL_FILTER_PARAM
protected static final String RSQL_FILTER_PARAM
- See Also:
- Constant Field Values
-
-
Method Detail
-
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-ContextInfofrom the original request containing tenant and sandbox info- Returns:
- The headers to be passed along with the request to the provider.
-
pageableToParams
protected 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
-
executeRequest
protected <T> T executeRequest(Supplier<T> request)
Executes 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
-
getWebClient
protected org.springframework.web.reactive.function.client.WebClient getWebClient()
-
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-
-