Package io.helidon.webserver
Class SocketConfiguration.Builder
- java.lang.Object
-
- io.helidon.webserver.SocketConfiguration.Builder
-
- All Implemented Interfaces:
Builder<SocketConfiguration>,Supplier<SocketConfiguration>
- Enclosing interface:
- SocketConfiguration
public static final class SocketConfiguration.Builder extends Object implements Builder<SocketConfiguration>
TheSocketConfigurationbuilder class.
-
-
Method Summary
All Methods Instance Methods Concrete 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()SocketConfiguration.BuilderclientAuth(ClientAuthentication clientAuth)Configures whether client authentication will be required or not.SocketConfiguration.BuilderenabledSSlProtocols(String... protocols)Configures the SSL protocols to enable with the server socket.SocketConfiguration.BuilderenabledSSlProtocols(List<String> protocols)Configures the SSL protocols to enable with the server socket.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)Configures aSSLContextto use with the server socket.SocketConfiguration.Builderssl(SSLContext sslContext)Configures aSSLContextto use with the server socket.SocketConfiguration.BuildertimeoutMillis(int timeoutMillis)Configures a server socket timeout in milliseconds or0for an infinite timeout.
-
-
-
Method Detail
-
port
public SocketConfiguration.Builder port(int port)
Configures a server port to listen on with the server socket. If port is0then any available ephemeral port will be used.- Parameters:
port- the server port of the server socket- Returns:
- this builder
-
bindAddress
public SocketConfiguration.Builder bindAddress(InetAddress bindAddress)
Configures local address where the server listens on with the server socket. Ifnullthen listens an all local addresses.- Parameters:
bindAddress- an address to bind with the server socket;nullfor all local addresses- 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.- Parameters:
backlog- a maximum length of the queue of incoming connections- Returns:
- this builder
-
timeoutMillis
public SocketConfiguration.Builder timeoutMillis(int timeoutMillis)
Configures 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.- Parameters:
receiveBufferSize- a buffer size in bytes of the server socket or0- Returns:
- this builder
-
ssl
public SocketConfiguration.Builder ssl(SSLContext sslContext)
Configures 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
public SocketConfiguration.Builder ssl(Supplier<? extends SSLContext> sslContextBuilder)
Configures 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
-
clientAuth
public SocketConfiguration.Builder clientAuth(ClientAuthentication clientAuth)
Configures whether client authentication will be required or not.- Parameters:
clientAuth- client authentication- Returns:
- this builder
-
enabledSSlProtocols
public SocketConfiguration.Builder enabledSSlProtocols(String... protocols)
Configures the SSL protocols to enable with the server socket.- Parameters:
protocols- protocols to enable, ifnullenables the default protocols- Returns:
- this builder
-
enabledSSlProtocols
public SocketConfiguration.Builder enabledSSlProtocols(List<String> protocols)
Configures the SSL protocols to enable with the server socket.- Parameters:
protocols- protocols to enable, ifnullor empty enables the default protocols- Returns:
- this builder
-
build
public SocketConfiguration build()
- Specified by:
buildin interfaceBuilder<SocketConfiguration>
-
-