Class WebServerConfig.Builder
java.lang.Object
io.helidon.webserver.ListenerConfig.BuilderBase<WebServerConfig.Builder, WebServerConfig>
io.helidon.webserver.WebServerConfig.BuilderBase<WebServerConfig.Builder, WebServerConfig>
io.helidon.webserver.WebServerConfig.Builder
- All Implemented Interfaces:
Prototype.Builder<WebServerConfig.Builder, WebServerConfig>, Builder<WebServerConfig.Builder, WebServer>, ConfigBuilderSupport.ConfiguredBuilder<WebServerConfig.Builder, WebServerConfig>, Supplier<WebServer>
- Enclosing interface:
WebServerConfig
public static class WebServerConfig.Builder
extends WebServerConfig.BuilderBase<WebServerConfig.Builder, WebServerConfig>
implements Builder<WebServerConfig.Builder, WebServer>
Fluent API builder for
WebServer.-
Nested Class Summary
Nested classes/interfaces inherited from class WebServerConfig.BuilderBase
WebServerConfig.BuilderBase.WebServerConfigImplModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations.Nested classes/interfaces inherited from class ListenerConfig.BuilderBase
ListenerConfig.BuilderBase.ListenerConfigImplModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Create an instance from this builder.Create an instance of the prototype.Methods inherited from class WebServerConfig.BuilderBase
addFeature, addFeatures, addSockets, clearFeatures, clearServerContext, config, features, features, featuresDiscoverServices, featuresDiscoverServices, from, from, preBuildPrototype, putSocket, putSocket, routing, routing, serverContext, serverContext, serverContext, serverContext, serviceRegistry, serviceRegistry, shutdownHook, shutdownHook, sockets, sockets, toString, validatePrototypeModifier and TypeMethodDescriptionaddFeature(ServerFeature feature) Server features allow customization of the server, listeners, or routings.addFeatures(List<? extends ServerFeature> features) Server features allow customization of the server, listeners, or routings.addSockets(Map<String, ? extends ListenerConfig> sockets) Socket configurations.Clear all features.Clear existing value of serverContext.Update builder from configuration (node of this type).features()Server features allow customization of the server, listeners, or routings.features(List<? extends ServerFeature> features) Server features allow customization of the server, listeners, or routings.booleanService discovery flag forWebServerConfig.BuilderBase.features().featuresDiscoverServices(boolean featuresDiscoverServices) Service discovery flag forWebServerConfig.BuilderBase.features().from(WebServerConfig prototype) Update this builder from an existing prototype instance.from(WebServerConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.protected voidHandles providers and decorators.putSocket(String key, ListenerConfig socket) Socket configurations.putSocket(String key, Consumer<ListenerConfig.Builder> consumer) Socket configurations.routing(String socket, HttpRouting.Builder routing) Add Http routing for an additional socket.routing(String socket, Consumer<HttpRouting.Builder> consumer) Add Http routing for an additional socket.Context for the WebServer, if none defined, a new one will be created with global context as the root.serverContext(Context serverContext) Context for the WebServer, if none defined, a new one will be created with global context as the root.serverContext(Consumer<Context.Builder> consumer) Context for the WebServer, if none defined, a new one will be created with global context as the root.serverContext(Supplier<? extends Context> supplier) Context for the WebServer, if none defined, a new one will be created with global context as the root.Service registry used to discover providers and services.serviceRegistry(ServiceRegistry serviceRegistry) Service registry used to discover providers and services.booleanWhen true the webserver registers a shutdown hook with the JVM Runtime.shutdownHook(boolean shutdownHook) When true the webserver registers a shutdown hook with the JVM Runtime.sockets()Socket configurations.sockets(Map<String, ? extends ListenerConfig> sockets) Socket configurations.toString()protected voidValidates required properties.Methods inherited from class ListenerConfig.BuilderBase
addBinding, addBinding, addBinding, addBindings, addConnectionSelector, addConnectionSelectorProvider, addConnectionSelectorProviders, addConnectionSelectors, addListenerSocketOptions, addProtocol, addProtocols, address, address, addRouting, addRoutings, addVirtualHost, addVirtualHost, addVirtualHosts, backlog, backlog, bindAddress, bindAddress, bindings, bindings, bindingsDiscoverServices, bindingsDiscoverServices, clearBindAddress, clearBindings, clearConcurrencyLimit, clearConnectionSelectorProviders, clearConnectionSelectors, clearContentEncoding, clearDirectHandlers, clearListenerContext, clearMediaContext, clearProtocols, clearProxyProtocol, clearRequestedUriDiscoveryContext, clearRouting, clearRoutings, clearTls, clearVirtualHosts, concurrencyLimit, concurrencyLimit, concurrencyLimitDiscoverServices, concurrencyLimitDiscoverServices, config, connectionOptions, connectionOptions, connectionOptions, connectionOptions, connectionSelectorProviders, connectionSelectorProviders, connectionSelectorProvidersDiscoverServices, connectionSelectorProvidersDiscoverServices, connectionSelectors, connectionSelectors, contentEncoding, contentEncoding, contentEncoding, contentEncoding, contentEncoding, directHandlers, directHandlers, directHandlers, directHandlers, enableProxyProtocol, enableProxyProtocol, errorHandling, errorHandling, errorHandling, errorHandling, from, from, host, host, idleConnectionPeriod, idleConnectionPeriod, idleConnectionTimeout, idleConnectionTimeout, ignoreInvalidNamedRouting, ignoreInvalidNamedRouting, listenerContext, listenerContext, listenerContext, listenerContext, listenerSocketOptions, listenerSocketOptions, maxConcurrentRequests, maxConcurrentRequests, maxConnections, maxConnections, maxInMemoryEntity, maxInMemoryEntity, maxPayloadSize, maxPayloadSize, maxTcpConnections, maxTcpConnections, mediaContext, mediaContext, mediaContext, mediaContext, mediaContext, name, name, port, port, protocols, protocols, protocolsDiscoverServices, protocolsDiscoverServices, proxyProtocol, proxyProtocol, proxyProtocol, proxyProtocol, putListenerSocketOption, requestedUriDiscoveryContext, requestedUriDiscoveryContext, requestedUriDiscoveryContext, requestedUriDiscoveryContext, restoreResponseHeaders, restoreResponseHeaders, routing, routing, routing, routings, routings, shutdownGracePeriod, shutdownGracePeriod, smartAsyncWrites, smartAsyncWrites, sni, sni, sni, sni, tls, tls, tls, tls, tls, useNio, useNio, virtualHosts, virtualHosts, writeBufferSize, writeBufferSize, writeQueueLength, writeQueueLengthModifier and TypeMethodDescriptionaddBinding(TransportBindingFactory binding) Transport bindings that serve this listener are configured as one object keyed by binding type; list form and nestednameortypeare invalid, and built-in TCP remains enabled unlessbindings.tcp.enabled=false.addBinding(TcpTransportConfig config) Add a TCP transport binding from configuration.addBinding(UdsTransportConfig config) Add a Unix domain socket transport binding from configuration.addBindings(List<? extends TransportBindingFactory> bindings) Transport bindings that serve this listener are configured as one object keyed by binding type; list form and nestednameortypeare invalid, and built-in TCP remains enabled unlessbindings.tcp.enabled=false.addConnectionSelector(ServerConnectionSelector connectionSelector) Explicitly defined connection selectors to be used with this socket.addConnectionSelectorProvider(ServerConnectionSelectorProvider connectionSelectorProvider) Providers of connection selectors discovered for this listener.addConnectionSelectorProviders(List<? extends ServerConnectionSelectorProvider> connectionSelectorProviders) Providers of connection selectors discovered for this listener.addConnectionSelectors(List<? extends ServerConnectionSelector> connectionSelectors) Explicitly defined connection selectors to be used with this socket.addListenerSocketOptions(Map<SocketOption<?>, ?> listenerSocketOptions) Server listener socket options.addProtocol(ProtocolConfig protocol) Configuration of protocols.addProtocols(List<? extends ProtocolConfig> protocols) Configuration of protocols.address()Address to use.address(InetAddress address) Address to use.addRouting(Builder<?, ? extends Routing> routing) List of all routings (possibly for multiple protocols).addRoutings(List<Builder<?, ? extends Routing>> routings) List of all routings (possibly for multiple protocols).addVirtualHost(VirtualHostConfig virtualHost) Listener TLS virtual hosts selected by SNI; requires listener TLS and NIO socket-channel transport (use-nio=true).addVirtualHost(Consumer<VirtualHostConfig.Builder> consumer) Listener TLS virtual hosts selected by SNI; requires listener TLS and NIO socket-channel transport (use-nio=true).addVirtualHosts(List<? extends VirtualHostConfig> virtualHosts) Listener TLS virtual hosts selected by SNI; requires listener TLS and NIO socket-channel transport (use-nio=true).intbacklog()Accept backlog.backlog(int backlog) Accept backlog.The TCP address to bind to (<host>:<port>); Unix domain addresses are rejected and must instead usebindings.uds.socket.bindAddress(SocketAddress bindAddress) The TCP address to bind to (<host>:<port>); Unix domain addresses are rejected and must instead usebindings.uds.socket.bindings()Transport bindings that serve this listener are configured as one object keyed by binding type; list form and nestednameortypeare invalid, and built-in TCP remains enabled unlessbindings.tcp.enabled=false.bindings(List<? extends TransportBindingFactory> bindings) Transport bindings that serve this listener are configured as one object keyed by binding type; list form and nestednameortypeare invalid, and built-in TCP remains enabled unlessbindings.tcp.enabled=false.booleanService discovery flag forListenerConfig.BuilderBase.bindings().bindingsDiscoverServices(boolean bindingsDiscoverServices) Service discovery flag forListenerConfig.BuilderBase.bindings().Clear existing value of bindAddress.Clear all bindings.Clear existing value of concurrencyLimit.Clear all connectionSelectorProviders.Clear all connectionSelectors.Clear existing value of contentEncoding.Clear existing value of directHandlers.Clear existing value of listenerContext.Clear existing value of mediaContext.Clear all protocols.Clear existing value of proxyProtocol.Clear existing value of requestedUriDiscoveryContext.Clear existing value of routing.Clear all routings.clearTls()Clear existing value of tls.Clear all virtualHosts.Concurrency limit to use to limit concurrent execution of incoming requests.concurrencyLimit(Limit concurrencyLimit) Concurrency limit to use to limit concurrent execution of incoming requests.booleanService discovery flag forListenerConfig.BuilderBase.concurrencyLimit().concurrencyLimitDiscoverServices(boolean concurrencyLimitDiscoverServices) Service discovery flag forListenerConfig.BuilderBase.concurrencyLimit().config()Configuration used to configure this instance.Options for connections accepted by this listener.connectionOptions(SocketOptions connectionOptions) Options for connections accepted by this listener.connectionOptions(Consumer<SocketOptions.Builder> consumer) Options for connections accepted by this listener.connectionOptions(Supplier<? extends SocketOptions> supplier) Options for connections accepted by this listener.Providers of connection selectors discovered for this listener.connectionSelectorProviders(List<? extends ServerConnectionSelectorProvider> connectionSelectorProviders) Providers of connection selectors discovered for this listener.booleanService discovery flag forListenerConfig.BuilderBase.connectionSelectorProviders().connectionSelectorProvidersDiscoverServices(boolean connectionSelectorProvidersDiscoverServices) Service discovery flag forListenerConfig.BuilderBase.connectionSelectorProviders().Explicitly defined connection selectors to be used with this socket.connectionSelectors(List<? extends ServerConnectionSelector> connectionSelectors) Explicitly defined connection selectors to be used with this socket.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.Direct handlers specific for this listener.directHandlers(DirectHandlers directHandlers) Direct handlers specific for this listener.directHandlers(Consumer<DirectHandlers.Builder> consumer) Direct handlers specific for this listener.directHandlers(Supplier<? extends DirectHandlers> supplier) Direct handlers specific for this listener.booleanDeprecated, for removal: This API element is subject to removal in a future version.enableProxyProtocol(boolean enableProxyProtocol) Deprecated, for removal: This API element is subject to removal in a future version.useListenerConfig.BuilderBase.proxyProtocol()insteadConfiguration for this listener's error handling.errorHandling(ErrorHandling errorHandling) Configuration for this listener's error handling.errorHandling(Consumer<ErrorHandling.Builder> consumer) Configuration for this listener's error handling.errorHandling(Supplier<? extends ErrorHandling> supplier) Configuration for this listener's error handling.from(ListenerConfig prototype) Update this builder from an existing prototype instance.from(ListenerConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.host()Host of the default socket.Host of the default socket.How often should we check forListenerConfig.BuilderBase.idleConnectionTimeout().idleConnectionPeriod(Duration idleConnectionPeriod) How often should we check forListenerConfig.BuilderBase.idleConnectionTimeout().How long should we wait before closing a connection that has no traffic on it.idleConnectionTimeout(Duration idleConnectionTimeout) How long should we wait before closing a connection that has no traffic on it.booleanIf set totrue, any named routing configured that does not have an associated named listener will NOT cause an exception to be thrown (default behavior is to throw an exception).ignoreInvalidNamedRouting(boolean ignoreInvalidNamedRouting) If set totrue, any named routing configured that does not have an associated named listener will NOT cause an exception to be thrown (default behavior is to throw an exception).Listener scoped context to be used as a parent for webserver request contexts (if used).listenerContext(Context listenerContext) Listener scoped context to be used as a parent for webserver request contexts (if used).listenerContext(Consumer<Context.Builder> consumer) Listener scoped context to be used as a parent for webserver request contexts (if used).listenerContext(Supplier<? extends Context> supplier) Listener scoped context to be used as a parent for webserver request contexts (if used).Map<SocketOption<?>, Object> Server listener socket options.listenerSocketOptions(Map<SocketOption<?>, ?> listenerSocketOptions) Server listener socket options.intLimits the number of requests that can be executed at the same time (the number of active virtual threads of requests).maxConcurrentRequests(int maxConcurrentRequests) Limits the number of requests that can be executed at the same time (the number of active virtual threads of requests).intLimits listener-wide connection admission shared by all connection-oriented bindings.maxConnections(int maxConnections) Limits listener-wide connection admission shared by all connection-oriented bindings.intIf the entity is expected to be smaller that this number of bytes, it would be buffered in memory to optimize performance when writing it.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 when writing it.longMaximal number of bytes an entity may have.maxPayloadSize(long maxPayloadSize) Maximal number of bytes an entity may have.intDeprecated, for removal: This API element is subject to removal in a future version.This option is deprecated, useListenerConfig.BuilderBase.maxConnectionsinsteadmaxTcpConnections(int maxTcpConnections) Deprecated, for removal: This API element is subject to removal in a future version.This option is deprecated, useListenerConfig.BuilderBase.maxConnectionsinsteadConfigure 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.name()Name of this socket.Name of this socket.intport()Port of the default socket.port(int port) Port of the default socket.Configuration of protocols.protocols(List<? extends ProtocolConfig> protocols) Configuration of protocols.booleanService discovery flag forListenerConfig.BuilderBase.protocols().protocolsDiscoverServices(boolean protocolsDiscoverServices) Service discovery flag forListenerConfig.BuilderBase.protocols().PROXY protocol configuration.proxyProtocol(ProxyProtocolConfig proxyProtocol) PROXY protocol configuration.proxyProtocol(Consumer<ProxyProtocolConfig.Builder> consumer) PROXY protocol configuration.proxyProtocol(Supplier<? extends ProxyProtocolConfig> supplier) PROXY protocol configuration.<TYPE> WebServerConfig.BuilderputListenerSocketOption(SocketOption<TYPE> key, TYPE listenerSocketOption) Server listener socket options.Requested URI discovery context.requestedUriDiscoveryContext(RequestedUriDiscoveryContext requestedUriDiscoveryContext) Requested URI discovery context.Requested URI discovery context.requestedUriDiscoveryContext(Supplier<? extends RequestedUriDiscoveryContext> supplier) Requested URI discovery context.booleanCopy and restore response headers before and after passing a request to Jersey for processing.restoreResponseHeaders(boolean restoreResponseHeaders) Copy and restore response headers before and after passing a request to Jersey for processing.routing()Http routing.routing(HttpRouting.Builder routing) Http routing.routing(Consumer<HttpRouting.Builder> builderConsumer) Customize HTTP routing of this listener.routings()List of all routings (possibly for multiple protocols).List of all routings (possibly for multiple protocols).Grace period in ISO 8601 duration format to allow running tasks to complete before listener's shutdown.shutdownGracePeriod(Duration shutdownGracePeriod) Grace period in ISO 8601 duration format to allow running tasks to complete before listener's shutdown.booleanIf enabled andListenerConfig.BuilderBase.writeQueueLength()is greater than 1, then start with async writes but possibly switch to sync writes if async queue size is always below a certain threshold.smartAsyncWrites(boolean smartAsyncWrites) If enabled andListenerConfig.BuilderBase.writeQueueLength()is greater than 1, then start with async writes but possibly switch to sync writes if async queue size is always below a certain threshold.sni()Listener-scoped server TLS SNI policy.Listener-scoped server TLS SNI policy.sni(Consumer<SniConfig.Builder> consumer) Listener-scoped server TLS SNI policy.Listener-scoped server TLS SNI policy.tls()Listener TLS configuration.Listener TLS configuration.Listener TLS configuration.tls(Consumer<TlsConfig.Builder> consumer) Listener TLS configuration.Listener TLS configuration.booleanuseNio()Whether to use an NIO socket channel instead of a socket; Unix domain socket bindings always use NIO and ignore this setting, while listener TLS virtual hosts require it to betrue.useNio(boolean useNio) Whether to use an NIO socket channel instead of a socket; Unix domain socket bindings always use NIO and ignore this setting, while listener TLS virtual hosts require it to betrue.Listener TLS virtual hosts selected by SNI; requires listener TLS and NIO socket-channel transport (use-nio=true).virtualHosts(List<? extends VirtualHostConfig> virtualHosts) Listener TLS virtual hosts selected by SNI; requires listener TLS and NIO socket-channel transport (use-nio=true).intInitial buffer size in bytes ofBufferedOutputStreamcreated internally to write data to a socket connection.writeBufferSize(int writeBufferSize) Initial buffer size in bytes ofBufferedOutputStreamcreated internally to write data to a socket connection.intNumber of buffers queued for write operations.writeQueueLength(int writeQueueLength) Number of buffers queued for write operations.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Builder
get, identity, updateModifier and TypeMethodDescriptiondefault WebServerget()default WebServerConfig.Builderidentity()Instance of this builder as the correct type.default WebServerConfig.Builderupdate(Consumer<WebServerConfig.Builder> consumer) Update the builder in a fluent API way.Methods inherited from interface Prototype.Builder
selfModifier and TypeMethodDescriptiondefault WebServerConfig.Builderself()Instance of this builder as the correct type.
-
Method Details
-
buildPrototype
Create an instance of the prototype. Calling this method may update this builder from providers and decorators, so repeated calls may have side effects.- Specified by:
buildPrototypein interfacePrototype.Builder<WebServerConfig.Builder, WebServerConfig>- Returns:
- an instance of the setup object created from this builder
-
build
Create an instance from this builder. Calling this method may update this builder from providers and decorators, so repeated calls may have side effects.- Specified by:
buildin interfaceBuilder<WebServerConfig.Builder, WebServer>- Returns:
- instance of the built type
-
ListenerConfig.BuilderBase.proxyProtocol()instead