Builder<ServerConfiguration>public static final class ServerConfiguration.Builder extends java.lang.Object implements Builder<ServerConfiguration>
ServerConfiguration builder.| Modifier and Type | Method | Description |
|---|---|---|
ServerConfiguration.Builder |
addSocket(java.lang.String name,
int port,
java.net.InetAddress bindAddress) |
Adds an additional named server socket configuration.
|
ServerConfiguration.Builder |
addSocket(java.lang.String name,
Builder<SocketConfiguration> socketConfigurationBuilder) |
Adds an additional named server socket configuration builder.
|
ServerConfiguration.Builder |
addSocket(java.lang.String name,
SocketConfiguration socketConfiguration) |
Adds an additional named server socket configuration.
|
ServerConfiguration.Builder |
backlog(int size) |
Sets a maximum length of the queue of incoming connections.
|
ServerConfiguration.Builder |
bindAddress(java.net.InetAddress bindAddress) |
Sets a local address for server to bind.
|
ServerConfiguration |
build() |
Builds a new configuration instance.
|
ServerConfiguration.Builder |
config(Config config) |
Sets configuration values included in provided
Config parameter. |
ServerConfiguration.Builder |
experimental(ExperimentalConfiguration experimental) |
|
ServerConfiguration.Builder |
port(int port) |
Sets server port.
|
ServerConfiguration.Builder |
receiveBufferSize(int bytes) |
Propose value of the TCP receive window that is advertised to the remote peer.
|
ServerConfiguration.Builder |
ssl(Builder<? extends javax.net.ssl.SSLContext> sslContextBuilder) |
Sets
SSLContext to to use with the server. |
ServerConfiguration.Builder |
ssl(javax.net.ssl.SSLContext sslContext) |
Sets
SSLContext to to use with the server. |
ServerConfiguration.Builder |
timeout(int milliseconds) |
Sets a socket timeout in milliseconds or
0 for infinite timeout. |
ServerConfiguration.Builder |
tracer(Builder<? extends io.opentracing.Tracer> tracerBuilder) |
Sets an opentracing.io tracer.
|
ServerConfiguration.Builder |
tracer(io.opentracing.Tracer tracer) |
Sets an opentracing.io tracer.
|
ServerConfiguration.Builder |
workersCount(int workers) |
Sets a count of threads in pool used to tryProcess HTTP requests.
|
public ServerConfiguration.Builder ssl(javax.net.ssl.SSLContext sslContext)
SSLContext to to use with the server. If not null then server enforce SSL communication.sslContext - ssl contextpublic ServerConfiguration.Builder ssl(Builder<? extends javax.net.ssl.SSLContext> sslContextBuilder)
SSLContext to to use with the server. If not null then server enforce SSL communication.sslContextBuilder - ssl context builder; will be built as a first step of this method executionpublic ServerConfiguration.Builder port(int port)
0 or less then any available ephemeral port will be used.
Configuration key: port
port - the server portpublic ServerConfiguration.Builder bindAddress(java.net.InetAddress bindAddress)
null then listens an all local addresses.
Configuration key: bind-address
bindAddress - the address to bind the server or null for all local addressespublic ServerConfiguration.Builder backlog(int size)
1024.
Configuration key: backlog
size - the maximum length of the queue of incoming connectionspublic ServerConfiguration.Builder timeout(int milliseconds)
0 for infinite timeout.
Configuration key: timeout
milliseconds - a socket timeout in milliseconds or 0public ServerConfiguration.Builder receiveBufferSize(int bytes)
0 then implementation default is used.
Configuration key: receive-buffer
bytes - a buffer size in bytes or 0public ServerConfiguration.Builder addSocket(java.lang.String name, int port, java.net.InetAddress bindAddress)
An additional named server socket may have a dedicated Routing configured
through WebServer.Builder.addNamedRouting(String, Routing).
name - the name of the additional server socket configurationport - the port to bind; if 0 or less, any available ephemeral port will be usedbindAddress - the address to bind; if null, all local addresses will be boundpublic ServerConfiguration.Builder addSocket(java.lang.String name, SocketConfiguration socketConfiguration)
An additional named server socket may have a dedicated Routing configured
through WebServer.Builder.addNamedRouting(String, Routing).
name - the name of the additional server socket configurationsocketConfiguration - the additional named server socket configurationpublic ServerConfiguration.Builder addSocket(java.lang.String name, Builder<SocketConfiguration> socketConfigurationBuilder)
An additional named server socket may have a dedicated Routing configured
through WebServer.Builder.addNamedRouting(String, Routing).
name - the name of the additional server socket configurationsocketConfigurationBuilder - the additional named server socket configuration builder; will be built as
a first step of this method executionpublic ServerConfiguration.Builder workersCount(int workers)
CPU_COUNT * 2.
Configuration key: workers
workers - a workers countpublic ServerConfiguration.Builder tracer(io.opentracing.Tracer tracer)
GlobalTracer.)tracer - a tracer to setpublic ServerConfiguration.Builder tracer(Builder<? extends io.opentracing.Tracer> tracerBuilder)
GlobalTracer.)tracerBuilder - a tracer builder to set; will be built as a first step of this method executionpublic ServerConfiguration.Builder experimental(ExperimentalConfiguration experimental)
public ServerConfiguration.Builder config(Config config)
Config parameter.
It can be used for configuration externalisation.
All parameters sets before this method call can be seen as defaults and all parameters sets after can be seen as forced.
config - the configuration to usepublic ServerConfiguration build()
build in interface Builder<ServerConfiguration>Copyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.