Class ApacheHC5RDF4JHttpClientFactory
java.lang.Object
org.eclipse.rdf4j.http.client.apache5.ApacheHC5RDF4JHttpClientFactory
- All Implemented Interfaces:
RDF4JHttpClientFactory
RDF4JHttpClientFactory implementation that uses Apache HttpComponents 5.
Subclasses may override buildHttpClient(HttpClientBuilder, RDF4JHttpClientConfig) to apply additional
configuration to the HttpClientBuilder before the client is constructed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.hc.client5.http.impl.classic.CloseableHttpClientbuildHttpClient(org.apache.hc.client5.http.impl.classic.HttpClientBuilder builder, RDF4JHttpClientConfig config) Builds theCloseableHttpClientfrom the suppliedHttpClientBuilder.create()Creates a newRDF4JHttpClientwith default configuration.create(RDF4JHttpClientConfig config) Creates a newRDF4JHttpClientbacked by an Apache HttpComponents 5 client configured from the givenRDF4JHttpClientConfig.getName()
-
Constructor Details
-
ApacheHC5RDF4JHttpClientFactory
public ApacheHC5RDF4JHttpClientFactory()
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceRDF4JHttpClientFactory- Returns:
- a short identifier for this factory, e.g.
"jdk"or"apache5".
-
create
Description copied from interface:RDF4JHttpClientFactoryCreates a newRDF4JHttpClientwith default configuration.- Specified by:
createin interfaceRDF4JHttpClientFactory- Returns:
- a new client.
-
create
Creates a newRDF4JHttpClientbacked by an Apache HttpComponents 5 client configured from the givenRDF4JHttpClientConfig.The
HttpClientBuilderis fully configured fromconfigbefore being passed tobuildHttpClient(HttpClientBuilder, RDF4JHttpClientConfig). Subclasses may override that method to apply additional customization before the client is built.- Specified by:
createin interfaceRDF4JHttpClientFactory- Parameters:
config- the client configuration; must not benull- Returns:
- a new
RDF4JHttpClient
-
buildHttpClient
protected org.apache.hc.client5.http.impl.classic.CloseableHttpClient buildHttpClient(org.apache.hc.client5.http.impl.classic.HttpClientBuilder builder, RDF4JHttpClientConfig config) Builds theCloseableHttpClientfrom the suppliedHttpClientBuilder.The builder has already been fully configured by
create(RDF4JHttpClientConfig)when this method is called. Subclasses may override this method to apply additional configuration to the builder before callingsuper.buildHttpClient(builder, config), or to replace the build entirely.- Parameters:
builder- the pre-configured builder; must not benullconfig- the client configuration that was used to configure the builder; must not benull- Returns:
- the built
CloseableHttpClient
-