public final class HttpClientAccessor extends Object
HttpClient
s.Constructor and Description |
---|
HttpClientAccessor() |
Modifier and Type | Method and Description |
---|---|
static org.apache.http.client.HttpClient |
getHttpClient(Destination destination) |
static org.apache.http.client.HttpClient |
getHttpClient(String destinationName) |
static HttpClientFactory |
getHttpClientProvider()
Configures the
HttpClientFactory that is used when creating instances of HttpClient within the
HttpClientAccessor . |
static void |
setHttpClientProvider(HttpClientFactory httpClientProvider)
Configures the
HttpClientFactory that is used when creating instances of HttpClient within the
HttpClientAccessor . |
public static org.apache.http.client.HttpClient getHttpClient(String destinationName) throws DestinationNotFoundException, DestinationAccessException, HttpClientInstantiationException
HttpClient
for the Destination
with the given name. The instance may be cached.DestinationNotFoundException
- If no Destination
can be found for the given name.DestinationAccessException
- If there is an issue accessing the Destination
.HttpClientInstantiationException
- If there is an issue creating the HttpClient
.public static org.apache.http.client.HttpClient getHttpClient(Destination destination) throws DestinationAccessException, HttpClientInstantiationException
HttpClient
for the given Destination
. The instance may be cached.DestinationAccessException
- If there is an issue accessing the Destination
.HttpClientInstantiationException
- If there is an issue creating the HttpClient
.@Generated(value="lombok") public static HttpClientFactory getHttpClientProvider()
HttpClientFactory
that is used when creating instances of HttpClient
within the
HttpClientAccessor
.
CAUTION: This factory is accessed concurrently. Therefore, you have to make sure that you do not
introduce any concurrency issues when changing the factory. Futhermore, be aware that setting a custom factory
will affect all consumers of the HttpClientAccessor
within the application.
@Generated(value="lombok") public static void setHttpClientProvider(HttpClientFactory httpClientProvider)
HttpClientFactory
that is used when creating instances of HttpClient
within the
HttpClientAccessor
.
CAUTION: This factory is accessed concurrently. Therefore, you have to make sure that you do not
introduce any concurrency issues when changing the factory. Futhermore, be aware that setting a custom factory
will affect all consumers of the HttpClientAccessor
within the application.
Copyright © 2017 SAP SE. All rights reserved.