Module io.helidon.webserver
Package io.helidon.webserver
Class ConnectionConfig.BuilderBase<BUILDER extends ConnectionConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ConnectionConfig>
java.lang.Object
io.helidon.webserver.ConnectionConfig.BuilderBase<BUILDER,PROTOTYPE>
- 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> Prototype.ConfiguredBuilder<BUILDER,
PROTOTYPE>
- Direct Known Subclasses:
ConnectionConfig.Builder
- Enclosing interface:
ConnectionConfig
public abstract static class ConnectionConfig.BuilderBase<BUILDER extends ConnectionConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ConnectionConfig>
extends Object
implements Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
ConnectionConfig
.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Generated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddSocketOptions
(Map<SocketOption<?>, ?> socketOptions) This method keeps existing values, then puts all new values into the map.config()
If this instance was configured, this would be the config instance used.Update builder from configuration (node of this type).Connect timeout.connectTimeout
(Duration connectTimeout) Connect timeout.from
(ConnectionConfig prototype) Update this builder from an existing prototype instance.from
(ConnectionConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.boolean
Configure socket keep alive.keepAlive
(boolean keepAlive) Configure socket keep alive.protected void
Handles providers and decorators.putSocketOption
(SocketOption<?> key, Object socketOption) This method adds a new value to the map, or replaces it if the key already exists.Read timeout.readTimeout
(Duration readTimeout) Read timeout.int
Socket receive buffer size.receiveBufferSize
(int receiveBufferSize) Socket receive buffer size.boolean
Socket reuse address.reuseAddress
(boolean reuseAddress) Socket reuse address.int
Socket send buffer size.sendBufferSize
(int sendBufferSize) Socket send buffer size.Map
<SocketOption<?>, Object> Set an arbitrary socket option.socketOptions
(Map<SocketOption<?>, ?> socketOptions) This method replaces all values with the new ones.boolean
Disable Nagle's algorithm by setting TCP_NODELAY to true.tcpNoDelay
(boolean tcpNoDelay) Disable Nagle's algorithm by setting TCP_NODELAY to true.toString()
protected void
Validates required properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
Methods inherited from interface io.helidon.builder.api.Prototype.ConfiguredBuilder
discoverService, discoverServices
-
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
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
config
in interfacePrototype.ConfiguredBuilder<BUILDER extends ConnectionConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends ConnectionConfig> - Parameters:
config
- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
readTimeout
Read timeout. Default is "PT30S"- Parameters:
readTimeout
- read timeout- Returns:
- updated builder instance
- See Also:
-
connectTimeout
Connect timeout. Default is "PT10S".- Parameters:
connectTimeout
- connect timeout- Returns:
- updated builder instance
- See Also:
-
sendBufferSize
Socket send buffer size. Default is 32768.- Parameters:
sendBufferSize
- buffer size, in bytes- Returns:
- updated builder instance
- See Also:
-
receiveBufferSize
Socket receive buffer size. Default is 32768.- Parameters:
receiveBufferSize
- buffer size, in bytes- Returns:
- updated builder instance
- See Also:
-
keepAlive
Configure socket keep alive. Default istrue
.- Parameters:
keepAlive
- keep alive- Returns:
- updated builder instance
- See Also:
-
reuseAddress
Socket reuse address. Default istrue
.- Parameters:
reuseAddress
- whether to reuse address- Returns:
- updated builder instance
- See Also:
-
tcpNoDelay
Disable Nagle's algorithm by setting TCP_NODELAY to true. This can result in better performance on Mac or newer linux kernels for some payload types. Default isfalse
.- Parameters:
tcpNoDelay
- whether to use TCP_NODELAY, defaults tofalse
- Returns:
- updated builder instance
- See Also:
-
socketOptions
This method replaces all values with the new ones.- Parameters:
socketOptions
- socket options- Returns:
- updated builder instance
- See Also:
-
addSocketOptions
This method keeps existing values, then puts all new values into the map.- Parameters:
socketOptions
- socket options- Returns:
- updated builder instance
- See Also:
-
putSocketOption
This method adds a new value to the map, or replaces it if the key already exists.- Parameters:
key
- key to add or replacesocketOption
- new value for the key- Returns:
- updated builder instance
- See Also:
-
readTimeout
Read timeout. Default is "PT30S"- Returns:
- the read timeout
-
connectTimeout
Connect timeout. Default is "PT10S".- Returns:
- the connect timeout
-
sendBufferSize
public int sendBufferSize()Socket send buffer size. Default is 32768.- Returns:
- the send buffer size
- See Also:
-
receiveBufferSize
public int receiveBufferSize()Socket receive buffer size. Default is 32768.- Returns:
- the receive buffer size
- See Also:
-
keepAlive
public boolean keepAlive()Configure socket keep alive. Default istrue
.- Returns:
- the keep alive
- See Also:
-
reuseAddress
public boolean reuseAddress()Socket reuse address. Default istrue
.- Returns:
- the reuse address
- See Also:
-
tcpNoDelay
public boolean tcpNoDelay()Disable Nagle's algorithm by setting TCP_NODELAY to true. This can result in better performance on Mac or newer linux kernels for some payload types. Default isfalse
.- Returns:
- the tcp no delay
- See Also:
-
socketOptions
Set an arbitrary socket option. A mapping of a socket option to its value. Socket options may be system specific. Most commonly supported socket options are available as methods directly.- Returns:
- the socket options
- See Also:
-
config
If this instance was configured, this would be the config instance used.- Returns:
- config node used to configure this builder, or empty if not configured
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-