public class FiberHttpClientBuilder extends Object
A convenience class for building HttpClient
instances.
Among other things,
Constructor and Description |
---|
FiberHttpClientBuilder(io.dropwizard.setup.Environment environment) |
FiberHttpClientBuilder(com.codahale.metrics.MetricRegistry metricRegistry) |
Modifier and Type | Method and Description |
---|---|
HttpClient |
build(String name)
Builds the
HttpClient . |
protected NHttpClientConnectionManager |
createConnectionManager(SchemeRegistry registry,
String name)
Create a InstrumentedClientConnManager based on the HttpClientConfiguration.
|
protected RequestConfig |
createHttpParams()
Map the parameters in HttpClientConfiguration to a BasicHttpParams object
|
protected void |
setStrategiesForClient(HttpAsyncClientBuilder client)
Add strategies to client such as ConnectionReuseStrategy and KeepAliveStrategy Note that this method mutates the client object by setting the strategies
|
FiberHttpClientBuilder |
using(DnsResolver resolver)
Use the given
DnsResolver instance. |
FiberHttpClientBuilder |
using(io.dropwizard.client.HttpClientConfiguration configuration)
Use the given
HttpClientConfiguration instance. |
FiberHttpClientBuilder |
using(HttpRequestRetryHandler httpRequestRetryHandler)
Uses the
httpRequestRetryHandler for handling request retries. |
FiberHttpClientBuilder |
using(SchemeRegistry registry)
Use the given
SchemeRegistry instance. |
public FiberHttpClientBuilder(com.codahale.metrics.MetricRegistry metricRegistry)
public FiberHttpClientBuilder(io.dropwizard.setup.Environment environment)
public FiberHttpClientBuilder using(io.dropwizard.client.HttpClientConfiguration configuration)
Use the given HttpClientConfiguration
instance.
configuration
- a HttpClientConfiguration
instancethis
public FiberHttpClientBuilder using(DnsResolver resolver)
Use the given DnsResolver
instance.
resolver
- a DnsResolver
instancethis
public FiberHttpClientBuilder using(HttpRequestRetryHandler httpRequestRetryHandler)
Uses the httpRequestRetryHandler
for handling request retries.
httpRequestRetryHandler
- an httpRequestRetryHandlerthis
public FiberHttpClientBuilder using(SchemeRegistry registry)
Use the given SchemeRegistry
instance.
registry
- a SchemeRegistry
instancethis
public HttpClient build(String name)
Builds the HttpClient
.
HttpClient
protected void setStrategiesForClient(HttpAsyncClientBuilder client)
Add strategies to client such as ConnectionReuseStrategy and KeepAliveStrategy Note that this method mutates the client object by setting the strategies
client
- The InstrumentedHttpClient that should be configured with strategiesprotected RequestConfig createHttpParams()
Map the parameters in HttpClientConfiguration to a BasicHttpParams object
protected NHttpClientConnectionManager createConnectionManager(SchemeRegistry registry, String name)
Create a InstrumentedClientConnManager based on the HttpClientConfiguration. It sets the maximum connections per route and the maximum total connections that the connection manager can create
registry
- the SchemeRegistry