Class TcpServerConfig
- java.lang.Object
-
- io.servicetalk.tcp.netty.internal.TcpServerConfig
-
public final class TcpServerConfig extends java.lang.ObjectConfiguration for TCP based servers.
-
-
Constructor Summary
Constructors Constructor Description TcpServerConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ReadOnlyTcpServerConfigasReadOnly()Create a read only view of this object.TcpServerConfigbacklog(int backlog)Deprecated.voidenableWireLogging(java.lang.String loggerName)Enable wire-logging for all connections.voidenableWireLogging(java.lang.String loggerName, LogLevel logLevel, java.util.function.BooleanSupplier logUserData)Enable wire-logging for all connections.voidflushStrategy(FlushStrategy flushStrategy)SetsFlushStrategyto use for all connections.<T> voidlistenSocketOption(java.net.SocketOption<T> option, T value)Adds aSocketOptionthat is applied to the server socket channel which listens/accepts socket channels.java.util.Map<java.lang.String,ServerSslConfig>sniConfig()<T> voidsocketOption(java.net.SocketOption<T> option, T value)Add aSocketOptionthat is applied.SslConfigTypesslConfig()TcpServerConfigsslConfig(ServerSslConfig defaultSslConfig, java.util.Map<java.lang.String,ServerSslConfig> sniConfig)Add SSL/TLS and SNI related config.voidsslConfig(SslConfigType sslConfig)Add SSL/TLS related config.voidtransportObserver(TransportObserver transportObserver)Sets aTransportObserverthat provides visibility into transport events.
-
-
-
Method Detail
-
sniConfig
@Nullable public java.util.Map<java.lang.String,ServerSslConfig> sniConfig()
-
transportObserver
public void transportObserver(TransportObserver transportObserver)
Sets aTransportObserverthat provides visibility into transport events.- Parameters:
transportObserver- ATransportObserverthat provides visibility into transport events.
-
sslConfig
public TcpServerConfig sslConfig(ServerSslConfig defaultSslConfig, java.util.Map<java.lang.String,ServerSslConfig> sniConfig)
Add SSL/TLS and SNI related config.- Parameters:
defaultSslConfig- the defaultServerSslConfigused when no SNI match is found.sniConfig- client SNI hostname values are matched against keys in thisMapand if a match is found the correspondingServerSslConfigis used.- Returns:
this
-
listenSocketOption
public <T> void listenSocketOption(java.net.SocketOption<T> option, T value)Adds aSocketOptionthat is applied to the server socket channel which listens/accepts socket channels.- Type Parameters:
T- the type of the value- Parameters:
option- the option to applyvalue- the value- Throws:
java.lang.IllegalArgumentException- if theSocketOptionis not supported- See Also:
StandardSocketOptions,ServiceTalkSocketOptions
-
backlog
@Deprecated public TcpServerConfig backlog(int backlog)
Deprecated.The maximum queue length for incoming connection indications (a request to connect) is set to the backlog parameter. If a connection indication arrives when the queue is full, the connection may time out.- Parameters:
backlog- the backlog to use when accepting connections- Returns:
this
-
asReadOnly
public ReadOnlyTcpServerConfig asReadOnly()
Create a read only view of this object.- Returns:
- a read only view of this object.
-
sslConfig
@Nullable public final SslConfigType sslConfig()
-
socketOption
public final <T> void socketOption(java.net.SocketOption<T> option, T value)Add aSocketOptionthat is applied.- Type Parameters:
T- the type of the value- Parameters:
option- the option to applyvalue- the value- Throws:
java.lang.IllegalArgumentException- if theSocketOptionis not supported- See Also:
StandardSocketOptions,ServiceTalkSocketOptions
-
flushStrategy
public final void flushStrategy(FlushStrategy flushStrategy)
SetsFlushStrategyto use for all connections.- Parameters:
flushStrategy-FlushStrategyto use for all connections
-
enableWireLogging
public final void enableWireLogging(java.lang.String loggerName)
Enable wire-logging for all connections. All wire events will be logged at trace level.- Parameters:
loggerName- The name of the logger to log wire events
-
enableWireLogging
public final void enableWireLogging(java.lang.String loggerName, LogLevel logLevel, java.util.function.BooleanSupplier logUserData)Enable wire-logging for all connections. All wire events will be logged at trace level.- Parameters:
loggerName- provides the logger to log data/events to/from the wire.logLevel- the level to log data/events to/from the wire.logUserData-trueto include user data (e.g. data, headers, etc.).falseto exclude user data and log only network events.
-
sslConfig
public final void sslConfig(SslConfigType sslConfig)
Add SSL/TLS related config.- Parameters:
sslConfig- theServerSslConfig.
-
-