Module io.helidon.common.socket
Package io.helidon.common.socket
Class SocketOptions.BuilderBase<BUILDER extends SocketOptions.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends SocketOptions>
java.lang.Object
io.helidon.common.socket.SocketOptions.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:
SocketOptions.Builder
- Enclosing interface:
SocketOptions
public abstract static class SocketOptions.BuilderBase<BUILDER extends SocketOptions.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends SocketOptions>
extends Object
implements Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
SocketOptions
.-
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.Clear existing value of this property.Clear existing value of this property.config()
If this instance was configured, this would be the config instance used.Update builder from configuration (node of this type).Socket connect timeout.connectTimeout
(Duration connectTimeout) Socket connect timeout.from
(SocketOptions prototype) Update this builder from an existing prototype instance.from
(SocketOptions.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.protected void
Handles providers and decorators.<TYPE> BUILDER
putSocketOption
(SocketOption<TYPE> key, TYPE socketOption) This method adds a new value to the map, or replaces it if the key already exists.Socket read timeout.readTimeout
(Duration readTimeout) Socket read timeout.boolean
Configure socket keep alive.socketKeepAlive
(boolean socketKeepAlive) Configure socket keep alive.Map
<SocketOption<?>, Object> Arbitrary socket options.socketOptions
(Map<SocketOption<?>, ?> socketOptions) This method replaces all values with the new ones.Socket receive buffer size.socketReceiveBufferSize
(int socketReceiveBufferSize) Socket receive buffer size.boolean
Socket reuse address.socketReuseAddress
(boolean socketReuseAddress) Socket reuse address.Socket send buffer size.socketSendBufferSize
(int socketSendBufferSize) Socket send buffer size.boolean
This option may improve performance on some systems.tcpNoDelay
(boolean tcpNoDelay) This option may improve performance on some systems.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 SocketOptions.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends SocketOptions> - Parameters:
config
- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
socketOptions
This method replaces all values with the new ones.- Parameters:
socketOptions
- custom socket options- Returns:
- updated builder instance
- See Also:
-
addSocketOptions
This method keeps existing values, then puts all new values into the map.- Parameters:
socketOptions
- custom 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.- Type Parameters:
TYPE
- Type to correctly map key and value- Parameters:
key
- key to add or replacesocketOption
- new value for the key- Returns:
- updated builder instance
- See Also:
-
connectTimeout
Socket connect timeout. Default is 10 seconds.- Parameters:
connectTimeout
- connect timeout duration- Returns:
- updated builder instance
- See Also:
-
readTimeout
Socket read timeout. Default is 30 seconds.- Parameters:
readTimeout
- read timeout duration- Returns:
- updated builder instance
- See Also:
-
clearSocketReceiveBufferSize
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
socketReceiveBufferSize
Socket receive buffer size.- Parameters:
socketReceiveBufferSize
- buffer size, in bytes- Returns:
- updated builder instance
- See Also:
-
clearSocketSendBufferSize
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
socketSendBufferSize
Socket send buffer size.- Parameters:
socketSendBufferSize
- buffer size, in bytes- Returns:
- updated builder instance
- See Also:
-
socketReuseAddress
Socket reuse address. Default istrue
.- Parameters:
socketReuseAddress
- whether to reuse address- Returns:
- updated builder instance
- See Also:
-
socketKeepAlive
Configure socket keep alive. Default istrue
.- Parameters:
socketKeepAlive
- keep alive- Returns:
- updated builder instance
- See Also:
-
tcpNoDelay
This option may improve performance on some systems. Default isfalse
.- Parameters:
tcpNoDelay
- whether to use TCP_NODELAY, defaults tofalse
- Returns:
- updated builder instance
- See Also:
-
socketOptions
Arbitrary socket options. Socket options that have dedicated methods in this type will be ignored if configured within the map.- Returns:
- the socket options
-
connectTimeout
Socket connect timeout. Default is 10 seconds.- Returns:
- the connect timeout
-
readTimeout
Socket read timeout. Default is 30 seconds.- Returns:
- the read timeout
-
socketReceiveBufferSize
Socket receive buffer size.- Returns:
- the socket receive buffer size
- See Also:
-
socketSendBufferSize
Socket send buffer size.- Returns:
- the socket send buffer size
- See Also:
-
socketReuseAddress
public boolean socketReuseAddress()Socket reuse address. Default istrue
.- Returns:
- the socket reuse address
- See Also:
-
socketKeepAlive
public boolean socketKeepAlive()Configure socket keep alive. Default istrue
.- Returns:
- the socket keep alive
- See Also:
-
tcpNoDelay
public boolean tcpNoDelay()This option may improve performance on some systems. Default isfalse
.- Returns:
- the tcp no delay
- 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.
-