public class ExternalClientBuilder
extends java.lang.Object
Constructor and Description |
---|
ExternalClientBuilder(io.dropwizard.setup.Environment environment,
HttpClientConfiguration httpClientConfiguration,
io.opentracing.Tracer tracer) |
Modifier and Type | Method and Description |
---|---|
T |
addFeature(javax.ws.rs.core.Feature feature)
Adds a feature used by the client.
|
T |
addFilter(javax.ws.rs.client.ClientRequestFilter clientRequestFilter)
Adds a request filter to the client.
|
<A> ApiClientBuilder<A> |
api(java.lang.Class<A> apiInterface)
Creates a client proxy implementation for accessing another service.
|
<A> ApiClientBuilder<A> |
api(java.lang.Class<A> apiInterface,
java.lang.String customName)
Creates a client proxy implementation for accessing another service.
|
javax.ws.rs.client.Client |
buildGenericClient(java.lang.String name)
Builds a generic client that can be used for Http requests.
|
T |
disableFollowRedirects()
Set this client to not follow redirects and therewith automatically resolve 3xx status codes
|
T |
withConnectionTimeout(java.time.Duration connectionTimeout)
Deprecated.
The client is now configurable with the Dropwizard configuration. Please use
HttpClientConfiguration.setConnectionTimeout(io.dropwizard.util.Duration) instead. |
T |
withReadTimeout(java.time.Duration readTimeout)
Deprecated.
The client is now configurable with the Dropwizard configuration. Please use
HttpClientConfiguration.setTimeout(io.dropwizard.util.Duration) instead. |
public ExternalClientBuilder(io.dropwizard.setup.Environment environment, HttpClientConfiguration httpClientConfiguration, io.opentracing.Tracer tracer)
public T addFilter(javax.ws.rs.client.ClientRequestFilter clientRequestFilter)
clientRequestFilter
- the filter to addpublic T addFeature(javax.ws.rs.core.Feature feature)
feature
- to be added@Deprecated public T withConnectionTimeout(java.time.Duration connectionTimeout)
HttpClientConfiguration.setConnectionTimeout(io.dropwizard.util.Duration)
instead.If the connection timeout is overdue a ProcessingException
wrapping a
ConnectTimeoutException
is thrown by the client.
connectionTimeout
- the time to wait until a connection to the remote service is
established@Deprecated public T withReadTimeout(java.time.Duration readTimeout)
HttpClientConfiguration.setTimeout(io.dropwizard.util.Duration)
instead.If the connection timeout is overdue a ProcessingException
wrapping a
SocketTimeoutException
is thrown by the client.
readTimeout
- the time to wait for content in an established connectionpublic T disableFollowRedirects()
public javax.ws.rs.client.Client buildGenericClient(java.lang.String name)
name
- the name of the client is used for metrics and thread namespublic <A> ApiClientBuilder<A> api(java.lang.Class<A> apiInterface)
A
- the type of the apiapiInterface
- the interface that declares the API using JAX-RS annotations.public <A> ApiClientBuilder<A> api(java.lang.Class<A> apiInterface, java.lang.String customName)
A
- the type of the apiapiInterface
- the interface that declares the API using JAX-RS annotations.customName
- the custom name to use for the client. The name is used for the executor
service and metrics. Names have to be unique.