Interface HttpClient.EndpointBuilder<A extends ExchangeContext,B extends Exchange<A>,C extends InterceptableExchange<A>>

Type Parameters:
A - the exchange context type
B - the exchange type
C - the interceptable exchange type
Enclosing interface:
HttpClient

public static interface HttpClient.EndpointBuilder<A extends ExchangeContext,B extends Exchange<A>,C extends InterceptableExchange<A>>

A builder of Endpoint.

Endpoint builders are created by invoking HttpClient.endpoint(java.net.InetSocketAddress).

Since:
1.6
Author:
Jeremy Kuhn
  • Method Details

    • localAddress

      default HttpClient.EndpointBuilder<A,B,C> localAddress(String host, int port)

      Sets the local address with the specified host and port.

      Parameters:
      host - the local host
      port - the local port
      Returns:
      this builder
    • localAddress

      HttpClient.EndpointBuilder<A,B,C> localAddress(InetSocketAddress localAddress)

      Sets the local address.

      Parameters:
      localAddress - the local address
      Returns:
      this builder
    • configuration

      HttpClient.EndpointBuilder<A,B,C> configuration(HttpClientConfiguration 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

      HttpClient.EndpointBuilder<A,B,C> netConfiguration(NetClientConfiguration 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

      HttpClient.EndpointBuilder<A,B,C> interceptor(ExchangeInterceptor<? super A,C> exchangeInterceptor)

      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

      Endpoint<A> build()

      Builds the endpoint.

      Returns:
      an endpoint