@ConfigurationProperties(value="netty") @Replaces(value=HttpServerConfiguration.class) public class NettyHttpServerConfiguration extends HttpServerConfiguration
NettyHttpServer
.Modifier and Type | Class and Description |
---|---|
static class |
NettyHttpServerConfiguration.AccessLogger
Access logger configuration.
|
static class |
NettyHttpServerConfiguration.EventLoopConfig
Abstract class for configuring the Netty event loop.
|
static class |
NettyHttpServerConfiguration.Http2Settings
Http2 settings.
|
static class |
NettyHttpServerConfiguration.Parent
Configuration for Netty parent.
|
static class |
NettyHttpServerConfiguration.Worker
Configuration for Netty worker.
|
HttpServerConfiguration.CorsConfiguration, HttpServerConfiguration.HostResolutionConfiguration, HttpServerConfiguration.MultipartConfiguration
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_CHUNKSUPPORTED
The default chunk supported value.
|
static int |
DEFAULT_COMPRESSIONLEVEL
The default compression level.
|
static int |
DEFAULT_COMPRESSIONTHRESHOLD
The default compression threshold.
|
static int |
DEFAULT_INITIALBUFFERSIZE
The default initial buffer size value.
|
static int |
DEFAULT_MAXCHUNKSIZE
The default max chunk size.
|
static int |
DEFAULT_MAXHEADERSIZE
The default max header size.
|
static int |
DEFAULT_MAXINITIALLINELENGTH
The default max initial line length.
|
static boolean |
DEFAULT_USE_NATIVE_TRANSPORT
The default use netty's native transport flag.
|
static boolean |
DEFAULT_VALIDATEHEADERS
The default validate headers value.
|
DEFAULT_DATEHEADER, DEFAULT_DUAL_PROTOCOL, DEFAULT_IDLE_TIME_MINUTES, DEFAULT_LOG_HANDLED_EXCEPTIONS, DEFAULT_MAX_REQUEST_SIZE, DEFAULT_PORT, DEFAULT_RANDOM_PORT, DEFAULT_READ_IDLE_TIME_MINUTES, DEFAULT_WRITE_IDLE_TIME_MINUTES, PREFIX
Constructor and Description |
---|
NettyHttpServerConfiguration()
Default empty constructor.
|
NettyHttpServerConfiguration(ApplicationConfiguration applicationConfiguration) |
NettyHttpServerConfiguration(ApplicationConfiguration applicationConfiguration,
java.util.List<ChannelPipelineListener> pipelineCustomizers) |
Modifier and Type | Method and Description |
---|---|
NettyHttpServerConfiguration.AccessLogger |
getAccessLogger()
Returns the AccessLogger configuration.
|
java.util.Map<io.netty.channel.ChannelOption,java.lang.Object> |
getChildOptions() |
int |
getCompressionLevel()
The default compression level.
|
int |
getCompressionThreshold()
The default compression threshold.
|
java.lang.String |
getFallbackProtocol() |
NettyHttpServerConfiguration.Http2Settings |
getHttp2()
Returns the Http2Settings.
|
int |
getInitialBufferSize()
The initial buffer size.
|
java.util.Optional<io.netty.handler.logging.LogLevel> |
getLogLevel()
The server
LogLevel to enable. |
int |
getMaxChunkSize()
The maximum chunk size.
|
int |
getMaxHeaderSize()
The maximum size of an individual HTTP setter.
|
int |
getMaxInitialLineLength()
The maximum length of the initial HTTP request line.
|
java.util.Map<io.netty.channel.ChannelOption,java.lang.Object> |
getOptions() |
NettyHttpServerConfiguration.Parent |
getParent() |
java.util.List<ChannelPipelineListener> |
getPipelineCustomizers() |
NettyHttpServerConfiguration.Worker |
getWorker() |
boolean |
isChunkedSupported()
Whether chunked requests are supported.
|
boolean |
isUseNativeTransport()
Whether to use netty's native transport (epoll or kqueue) if available.
|
boolean |
isValidateHeaders()
Whether to validate headers.
|
void |
setAccessLogger(NettyHttpServerConfiguration.AccessLogger accessLogger)
Sets the AccessLogger configuration.
|
void |
setChildOptions(java.util.Map<io.netty.channel.ChannelOption,java.lang.Object> childOptions)
Sets the Netty child worker options.
|
void |
setChunkedSupported(boolean chunkedSupported)
Sets whether chunked transfer encoding is supported.
|
void |
setCompressionLevel(int compressionLevel)
Sets the compression level (0-9).
|
void |
setCompressionThreshold(int compressionThreshold)
Sets the minimum size of a request body must be in order to be compressed.
|
void |
setFallbackProtocol(java.lang.String fallbackProtocol)
Sets the fallback protocol to use when negotiating via ALPN.
|
void |
setHttp2(NettyHttpServerConfiguration.Http2Settings http2)
Sets the Http2Settings.
|
void |
setInitialBufferSize(int initialBufferSize)
Sets the initial buffer size.
|
void |
setLogLevel(io.netty.handler.logging.LogLevel logLevel)
Sets the Netty log level.
|
void |
setMaxChunkSize(int maxChunkSize)
Sets the maximum size of any single request chunk.
|
void |
setMaxHeaderSize(int maxHeaderSize)
Sets the maximum size of any one header.
|
void |
setMaxInitialLineLength(int maxInitialLineLength)
Sets the maximum initial line length for the HTTP request.
|
void |
setOptions(java.util.Map<io.netty.channel.ChannelOption,java.lang.Object> options)
Sets the channel options.
|
void |
setParent(NettyHttpServerConfiguration.Parent parent)
Sets the parent event loop configuration.
|
void |
setUseNativeTransport(boolean useNativeTransport)
Sets whether to use netty's native transport (epoll or kqueue) if available .
|
void |
setValidateHeaders(boolean validateHeaders)
Sets whether to validate incoming headers.
|
void |
setWorker(NettyHttpServerConfiguration.Worker worker)
Sets the worker event loop configuration.
|
getApplicationConfiguration, getClientAddressHeader, getContextPath, getCors, getDefaultCharset, getHost, getHostResolution, getHttpVersion, getIdleTimeout, getMaxRequestSize, getMultipart, getPort, getReadIdleTimeout, getReadTimeout, getServerHeader, getThreadSelection, getWriteIdleTimeout, isDateHeader, isDualProtocol, isLogHandledExceptions, setClientAddressHeader, setContextPath, setCors, setDateHeader, setDefaultCharset, setDualProtocol, setHost, setHostResolution, setHttpVersion, setIdleTimeout, setLogHandledExceptions, setMaxRequestSize, setMultipart, setPort, setReadIdleTimeout, setReadTimeout, setServerHeader, setThreadSelection, setWriteIdleTimeout
public static final boolean DEFAULT_USE_NATIVE_TRANSPORT
public static final int DEFAULT_MAXINITIALLINELENGTH
public static final int DEFAULT_MAXHEADERSIZE
public static final int DEFAULT_MAXCHUNKSIZE
public static final boolean DEFAULT_CHUNKSUPPORTED
public static final boolean DEFAULT_VALIDATEHEADERS
public static final int DEFAULT_INITIALBUFFERSIZE
public static final int DEFAULT_COMPRESSIONTHRESHOLD
public static final int DEFAULT_COMPRESSIONLEVEL
public NettyHttpServerConfiguration()
public NettyHttpServerConfiguration(ApplicationConfiguration applicationConfiguration)
applicationConfiguration
- The application configuration@Inject public NettyHttpServerConfiguration(ApplicationConfiguration applicationConfiguration, java.util.List<ChannelPipelineListener> pipelineCustomizers)
applicationConfiguration
- The application configurationpipelineCustomizers
- A list of pipeline customizerspublic NettyHttpServerConfiguration.AccessLogger getAccessLogger()
public void setAccessLogger(NettyHttpServerConfiguration.AccessLogger accessLogger)
accessLogger
- The configuration .public NettyHttpServerConfiguration.Http2Settings getHttp2()
public void setHttp2(NettyHttpServerConfiguration.Http2Settings http2)
http2
- The Http2Settings.public java.util.List<ChannelPipelineListener> getPipelineCustomizers()
public java.lang.String getFallbackProtocol()
ApplicationProtocolNames
public void setFallbackProtocol(java.lang.String fallbackProtocol)
fallbackProtocol
- The fallback protocol to use when negotiating via ALPNApplicationProtocolNames
public java.util.Optional<io.netty.handler.logging.LogLevel> getLogLevel()
LogLevel
to enable.LogLevel
to enablepublic int getMaxInitialLineLength()
public int getMaxHeaderSize()
public int getMaxChunkSize()
public boolean isChunkedSupported()
public boolean isUseNativeTransport()
public boolean isValidateHeaders()
public int getInitialBufferSize()
public int getCompressionThreshold()
public int getCompressionLevel()
public java.util.Map<io.netty.channel.ChannelOption,java.lang.Object> getChildOptions()
ServerBootstrap.childOptions()
public java.util.Map<io.netty.channel.ChannelOption,java.lang.Object> getOptions()
AbstractBootstrap.options()
public NettyHttpServerConfiguration.Worker getWorker()
EventLoopGroup
public NettyHttpServerConfiguration.Parent getParent()
EventLoopGroup
public void setChildOptions(java.util.Map<io.netty.channel.ChannelOption,java.lang.Object> childOptions)
childOptions
- The optionspublic void setOptions(java.util.Map<io.netty.channel.ChannelOption,java.lang.Object> options)
options
- The channel optionspublic void setWorker(NettyHttpServerConfiguration.Worker worker)
worker
- The worker configpublic void setParent(NettyHttpServerConfiguration.Parent parent)
parent
- The parent configpublic void setMaxInitialLineLength(@ReadableBytes int maxInitialLineLength)
maxInitialLineLength
- The max lengthpublic void setMaxHeaderSize(@ReadableBytes int maxHeaderSize)
maxHeaderSize
- The max header sizepublic void setMaxChunkSize(@ReadableBytes int maxChunkSize)
maxChunkSize
- The max chunk sizepublic void setChunkedSupported(boolean chunkedSupported)
chunkedSupported
- True if it is supportedpublic void setUseNativeTransport(boolean useNativeTransport)
useNativeTransport
- True if netty's native transport should be use if available.public void setValidateHeaders(boolean validateHeaders)
validateHeaders
- True if headers should be validated.public void setInitialBufferSize(int initialBufferSize)
initialBufferSize
- The initial buffer sizepublic void setLogLevel(io.netty.handler.logging.LogLevel logLevel)
logLevel
- The log levelpublic void setCompressionThreshold(@ReadableBytes int compressionThreshold)
compressionThreshold
- The size request bodies must be in order to be a candidate for compression.public void setCompressionLevel(@ReadableBytes int compressionLevel)
compressionLevel
- The compression level.