- java.lang.Object
-
- io.helidon.webserver.SocketConfiguration.Builder
-
- All Implemented Interfaces:
Builder<SocketConfiguration>,SocketConfiguration.SocketConfigurationBuilder<SocketConfiguration.Builder>,Supplier<SocketConfiguration>
- Enclosing interface:
- SocketConfiguration
public static final class SocketConfiguration.Builder extends Object implements SocketConfiguration.SocketConfigurationBuilder<SocketConfiguration.Builder>, Builder<SocketConfiguration>
TheSocketConfigurationbuilder class.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SocketConfiguration.Builderbacklog(int backlog)Configures a maximum length of the queue of incoming connections on the server socket.SocketConfiguration.BuilderbindAddress(InetAddress bindAddress)Configures local address where the server listens on with the server socket.SocketConfigurationbuild()Build the instance from this builder.SocketConfiguration.Builderconfig(Config config)Update this socket configuration from aConfig.booleanenabled()SocketConfiguration.Builderenabled(boolean enabled)Set this socket builder to enabled or disabled.SocketConfiguration.BuilderenabledSSlProtocols(String... protocols)Deprecated.since 2.0.0, please useWebServerTls.Builder.enabledProtocols(String...)insteadSocketConfiguration.BuilderenabledSSlProtocols(List<String> protocols)Deprecated.SocketConfiguration.Buildername(String name)Configure a socket name, to bind named routings to.SocketConfiguration.Builderport(int port)Configures a server port to listen on with the server socket.SocketConfiguration.BuilderreceiveBufferSize(int receiveBufferSize)Configures proposed value of the TCP receive window that is advertised to the remote peer on the server socket.SocketConfiguration.Builderssl(Supplier<? extends SSLContext> sslContextBuilder)Deprecated.since 2.0.0, please useSocketConfiguration.SocketConfigurationBuilder.tls(Supplier)insteadSocketConfiguration.Builderssl(SSLContext sslContext)Deprecated.since 2.0.0, please usetls(WebServerTls)insteadSocketConfiguration.Buildertimeout(long amount, TimeUnit unit)Configures a server socket timeout.SocketConfiguration.BuildertimeoutMillis(int timeoutMillis)Deprecated.since 2.0.0 please usetimeout(long, java.util.concurrent.TimeUnit)insteadSocketConfiguration.Buildertls(WebServerTls webServerTls)Configures SSL for this socket.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.helidon.webserver.SocketConfiguration.SocketConfigurationBuilder
bindAddress, host, tls
-
-
-
-
Method Detail
-
build
public SocketConfiguration build()
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<SocketConfiguration>- Returns:
- instance of the built type
-
port
public SocketConfiguration.Builder port(int port)
Description copied from interface:SocketConfiguration.SocketConfigurationBuilderConfigures a server port to listen on with the server socket. If port is0then any available ephemeral port will be used.- Specified by:
portin interfaceSocketConfiguration.SocketConfigurationBuilder<SocketConfiguration.Builder>- Parameters:
port- the server port of the server socket- Returns:
- this builder
-
bindAddress
public SocketConfiguration.Builder bindAddress(InetAddress bindAddress)
Description copied from interface:SocketConfiguration.SocketConfigurationBuilderConfigures local address where the server listens on with the server socket. If not configured, then listens an all local addresses.- Specified by:
bindAddressin interfaceSocketConfiguration.SocketConfigurationBuilder<SocketConfiguration.Builder>- Parameters:
bindAddress- an address to bind with the server socket- Returns:
- this builder
-
backlog
public SocketConfiguration.Builder backlog(int backlog)
Configures a maximum length of the queue of incoming connections on the server socket.Default value is
SocketConfiguration.DEFAULT_BACKLOG_SIZE.- Specified by:
backlogin interfaceSocketConfiguration.SocketConfigurationBuilder<SocketConfiguration.Builder>- Parameters:
backlog- a maximum length of the queue of incoming connections- Returns:
- this builder
-
timeoutMillis
@Deprecated public SocketConfiguration.Builder timeoutMillis(int timeoutMillis)
Deprecated.since 2.0.0 please usetimeout(long, java.util.concurrent.TimeUnit)insteadConfigures a server socket timeout in milliseconds or0for an infinite timeout.- Parameters:
timeoutMillis- a server socket timeout in milliseconds or0- Returns:
- this builder
-
receiveBufferSize
public SocketConfiguration.Builder receiveBufferSize(int receiveBufferSize)
Configures proposed value of the TCP receive window that is advertised to the remote peer on the server socket.If
0then use implementation default.- Specified by:
receiveBufferSizein interfaceSocketConfiguration.SocketConfigurationBuilder<SocketConfiguration.Builder>- Parameters:
receiveBufferSize- a buffer size in bytes of the server socket or0- Returns:
- this builder
-
ssl
@Deprecated public SocketConfiguration.Builder ssl(SSLContext sslContext)
Deprecated.since 2.0.0, please usetls(WebServerTls)insteadConfigures aSSLContextto use with the server socket. If notnullthen the server enforces an SSL communication.- Parameters:
sslContext- a SSL context to use- Returns:
- this builder
-
ssl
@Deprecated public SocketConfiguration.Builder ssl(Supplier<? extends SSLContext> sslContextBuilder)
Deprecated.since 2.0.0, please useSocketConfiguration.SocketConfigurationBuilder.tls(Supplier)insteadConfigures aSSLContextto use with the server socket. If notnullthen the server enforces an SSL communication.- Parameters:
sslContextBuilder- a SSL context builder to use; will be built as a first step of this method execution- Returns:
- this builder
-
enabledSSlProtocols
@Deprecated public SocketConfiguration.Builder enabledSSlProtocols(String... protocols)
Deprecated.since 2.0.0, please useWebServerTls.Builder.enabledProtocols(String...)insteadConfigures the SSL protocols to enable with the server socket.- Parameters:
protocols- protocols to enable, ifnullenables the default protocols- Returns:
- this builder
-
enabledSSlProtocols
@Deprecated public SocketConfiguration.Builder enabledSSlProtocols(List<String> protocols)
Deprecated.Configures the SSL protocols to enable with the server socket.- Parameters:
protocols- protocols to enable, ifnullor empty enables the default protocols- Returns:
- this builder
-
timeout
public SocketConfiguration.Builder timeout(long amount, TimeUnit unit)
Description copied from interface:SocketConfiguration.SocketConfigurationBuilderConfigures a server socket timeout.- Specified by:
timeoutin interfaceSocketConfiguration.SocketConfigurationBuilder<SocketConfiguration.Builder>- Parameters:
amount- an amount of time to configure the timeout, use0for infinite timeoutunit- time unit to use with the configured amount- Returns:
- this builder
-
tls
public SocketConfiguration.Builder tls(WebServerTls webServerTls)
Description copied from interface:SocketConfiguration.SocketConfigurationBuilderConfigures SSL for this socket. When configured, the server enforces SSL configuration. If this method is called, any other method except forSocketConfiguration.SocketConfigurationBuilder.tls(java.util.function.Supplier)ยจ and repeated invocation of this method would be ignored.If this method is called again, the previous configuration would be ignored.
- Specified by:
tlsin interfaceSocketConfiguration.SocketConfigurationBuilder<SocketConfiguration.Builder>- Parameters:
webServerTls- ssl configuration to use with this socket- Returns:
- this builder
-
name
public SocketConfiguration.Builder name(String name)
Configure a socket name, to bind named routings to.- Parameters:
name- name of the socket- Returns:
- updated builder instance
-
enabled
public SocketConfiguration.Builder enabled(boolean enabled)
Set this socket builder to enabled or disabled.- Parameters:
enabled- when set tofalse, the socket is not going to be opened by the server- Returns:
- updated builder instance
-
config
public SocketConfiguration.Builder config(Config config)
Description copied from interface:SocketConfiguration.SocketConfigurationBuilderUpdate this socket configuration from aConfig.- Specified by:
configin interfaceSocketConfiguration.SocketConfigurationBuilder<SocketConfiguration.Builder>- Parameters:
config- configuration on the node of a socket- Returns:
- updated builder instance
-
enabled
public boolean enabled()
-
-