Interface HttpClientFactory
- All Known Implementing Classes:
AbstractHttpClientFactory
,DefaultHttpClientFactory
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Factory class that creates
HttpClient
instances based on the given Destination
.
Caution: Implementations must be thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptiondefault org.apache.http.client.HttpClient
Creates anHttpClient
independent of any destination.org.apache.http.client.HttpClient
createHttpClient
(HttpDestinationProperties destination) Creates anHttpClient
based on the givenHttpDestinationProperties
.
-
Method Details
-
createHttpClient
@Nonnull default org.apache.http.client.HttpClient createHttpClient()Creates anHttpClient
independent of any destination.Caution: Implementations must ensure that this method is thread-safe.
- Returns:
- An
HttpClient
, independent of any destination. - Throws:
HttpClientInstantiationException
- if there occurred an error during the creation of the client.
-
createHttpClient
@Nonnull org.apache.http.client.HttpClient createHttpClient(@Nullable HttpDestinationProperties destination) throws DestinationAccessException, HttpClientInstantiationException Creates anHttpClient
based on the givenHttpDestinationProperties
.Caution: Implementations must ensure that this method is thread-safe.
- Parameters:
destination
- The destination to create theHttpClient
for.- Returns:
- An
HttpClient
based on the given Destination. - Throws:
DestinationAccessException
- if the type of the destination is not HTTP.HttpClientInstantiationException
- if there occurred an error during the creation of the client.
-