Interface HttpClient.EndpointBuilder<A extends ExchangeContext,B extends Exchange<A>,C extends InterceptableExchange<A>>
- Type Parameters:
A
- the exchange context typeB
- the exchange typeC
- the interceptable exchange type
- Enclosing interface:
HttpClient
A builder of Endpoint
.
Endpoint builders are created by invoking HttpClient.endpoint(java.net.InetSocketAddress)
.
- Since:
- 1.6
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the endpoint.configuration
(HttpClientConfiguration configuration) Sets a specific HTTP client configuration for the endpoint.interceptor
(ExchangeInterceptor<? super A, C> exchangeInterceptor) Specifies an interceptor to intercept requests before they are sent to the endpoint.default HttpClient.EndpointBuilder
<A, B, C> localAddress
(String host, int port) Sets the local address with the specified host and port.localAddress
(InetSocketAddress localAddress) Sets the local address.netConfiguration
(NetClientConfiguration netConfiguration) Sets a specific Net client configuration for the endpoint.
-
Method Details
-
localAddress
Sets the local address with the specified host and port.
- Parameters:
host
- the local hostport
- the local port- Returns:
- this builder
-
localAddress
Sets the local address.
- Parameters:
localAddress
- the local address- Returns:
- this builder
-
configuration
Sets a specific HTTP client configuration for the endpoint.
A base configuration is provided in the enclosing HTTP client, this method allows to override it for the resulting endpoint only.
- Parameters:
configuration
- an HTTP client configuration- Returns:
- this builder
-
netConfiguration
Sets a specific Net client configuration for the endpoint.
A base configuration is provided in the enclosing HTTP client, this method allows to override it for the resulting endpoint only.
- Parameters:
netConfiguration
- a net client configuration- Returns:
- this builder
-
interceptor
Specifies an interceptor to intercept requests before they are sent to the endpoint.
When invoked multiple time this method chains the interceptors one after the other.
- Parameters:
exchangeInterceptor
- an exchange interceptor- Returns:
- the request
-
build
Builds the endpoint.
- Returns:
- an endpoint
-