public final class HttpClientConfig extends ClientTransportConfig<HttpClientConfig>
Modifier and Type | Method and Description |
---|---|
String |
baseUrl()
Return the configure base URL to use for this request/response or null.
|
int |
channelHash() |
ChannelOperations.OnSetup |
channelOperationsProvider()
Return the associated
ChannelOperations.OnSetup , config implementations might override this |
ClientCookieDecoder |
cookieDecoder()
Return the configured
ClientCookieDecoder or the default ClientCookieDecoder.STRICT . |
ClientCookieEncoder |
cookieEncoder()
Return the configured
ClientCookieEncoder or the default ClientCookieEncoder.STRICT . |
HttpResponseDecoderSpec |
decoder()
Return the configured HTTP response decoder options or the default.
|
AddressResolverGroup<?> |
defaultAddressResolverGroup()
Provides a global
AddressResolverGroup from HttpResources
that is shared amongst all HTTP clients. |
protected ConnectionObserver |
defaultConnectionObserver()
Return the configured default
ConnectionObserver . |
protected LoggingHandler |
defaultLoggingHandler()
Return the default
LoggingHandler to wiretap this transport |
protected LoopResources |
defaultLoopResources()
Return the default
LoopResources for this transport |
protected ChannelMetricsRecorder |
defaultMetricsRecorder()
Return the configured metrics recorder.
|
protected ChannelPipelineConfigurer |
defaultOnChannelInit()
Return the default callback if any or
ChannelPipelineConfigurer.emptyConfigurer() |
java.util.function.BiPredicate<HttpClientRequest,HttpClientResponse> |
followRedirectPredicate()
Return the configured follow redirect predicate or null.
|
HttpHeaders |
headers()
Return a copy of the request headers.
|
Http2SettingsSpec |
http2SettingsSpec()
Return the HTTP/2 configuration
|
boolean |
isAcceptGzip()
Return whether GZip compression is enabled.
|
boolean |
isRetryDisabled()
Return true if
retry once is disabled, false otherwise. |
boolean |
isSecure()
Returns true if that
HttpClient secured via SSL transport |
protected void |
loggingHandler(LoggingHandler loggingHandler) |
HttpMethod |
method()
Return the configured request method.
|
protected void |
metricsRecorder(java.util.function.Supplier<? extends ChannelMetricsRecorder> metricsRecorder) |
HttpProtocol[] |
protocols()
Return the HTTP protocol to support.
|
protected void |
proxyProvider(ProxyProvider proxyProvider) |
java.util.function.BiConsumer<HttpHeaders,HttpClientRequest> |
redirectRequestBiConsumer()
Return the configured redirect request
BiConsumer or null. |
java.util.function.Consumer<HttpClientRequest> |
redirectRequestConsumer()
Return the configured redirect request consumer or null.
|
protected AddressResolverGroup<?> |
resolverInternal() |
java.time.Duration |
responseTimeout()
Return the configured response timeout or null
|
SslProvider |
sslProvider()
Returns the current
SslProvider if that HttpClient secured via SSL
transport or null |
String |
uri()
Return the configured request uri.
|
java.util.function.Function<String,String> |
uriTagValue()
Returns the configured function that receives the actual uri and returns the uri tag value
that will be used for the metrics with
Metrics.URI tag |
WebsocketClientSpec |
websocketClientSpec()
Return the configured websocket client configuration.
|
channelType, connectionProvider, doOnConnect, doOnConnected, doOnDisconnected, eventLoopGroup, getNameResolverProvider, hasProxy, proxyProvider, remoteAddress, resolver
attributes, bindAddress, channelGroup, channelInitializer, connectionFactory, connectionObserver, doOnChannelInit, isPreferNative, loggingHandler, loopResources, metricsRecorder, options, updateMap
@Nullable public String baseUrl()
public int channelHash()
channelHash
in class ClientTransportConfig<HttpClientConfig>
public ChannelOperations.OnSetup channelOperationsProvider()
TransportConfig
ChannelOperations.OnSetup
, config implementations might override thischannelOperationsProvider
in class TransportConfig
ChannelOperations.OnSetup
public ClientCookieDecoder cookieDecoder()
ClientCookieDecoder
or the default ClientCookieDecoder.STRICT
.ClientCookieDecoder
or the default ClientCookieDecoder.STRICT
public ClientCookieEncoder cookieEncoder()
ClientCookieEncoder
or the default ClientCookieEncoder.STRICT
.ClientCookieEncoder
or the default ClientCookieEncoder.STRICT
public HttpResponseDecoderSpec decoder()
@Nullable public java.util.function.BiPredicate<HttpClientRequest,HttpClientResponse> followRedirectPredicate()
public HttpHeaders headers()
public Http2SettingsSpec http2SettingsSpec()
public boolean isAcceptGzip()
public boolean isRetryDisabled()
retry once
is disabled, false otherwise.retry once
is disabled, false otherwisepublic boolean isSecure()
HttpClient
secured via SSL transportHttpClient
secured via SSL transportpublic HttpMethod method()
public HttpProtocol[] protocols()
HttpProtocol.HTTP11
.@Nullable public java.util.function.BiConsumer<HttpHeaders,HttpClientRequest> redirectRequestBiConsumer()
BiConsumer
or null.BiConsumer
or null@Nullable public java.util.function.Consumer<HttpClientRequest> redirectRequestConsumer()
@Nullable public java.time.Duration responseTimeout()
@Nullable public SslProvider sslProvider()
SslProvider
if that HttpClient
secured via SSL
transport or nullSslProvider
if that HttpClient
secured via SSL
transport or nullpublic String uri()
@Nullable public java.util.function.Function<String,String> uriTagValue()
Metrics.URI
tagMetrics.URI
tagpublic WebsocketClientSpec websocketClientSpec()
public AddressResolverGroup<?> defaultAddressResolverGroup()
AddressResolverGroup
from HttpResources
that is shared amongst all HTTP clients. AddressResolverGroup
uses the global
LoopResources
from HttpResources
.defaultAddressResolverGroup
in class ClientTransportConfig<HttpClientConfig>
AddressResolverGroup
protected ConnectionObserver defaultConnectionObserver()
TransportConfig
ConnectionObserver
.defaultConnectionObserver
in class ClientTransportConfig<HttpClientConfig>
ConnectionObserver
protected LoggingHandler defaultLoggingHandler()
TransportConfig
LoggingHandler
to wiretap this transportdefaultLoggingHandler
in class TransportConfig
LoggingHandler
to wiretap this transportprotected LoopResources defaultLoopResources()
TransportConfig
LoopResources
for this transportdefaultLoopResources
in class TransportConfig
LoopResources
for this transportprotected ChannelMetricsRecorder defaultMetricsRecorder()
TransportConfig
defaultMetricsRecorder
in class TransportConfig
protected ChannelPipelineConfigurer defaultOnChannelInit()
TransportConfig
ChannelPipelineConfigurer.emptyConfigurer()
defaultOnChannelInit
in class ClientTransportConfig<HttpClientConfig>
ChannelPipelineConfigurer.emptyConfigurer()
protected void loggingHandler(LoggingHandler loggingHandler)
loggingHandler
in class TransportConfig
protected void metricsRecorder(@Nullable java.util.function.Supplier<? extends ChannelMetricsRecorder> metricsRecorder)
metricsRecorder
in class TransportConfig
protected void proxyProvider(ProxyProvider proxyProvider)
proxyProvider
in class ClientTransportConfig<HttpClientConfig>
protected AddressResolverGroup<?> resolverInternal()
resolverInternal
in class ClientTransportConfig<HttpClientConfig>