Interface ServerConfiguration
-
- All Superinterfaces:
SocketConfiguration
public interface ServerConfiguration extends SocketConfiguration
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classServerConfiguration.BuilderAServerConfigurationbuilder.
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_SOCKET_NAMEThe default server socket configuration name.-
Fields inherited from interface io.helidon.webserver.SocketConfiguration
DEFAULT, DEFAULT_BACKLOG_SIZE
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description intbacklog()Returns a maximum length of the queue of incoming connections on the default server socket.InetAddressbindAddress()Returns local address where the server listens on with the default server socket.static ServerConfiguration.Builderbuilder()Creates new instance of aserver configuration builder.static ServerConfiguration.Builderbuilder(Config config)Creates new instance of aserver configuration builderwith defaults from external configuration source.Contextcontext()The top levelContextto be used by this webserver.static ServerConfigurationcreate(Config config)Creates new instance with defaults from external configuration source.ExperimentalConfigurationexperimental()Returns anExperimentalConfiguration.default booleanisHttp2Enabled()Checks if HTTP/2 is enabled in config.intport()Returns a server port to listen on with the default server socket.intreceiveBufferSize()Returns proposed value of the TCP receive window that is advertised to the remote peer on the default server socket.default SocketConfigurationsocket(String name)A socket configuration of an additional named server socket.Map<String,SocketConfiguration>sockets()A map of all the configured server sockets; that is the default server socket which is identified by the keyDEFAULT_SOCKET_NAMEand also all the additional named server socket configurations.SSLContextssl()Returns aSSLContextto use with the default server socket.inttimeoutMillis()Returns a default server socket timeout in milliseconds or0for an infinite timeout.Tracertracer()Returns an opentracing.io tracer.intworkersCount()Returns the count of threads in the pool used to process HTTP requests.-
Methods inherited from interface io.helidon.webserver.SocketConfiguration
cipherSuite, clientAuth, enabledSslProtocols, initialBufferSize, maxChunkSize, maxHeaderSize, maxInitialLineLength, validateHeaders
-
-
-
-
Field Detail
-
DEFAULT_SOCKET_NAME
static final String DEFAULT_SOCKET_NAME
The default server socket configuration name. All the default server socket configuration (e.g.,port()orbacklog()) is accessible throughsocket(String)orsockets()with thisdefault socket name.- See Also:
- Constant Field Values
-
-
Method Detail
-
workersCount
int workersCount()
Returns the count of threads in the pool used to process HTTP requests.Default value is
Runtime.availableProcessors().- Returns:
- a workers count
-
port
int port()
Returns a server port to listen on with the default server socket. If port is0then any available ephemeral port will be used.Additional named server socket configuration is accessible through the
socket(String)andsockets()methods.- Specified by:
portin interfaceSocketConfiguration- Returns:
- the server port of the default server socket
-
bindAddress
InetAddress bindAddress()
Returns local address where the server listens on with the default server socket. Ifnullthen listens an all local addresses.Additional named server socket configuration is accessible through the
socket(String)andsockets()methods.- Specified by:
bindAddressin interfaceSocketConfiguration- Returns:
- an address to bind with the default server socket;
nullfor all local addresses
-
backlog
int backlog()
Returns a maximum length of the queue of incoming connections on the default server socket.Default value is
SocketConfiguration.DEFAULT_BACKLOG_SIZE.Additional named server socket configuration is accessible through the
socket(String)andsockets()methods.- Specified by:
backlogin interfaceSocketConfiguration- Returns:
- a maximum length of the queue of incoming connections
-
timeoutMillis
int timeoutMillis()
Returns a default server socket timeout in milliseconds or0for an infinite timeout.Additional named server socket configuration is accessible through the
socket(String)andsockets()methods.- Specified by:
timeoutMillisin interfaceSocketConfiguration- Returns:
- a default server socket timeout in milliseconds or
0
-
receiveBufferSize
int receiveBufferSize()
Returns proposed value of the TCP receive window that is advertised to the remote peer on the default server socket.If
0then use implementation default.Additional named server socket configuration is accessible through the
socket(String)andsockets()methods.- Specified by:
receiveBufferSizein interfaceSocketConfiguration- Returns:
- a buffer size in bytes of the default server socket or
0
-
ssl
SSLContext ssl()
Returns aSSLContextto use with the default server socket. If notnullthen the server enforces an SSL communication.Additional named server socket configuration is accessible through the
socket(String)andsockets()methods.- Specified by:
sslin interfaceSocketConfiguration- Returns:
- a SSL context to use
-
socket
default SocketConfiguration socket(String name)
A socket configuration of an additional named server socket.An additional named server socket may have a dedicated
Routingconfigured throughWebServer.Builder.addNamedRouting(String, Routing).- Parameters:
name- the name of the additional server socket- Returns:
- an additional named server socket configuration or
nullif there is no such named server socket
-
sockets
Map<String,SocketConfiguration> sockets()
A map of all the configured server sockets; that is the default server socket which is identified by the keyDEFAULT_SOCKET_NAMEand also all the additional named server socket configurations.An additional named server socket may have a dedicated
Routingconfigured throughWebServer.Builder.addNamedRouting(String, Routing).- Returns:
- a map of all the configured server sockets
-
tracer
Tracer tracer()
Returns an opentracing.io tracer. Default isGlobalTracer.- Returns:
- a tracer to use - never
null(defaulting toGlobalTracer
-
context
Context context()
The top levelContextto be used by this webserver.- Returns:
- a context instance with registered application scoped instances
-
experimental
ExperimentalConfiguration experimental()
Returns anExperimentalConfiguration.- Returns:
- Experimental configuration.
-
isHttp2Enabled
default boolean isHttp2Enabled()
Checks if HTTP/2 is enabled in config.- Returns:
- Outcome of test.
-
create
static ServerConfiguration create(Config config)
Creates new instance with defaults from external configuration source.- Parameters:
config- the externalized configuration- Returns:
- a new instance
-
builder
static ServerConfiguration.Builder builder()
Creates new instance of aserver configuration builder.- Returns:
- a new builder instance
-
builder
static ServerConfiguration.Builder builder(Config config)
Creates new instance of aserver configuration builderwith defaults from external configuration source.- Parameters:
config- the externalized configuration- Returns:
- a new builder instance
-
-