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> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,,PROTOTYPE> ConfigBuilderSupport.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 ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
SocketOptions.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddSocketOptions(Map<SocketOption<?>, ?> socketOptions) Arbitrary socket options.Clear existing value of socketReceiveBufferSize.Clear existing value of socketSendBufferSize.config()Configuration used to configure this instance.Deprecated.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 voidHandles providers and decorators.<TYPE> BUILDERputSocketOption(SocketOption<TYPE> key, TYPE socketOption) Arbitrary socket options.Socket read timeout.readTimeout(Duration readTimeout) Socket read timeout.booleanConfigure socket keep alive.socketKeepAlive(boolean socketKeepAlive) Configure socket keep alive.Map<SocketOption<?>, Object> Arbitrary socket options.socketOptions(Map<SocketOption<?>, ?> socketOptions) Arbitrary socket options.Socket receive buffer size.socketReceiveBufferSize(int socketReceiveBufferSize) Socket receive buffer size.booleanSocket reuse address.socketReuseAddress(boolean socketReuseAddress) Socket reuse address.Socket send buffer size.socketSendBufferSize(int socketSendBufferSize) Socket send buffer size.booleanThis option may improve performance on some systems.tcpNoDelay(boolean tcpNoDelay) This option may improve performance on some systems.toString()protected voidValidates required properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
-
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
Deprecated.Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.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
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.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
Arbitrary socket options. Socket options that have dedicated methods in this type will be ignored if configured within the map. This method replaces all values with the new ones.- Parameters:
socketOptions- custom socket options- Returns:
- updated builder instance
- See Also:
-
addSocketOptions
Arbitrary socket options. Socket options that have dedicated methods in this type will be ignored if configured within the map. 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
Arbitrary socket options. Socket options that have dedicated methods in this type will be ignored if configured within the map. This method adds a new value to the map, or replaces it if the key already exists.- Type Parameters:
TYPE- The key and value has to use the same generic type.- 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 socketReceiveBufferSize.- 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 socketSendBufferSize.- 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:
- custom socket options
-
connectTimeout
Socket connect timeout. Default is 10 seconds.- Returns:
- connect timeout duration
-
readTimeout
Socket read timeout. Default is 30 seconds.- Returns:
- read timeout duration
-
socketReceiveBufferSize
Socket receive buffer size.- Returns:
- buffer size, in bytes
- See Also:
-
socketSendBufferSize
Socket send buffer size.- Returns:
- buffer size, in bytes
- See Also:
-
socketReuseAddress
public boolean socketReuseAddress()Socket reuse address. Default istrue.- Returns:
- whether to reuse address
- See Also:
-
socketKeepAlive
public boolean socketKeepAlive()Configure socket keep alive. Default istrue.- Returns:
- keep alive
- See Also:
-
tcpNoDelay
public boolean tcpNoDelay()This option may improve performance on some systems. Default isfalse.- Returns:
- whether to use TCP_NODELAY, defaults to
false - See Also:
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties. -
config
Configuration used to configure this instance.- Returns:
- config instance
-
config(io.helidon.config.Config)