Class WebClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebClientConfig>
- Type Parameters:
BUILDER- type of the builder extending this abstract builderPROTOTYPE- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER, PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER, PROTOTYPE>
- Direct Known Subclasses:
WebClientConfig.Builder
- Enclosing interface:
WebClientConfig
WebClientConfig.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations.Nested classes/interfaces inherited from class HttpClientConfig.BuilderBase
HttpClientConfig.BuilderBase.HttpClientConfigImplModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations.Nested classes/interfaces inherited from class HttpConfigBase.BuilderBase
HttpConfigBase.BuilderBase.HttpConfigBaseImplModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddHeader(HeaderName name, int value) Add a default header value.addHeader(HeaderName name, long value) Add a default header value.addHeader(HeaderName name, String value) Add a default header value.Add default header value.Add default header value.Add default header value.addProtocolConfig(ProtocolConfig protocolConfig) Configuration of client protocols.addProtocolConfigs(List<? extends ProtocolConfig> protocolConfigs) Configuration of client protocols.addProtocolPreference(String protocolPreference) List of HTTP protocol IDs by order of preference.addProtocolPreference(List<String> protocolPreference) List of HTTP protocol IDs by order of preference.addRedirectSensitiveHeader(String headerName) Add a header name to strip on cross-origin redirects.Base URI of the client.Base URI of the client.Clear all protocolConfigs.Clear all protocolPreference.Update builder from configuration (node of this type).from(WebClientConfig prototype) Update this builder from an existing prototype instance.from(WebClientConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.protected voidHandles providers and decorators.Configuration of client protocols.protocolConfigs(List<? extends ProtocolConfig> protocolConfigs) Configuration of client protocols.booleanService discovery flag forprotocolConfigs().protocolConfigsDiscoverServices(boolean protocolConfigsDiscoverServices) Service discovery flag forprotocolConfigs().List of HTTP protocol IDs by order of preference.protocolPreference(List<String> protocolPreference) List of HTTP protocol IDs by order of preference.toString()protected voidValidates required properties.Methods inherited from class HttpClientConfig.BuilderBase
addDefaultHeadersMap, addHeader, addHeaders, addMediaSupport, addMediaSupports, addRedirectSensitiveHeader, addRedirectSensitiveHeaders, addService, addServices, altSvc, altSvc, altSvc, altSvc, baseAddress, baseAddress, baseFragment, baseFragment, baseQuery, baseQuery, baseUri, baseUri, clearAltSvc, clearBaseAddress, clearBaseFragment, clearBaseQuery, clearBaseUri, clearCookieManager, clearHeaders, clearMediaSupports, clearRedirectSensitiveHeaders, clearServices, clearSni, connectionCacheSize, connectionCacheSize, connectionListener, connectionListener, contentEncoding, contentEncoding, contentEncoding, contentEncoding, contentEncoding, cookieManager, cookieManager, cookieManager, cookieManager, defaultHeadersMap, defaultHeadersMap, dnsAddressLookup, dnsAddressLookup, dnsResolver, dnsResolver, executor, executor, filterRedirectHeaders, filterRedirectHeaders, followCrossOriginEntityRedirects, followCrossOriginEntityRedirects, from, from, headers, headers, maxInMemoryEntity, maxInMemoryEntity, mediaContext, mediaContext, mediaContext, mediaContext, mediaContext, mediaSupports, mediaSupports, mediaTypeParserMode, mediaTypeParserMode, readContinueTimeout, readContinueTimeout, redirectSensitiveHeaders, redirectSensitiveHeaders, relativeUris, relativeUris, sendExpectContinue, sendExpectContinue, serviceRegistry, serviceRegistry, services, services, servicesDiscoverServices, servicesDiscoverServices, shareConnectionCache, shareConnectionCache, sni, sni, sni, sni, socketOptions, socketOptions, socketOptions, socketOptions, writeBufferSize, writeBufferSizeModifier and TypeMethodDescriptionaddDefaultHeadersMap(Map<String, String> defaultHeadersMap) Default headers to be used in every request from configuration.Default headers to be used in every request.addHeaders(Set<? extends Header> headers) Default headers to be used in every request.addMediaSupport(MediaSupport mediaSupport) Media supports (manually added).addMediaSupports(List<? extends MediaSupport> mediaSupports) Media supports (manually added).addRedirectSensitiveHeader(HeaderName redirectSensitiveHeader) Request header names to strip on cross-origin redirects.addRedirectSensitiveHeaders(Set<? extends HeaderName> redirectSensitiveHeaders) Request header names to strip on cross-origin redirects.addService(WebClientService service) WebClient services.addServices(List<? extends WebClientService> services) WebClient services.altSvc()Client policy for accepting and using HTTPAlt-Svcresponse advertisements.altSvc(ClientAltSvcConfig altSvc) Client policy for accepting and using HTTPAlt-Svcresponse advertisements.altSvc(Consumer<ClientAltSvcConfig.Builder> consumer) Client policy for accepting and using HTTPAlt-Svcresponse advertisements.altSvc(Supplier<? extends ClientAltSvcConfig> supplier) Client policy for accepting and using HTTPAlt-Svcresponse advertisements.Base address used by the client in all requests.baseAddress(SocketAddress baseAddress) Base address used by the client in all requests.Base fragment used by the client in all requests (unless overwritten on per-request basis).baseFragment(UriFragment baseFragment) Base fragment used by the client in all requests (unless overwritten on per-request basis).Base query used by the client in all requests.Base query used by the client in all requests.baseUri()Base uri used by the client in all requests.Base uri used by the client in all requests.Clear existing value of altSvc.Clear existing value of baseAddress.Clear existing value of baseFragment.Clear existing value of baseQuery.Clear existing value of baseUri.Clear existing value of cookieManager.Clear all headers.Clear all mediaSupports.Clear all redirectSensitiveHeaders.Clear all services.clearSni()Clear existing value of sni.intMaximum number of reusable physical connections each HTTP protocol retains for a single connection target.connectionCacheSize(int connectionCacheSize) Maximum number of reusable physical connections each HTTP protocol retains for a single connection target.Socket lifecycle callbacks.connectionListener(ConnectionListener connectionListener) Socket lifecycle callbacks.Configure the listener specificContentEncodingContext.contentEncoding(ContentEncodingContext contentEncoding) Configure the listener specificContentEncodingContext.contentEncoding(ContentEncodingContextConfig contentEncoding) Configure the listener specificContentEncodingContext.Configure the listener specificContentEncodingContext.contentEncoding(Supplier<? extends ContentEncodingContext> supplier) Configure the listener specificContentEncodingContext.WebClient cookie manager.cookieManager(WebClientCookieManager cookieManager) WebClient cookie manager.cookieManager(WebClientCookieManagerConfig cookieManager) WebClient cookie manager.WebClient cookie manager.Default headers to be used in every request from configuration.defaultHeadersMap(Map<String, String> defaultHeadersMap) Default headers to be used in every request from configuration.DNS address lookup preferences to be used by this client.dnsAddressLookup(DnsAddressLookup dnsAddressLookup) DNS address lookup preferences to be used by this client.DNS resolver to be used by this client.dnsResolver(DnsResolver dnsResolver) DNS resolver to be used by this client.executor()Client executor service.executor(ExecutorService executor) Client executor service.booleanWhether headers sensitive to cross-origin redirects should be filtered before the redirected request is sent.filterRedirectHeaders(boolean filterRedirectHeaders) Whether headers sensitive to cross-origin redirects should be filtered before the redirected request is sent.booleanWhether redirects that preserve request method and entity may be followed across origins.followCrossOriginEntityRedirects(boolean followCrossOriginEntityRedirects) Whether redirects that preserve request method and entity may be followed across origins.from(HttpClientConfig prototype) Update this builder from an existing prototype instance.from(HttpClientConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.headers()Default headers to be used in every request.Default headers to be used in every request.intIf the entity is expected to be smaller that this number of bytes, it would be buffered in memory to optimize performance.maxInMemoryEntity(int maxInMemoryEntity) If the entity is expected to be smaller that this number of bytes, it would be buffered in memory to optimize performance.Configure the listener specificMediaContext.mediaContext(MediaContext mediaContext) Configure the listener specificMediaContext.mediaContext(MediaContextConfig mediaContext) Configure the listener specificMediaContext.mediaContext(Consumer<MediaContextConfig.Builder> consumer) Configure the listener specificMediaContext.mediaContext(Supplier<? extends MediaContext> supplier) Configure the listener specificMediaContext.Media supports (manually added).mediaSupports(List<? extends MediaSupport> mediaSupports) Media supports (manually added).Configure media type parsing mode for HTTPContent-Typeheader.mediaTypeParserMode(ParserMode mediaTypeParserMode) Configure media type parsing mode for HTTPContent-Typeheader.Socket 100-Continue read timeout.readContinueTimeout(Duration readContinueTimeout) Socket 100-Continue read timeout.Request header names to strip on cross-origin redirects.redirectSensitiveHeaders(Set<? extends HeaderName> redirectSensitiveHeaders) Request header names to strip on cross-origin redirects.booleanCan be set totrueto force the use of relative URIs in all requests, regardless of the presence or absence of proxies or no-proxy lists.relativeUris(boolean relativeUris) Can be set totrueto force the use of relative URIs in all requests, regardless of the presence or absence of proxies or no-proxy lists.booleanWhether Expect-100-Continue header is sent to verify server availability before sending an entity.sendExpectContinue(boolean sendExpectContinue) Whether Expect-100-Continue header is sent to verify server availability before sending an entity.Service registry used to discover providers and services.serviceRegistry(ServiceRegistry serviceRegistry) Service registry used to discover providers and services.services()WebClient services.services(List<? extends WebClientService> services) WebClient services.booleanService discovery flag forHttpClientConfig.BuilderBase.services().servicesDiscoverServices(boolean servicesDiscoverServices) Service discovery flag forHttpClientConfig.BuilderBase.services().booleanWhether to use protocol-specific JVM-wide connection caches shared by compatible WebClient instances.shareConnectionCache(boolean shareConnectionCache) Whether to use protocol-specific JVM-wide connection caches shared by compatible WebClient instances.sni()Client-side TLS SNI configuration.Client-side TLS SNI configuration.sni(Consumer<SniConfig.Builder> consumer) Client-side TLS SNI configuration.Client-side TLS SNI configuration.Socket options for connections opened by this client.socketOptions(SocketOptions socketOptions) Socket options for connections opened by this client.socketOptions(Consumer<SocketOptions.Builder> consumer) Socket options for connections opened by this client.socketOptions(Supplier<? extends SocketOptions> supplier) Socket options for connections opened by this client.intBuffer size used when writing data to the underlying socket on a client TCP connection.writeBufferSize(int writeBufferSize) Buffer size used when writing data to the underlying socket on a client TCP connection.Methods inherited from class HttpConfigBase.BuilderBase
addProperties, clearConnectTimeout, clearReadTimeout, config, connectTimeout, connectTimeout, followRedirects, followRedirects, from, from, keepAlive, keepAlive, maxRedirects, maxRedirects, properties, properties, proxy, proxy, proxy, proxy, putProperty, readTimeout, readTimeout, tls, tls, tls, tls, tlsModifier and TypeMethodDescriptionaddProperties(Map<String, String> properties) Properties configured for this client.Clear existing value of connectTimeout.Clear existing value of readTimeout.config()Configuration used to configure this instance.Connect timeout.connectTimeout(Duration connectTimeout) Connect timeout.booleanWhether to follow redirects.followRedirects(boolean followRedirects) Whether to follow redirects.from(HttpConfigBase prototype) Update this builder from an existing prototype instance.from(HttpConfigBase.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.booleanDetermines if connection keep alive is enabled (NOT socket keep alive, but HTTP connection keep alive, to re-use the same connection for multiple requests).keepAlive(boolean keepAlive) Determines if connection keep alive is enabled (NOT socket keep alive, but HTTP connection keep alive, to re-use the same connection for multiple requests).intMax number of followed redirects.maxRedirects(int maxRedirects) Max number of followed redirects.Properties configured for this client.properties(Map<String, String> properties) Properties configured for this client.proxy()Proxy configuration to be used for requests.Proxy configuration to be used for requests.proxy(Consumer<Proxy.Builder> consumer) Proxy configuration to be used for requests.Proxy configuration to be used for requests.putProperty(String key, String property) Properties configured for this client.Read timeout.readTimeout(Duration readTimeout) Read timeout.tls()TLS configuration for any TLS request from this client.TLS configuration for any TLS request from this client.TLS configuration for any TLS request from this client.tls(Consumer<TlsConfig.Builder> consumer) TLS configuration for any TLS request from this client.TLS configuration for any TLS request from this client.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
baseUri
Base URI of the client.- Overrides:
baseUriin classHttpClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebClientConfig>- Parameters:
baseUri- base URI to use, query is extracted to base query (if any)- Returns:
- updated builder instance
-
baseUri
Base URI of the client.- Overrides:
baseUriin classHttpClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebClientConfig>- Parameters:
baseUri- base URI to use, query is extracted to base query (if any)- Returns:
- updated builder instance
-
addHeader
Add a default header value.- Overrides:
addHeaderin classHttpClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebClientConfig>- Parameters:
name- name of the headervalue- value of the header- Returns:
- updated builder instance
-
addHeader
Add a default header value.- Overrides:
addHeaderin classHttpClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebClientConfig>- Parameters:
name- name of the headervalue- value of the header- Returns:
- updated builder instance
-
addHeader
Add a default header value.- Overrides:
addHeaderin classHttpClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebClientConfig>- Parameters:
name- name of the headervalue- value of the header- Returns:
- updated builder instance
-
addHeader
Add default header value. This method is not optimal and should only be used when the header name is really obtained from a string, in other cases, use an alternative withHeaderNameorHeader.- Overrides:
addHeaderin classHttpClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebClientConfig>- Parameters:
name- name of the headervalue- value of the header- Returns:
- updated builder instance
-
addHeader
Add default header value. This method is not optimal and should only be used when the header name is really obtained from a string, in other cases, use an alternative withHeaderNameorHeader.- Overrides:
addHeaderin classHttpClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebClientConfig>- Parameters:
name- name of the headervalue- value of the header- Returns:
- updated builder instance
-
addHeader
Add default header value. This method is not optimal and should only be used when the header name is really obtained from a string, in other cases, use an alternative withHeaderNameorHeader.- Overrides:
addHeaderin classHttpClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebClientConfig>- Parameters:
name- name of the headervalue- value of the header- Returns:
- updated builder instance
-
addRedirectSensitiveHeader
Add a header name to strip on cross-origin redirects.- Overrides:
addRedirectSensitiveHeaderin classHttpClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebClientConfig>- Parameters:
headerName- header name to add- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends WebClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebClientConfig>- Overrides:
configin classHttpClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebClientConfig>- Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
clearProtocolConfigs
Clear all protocolConfigs.- Returns:
- updated builder instance
- See Also:
-
protocolConfigs
Configuration of client protocols.- Parameters:
protocolConfigs- client protocol configurations- Returns:
- updated builder instance
- See Also:
-
addProtocolConfigs
Configuration of client protocols.- Parameters:
protocolConfigs- client protocol configurations- Returns:
- updated builder instance
- See Also:
-
addProtocolConfig
Configuration of client protocols.- Parameters:
protocolConfig- add single client protocol configurations- Returns:
- updated builder instance
- See Also:
-
clearProtocolPreference
Clear all protocolPreference.- Returns:
- updated builder instance
- See Also:
-
protocolPreference
List of HTTP protocol IDs by order of preference. If left empty, all discovered providers will be used, ordered by weight.For example if both HTTP/2 and HTTP/1.1 providers are available (considering HTTP/2 has higher weights), for ALPN we will send h2 and http/1.1 and decide based on response. If TLS is not used, we would attempt an upgrade (or use prior knowledge if configured in
protocolConfigs()).- Parameters:
protocolPreference- list of HTTP protocol IDs in order of preference- Returns:
- updated builder instance
- See Also:
-
addProtocolPreference
List of HTTP protocol IDs by order of preference. If left empty, all discovered providers will be used, ordered by weight.For example if both HTTP/2 and HTTP/1.1 providers are available (considering HTTP/2 has higher weights), for ALPN we will send h2 and http/1.1 and decide based on response. If TLS is not used, we would attempt an upgrade (or use prior knowledge if configured in
protocolConfigs()).- Parameters:
protocolPreference- list of HTTP protocol IDs in order of preference- Returns:
- updated builder instance
- See Also:
-
addProtocolPreference
List of HTTP protocol IDs by order of preference. If left empty, all discovered providers will be used, ordered by weight.For example if both HTTP/2 and HTTP/1.1 providers are available (considering HTTP/2 has higher weights), for ALPN we will send h2 and http/1.1 and decide based on response. If TLS is not used, we would attempt an upgrade (or use prior knowledge if configured in
protocolConfigs()).- Parameters:
protocolPreference- add single list of HTTP protocol IDs in order of preference- Returns:
- updated builder instance
- See Also:
-
protocolConfigsDiscoverServices
Service discovery flag forprotocolConfigs(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Parameters:
protocolConfigsDiscoverServices- whether to enable automatic service discovery- Returns:
- updated builder instance
- See Also:
-
protocolConfigs
Configuration of client protocols.- Returns:
- client protocol configurations
-
protocolPreference
List of HTTP protocol IDs by order of preference. If left empty, all discovered providers will be used, ordered by weight.For example if both HTTP/2 and HTTP/1.1 providers are available (considering HTTP/2 has higher weights), for ALPN we will send h2 and http/1.1 and decide based on response. If TLS is not used, we would attempt an upgrade (or use prior knowledge if configured in
protocolConfigs()).- Returns:
- list of HTTP protocol IDs in order of preference
-
protocolConfigsDiscoverServices
public boolean protocolConfigsDiscoverServices()Service discovery flag forprotocolConfigs(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Returns:
- whether to enable automatic service discovery
-
toString
- Overrides:
toStringin classHttpClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebClientConfig>
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators.- Overrides:
preBuildPrototypein classHttpClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebClientConfig>
-
validatePrototype
protected void validatePrototype()Validates required properties.- Overrides:
validatePrototypein classHttpClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebClientConfig>
-