Class HttpClientBuilder
- java.lang.Object
-
- io.vertx.reactivex.core.http.HttpClientBuilder
-
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate
public class HttpClientBuilder extends Object implements io.vertx.lang.rx.RxDelegate
A builder forHttpClient.NOTE: This class has been automatically generated from the
originalnon RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<HttpClientBuilder>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description HttpClientBuilder(HttpClientBuilder delegate)HttpClientBuilder(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpClientAgentbuild()Build and return the client.booleanequals(Object o)HttpClientBuildergetDelegate()inthashCode()static HttpClientBuildernewInstance(HttpClientBuilder arg)StringtoString()HttpClientBuilderwith(HttpClientOptions options)Configure the client options.HttpClientBuilderwith(PoolOptions options)Configure the client with the given pooloptions.HttpClientBuilderwithConnectHandler(Handler<HttpConnection> handler)Set a connection handler for the client.HttpClientBuilderwithLoadBalancer(LoadBalancer loadBalancer)Configure the client to use a load balancer.HttpClientBuilderwithRedirectHandler(Function<HttpClientResponse,Single<RequestOptions>> handler)Set a redirect handler for the http client.HttpClientBuilderwithRedirectHandler(Function<HttpClientResponse,Future<RequestOptions>> handler)Set a redirect handler for the http client.
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<HttpClientBuilder> __TYPE_ARG
-
-
Constructor Detail
-
HttpClientBuilder
public HttpClientBuilder(HttpClientBuilder delegate)
-
HttpClientBuilder
public HttpClientBuilder(Object delegate)
-
-
Method Detail
-
getDelegate
public HttpClientBuilder getDelegate()
- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
with
public HttpClientBuilder with(HttpClientOptions options)
Configure the client options.- Parameters:
options- the client options- Returns:
- a reference to this, so the API can be used fluently
-
with
public HttpClientBuilder with(PoolOptions options)
Configure the client with the given pooloptions.- Parameters:
options- the pool options- Returns:
- a reference to this, so the API can be used fluently
-
withConnectHandler
public HttpClientBuilder withConnectHandler(Handler<HttpConnection> handler)
Set a connection handler for the client. This handler is called when a new connection is established.- Parameters:
handler-- Returns:
- a reference to this, so the API can be used fluently
-
withRedirectHandler
public HttpClientBuilder withRedirectHandler(Function<HttpClientResponse,Future<RequestOptions>> handler)
Set a redirect handler for the http client.The redirect handler is called when a
3xxresponse is received and the request is configured to follow redirects withHttpClientRequest.setFollowRedirects(boolean).The redirect handler is passed the
HttpClientResponse, it can return anHttpClientRequestornull.- when null is returned, the original response is processed by the original request response handler
- when a new
Futureis returned, the client will send this new request
The handler must return a
Futureunsent so the client can further configure it and send it.- Parameters:
handler- the new redirect handler- Returns:
- a reference to this, so the API can be used fluently
-
withRedirectHandler
public HttpClientBuilder withRedirectHandler(Function<HttpClientResponse,Single<RequestOptions>> handler)
Set a redirect handler for the http client.The redirect handler is called when a
3xxresponse is received and the request is configured to follow redirects withHttpClientRequest.setFollowRedirects(boolean).The redirect handler is passed the
HttpClientResponse, it can return anHttpClientRequestornull.- when null is returned, the original response is processed by the original request response handler
- when a new
Futureis returned, the client will send this new request
The handler must return a
Futureunsent so the client can further configure it and send it.- Parameters:
handler- the new redirect handler- Returns:
- a reference to this, so the API can be used fluently
-
build
public HttpClientAgent build()
Build and return the client.- Returns:
- the client as configured by this builder
-
withLoadBalancer
public HttpClientBuilder withLoadBalancer(LoadBalancer loadBalancer)
Configure the client to use a load balancer.- Parameters:
loadBalancer- the load balancer- Returns:
-
newInstance
public static HttpClientBuilder newInstance(HttpClientBuilder arg)
-
-