public abstract class SingleEndpointGoodDataRestProvider extends Object implements GoodDataRestProvider
GoodDataRestProvider capable to be used with single API endpoint using the
Apache HttpClient to perform HTTP operations. It provides following functionality:
UriPrefixingClientHttpRequestFactoryResponseErrorHandlerGoodDataSettingsGoodDataSettings including User-AgentGoodDataHttpClientBuilder to the constructor. Namely the authentication logic remains to be provided by descendants.| Modifier and Type | Field and Description |
|---|---|
protected GoodDataEndpoint |
endpoint |
protected org.apache.http.client.HttpClient |
httpClient |
protected org.springframework.web.client.RestTemplate |
restTemplate |
protected GoodDataSettings |
settings |
| Modifier | Constructor and Description |
|---|---|
protected |
SingleEndpointGoodDataRestProvider(GoodDataEndpoint endpoint,
GoodDataSettings settings,
GoodDataHttpClientBuilder builder)
Creates new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.http.impl.client.HttpClientBuilder |
createHttpClientBuilder(GoodDataSettings settings)
Creates http client builder, applying given settings.
|
protected org.springframework.web.client.RestTemplate |
createRestTemplate(GoodDataEndpoint endpoint,
GoodDataSettings settings,
org.apache.http.client.HttpClient httpClient)
Creates configured REST template
|
Optional<DataStoreService> |
getDataStoreService(Supplier<String> stagingUriSupplier)
Configured DataStoreService if provided.
|
GoodDataEndpoint |
getEndpoint() |
org.apache.http.client.HttpClient |
getHttpClient() |
org.springframework.web.client.RestTemplate |
getRestTemplate()
Configured RestTemplate instance.
|
GoodDataSettings |
getSettings()
Settings used by the provider.
|
protected final GoodDataEndpoint endpoint
protected final GoodDataSettings settings
protected org.apache.http.client.HttpClient httpClient
protected org.springframework.web.client.RestTemplate restTemplate
protected SingleEndpointGoodDataRestProvider(GoodDataEndpoint endpoint, GoodDataSettings settings, GoodDataHttpClientBuilder builder)
endpoint - API endpointsettings - settingsbuilder - custom GoodData http client builderpublic org.springframework.web.client.RestTemplate getRestTemplate()
GoodDataRestProvidergetRestTemplate in interface GoodDataRestProviderpublic GoodDataSettings getSettings()
GoodDataRestProvidergetSettings in interface GoodDataRestProviderpublic Optional<DataStoreService> getDataStoreService(Supplier<String> stagingUriSupplier)
GoodDataRestProvidergetDataStoreService in interface GoodDataRestProviderstagingUriSupplier - supplier of the data store endpointpublic GoodDataEndpoint getEndpoint()
public org.apache.http.client.HttpClient getHttpClient()
protected org.springframework.web.client.RestTemplate createRestTemplate(GoodDataEndpoint endpoint, GoodDataSettings settings, org.apache.http.client.HttpClient httpClient)
endpoint - API endpointsettings - settingshttpClient - http client to build RestTemplate onprotected org.apache.http.impl.client.HttpClientBuilder createHttpClientBuilder(GoodDataSettings settings)
settings - settings to applyCopyright © 2019. All rights reserved.