Package com.linecorp.armeria.server
Class ServerConfig
java.lang.Object
com.linecorp.armeria.server.ServerConfig
Server
configuration.-
Method Summary
Modifier and TypeMethodDescriptionReturns theScheduledExecutorService
dedicated to the execution of blocking tasks or invocations.Map<ChannelOption<?>,?>
Returns theChannelOption
s and their values ofServer
's server sockets.Map<ChannelOption<?>,?>
Returns theChannelOption
s and their values of sockets accepted byServer
.Predicate<? super InetAddress>
Returns a filter which evaluates whether anInetAddress
can be used as a client address.Function<? super ProxiedAddresses,? extends InetSocketAddress>
Returns aFunction
to use when determining the client address fromProxiedAddresses
.Returns a list ofClientAddressSource
s which are used to determine where to look for the client address, in the order of preference.Predicate<? super InetAddress>
Returns a filter which evaluates whether anInetAddress
of a remote endpoint is trusted.long
Returns the graceful connection shutdown drain duration.Returns the defaultVirtualHost
, which is used when no otherVirtualHost
s match the host name of a client request. e.g. the"Host"
header in HTTP or host name in TLS SNI extensionfindVirtualHost(String hostname)
Finds theVirtualHost
that matches the specifiedhostname
.findVirtualHosts(HttpService service)
Returns the number of milliseconds to wait for active requests to go end before shutting down.Returns the number of milliseconds to wait before shutting down the server regardless of active requests.int
Returns the maximum length of each chunk in an HTTP/1 response content.int
Returns the maximum length of all headers in an HTTP/1 response.int
Returns the maximum length of an HTTP/1 response initial line.int
Returns the initial connection-level HTTP/2 flow control window size.int
Returns the initial stream-level HTTP/2 flow control window size.int
Returns the maximum size of HTTP/2 frames that can be received.long
Returns the maximum size of headers that can be received.long
Returns the maximum number of concurrent streams per HTTP/2 connection.long
Returns the idle timeout of a connection in milliseconds for keep-alive.boolean
Returns whether the response header will include default"Date"
header.boolean
Returns whether the response header will include default"Server"
header.long
Returns the maximum allowed age of a connection in milliseconds for keep-alive.int
Returns the maximum allowed number of open connections.int
Returns the maximum allowed number of requests that can be served through one connection.Returns theMeterRegistry
that collects various stats.long
Returns the HTTP/2 PING interval in milliseconds.ports()
Returns theServerPort
s to listen on.int
Returns the maximum size of additional data (TLV, Tag-Length-Value).server()
Returns theServer
.Returns the information of all availableHttpService
s in theServer
.boolean
boolean
Returns whether the workerEventLoopGroup
is shut down when theServer
stops.toString()
Returns theList
of availableVirtualHost
s.Returns the workerEventLoopGroup
which is responsible for performing socket I/O and runningService.serve(ServiceRequestContext, Request)
.
-
Method Details
-
server
Returns theServer
. -
ports
Returns theServerPort
s to listen on.- See Also:
Server.activePorts()
-
defaultVirtualHost
Returns the defaultVirtualHost
, which is used when no otherVirtualHost
s match the host name of a client request. e.g. the"Host"
header in HTTP or host name in TLS SNI extension- See Also:
virtualHosts()
-
virtualHosts
Returns theList
of availableVirtualHost
s.- Returns:
- the
List
of availableVirtualHost
s where its lastVirtualHost
isdefaultVirtualHost()
-
findVirtualHost
Finds theVirtualHost
that matches the specifiedhostname
. If there's no match, thedefaultVirtualHost()
is returned. -
findVirtualHosts
Finds theList
ofVirtualHost
s that contains the specifiedHttpService
. If there's no match, an emptyList
is returned. Note that this is potentially an expensive operation and thus should not be used in a performance-sensitive path. -
serviceConfigs
Returns the information of all availableHttpService
s in theServer
. -
workerGroup
Returns the workerEventLoopGroup
which is responsible for performing socket I/O and runningService.serve(ServiceRequestContext, Request)
. -
shutdownWorkerGroupOnStop
public boolean shutdownWorkerGroupOnStop()Returns whether the workerEventLoopGroup
is shut down when theServer
stops. -
channelOptions
Returns theChannelOption
s and their values ofServer
's server sockets. -
childChannelOptions
Returns theChannelOption
s and their values of sockets accepted byServer
. -
maxNumConnections
public int maxNumConnections()Returns the maximum allowed number of open connections. -
idleTimeoutMillis
public long idleTimeoutMillis()Returns the idle timeout of a connection in milliseconds for keep-alive. -
pingIntervalMillis
public long pingIntervalMillis()Returns the HTTP/2 PING interval in milliseconds. -
maxConnectionAgeMillis
public long maxConnectionAgeMillis()Returns the maximum allowed age of a connection in milliseconds for keep-alive. -
connectionDrainDurationMicros
public long connectionDrainDurationMicros()Returns the graceful connection shutdown drain duration. -
maxNumRequestsPerConnection
public int maxNumRequestsPerConnection()Returns the maximum allowed number of requests that can be served through one connection. -
http1MaxInitialLineLength
public int http1MaxInitialLineLength()Returns the maximum length of an HTTP/1 response initial line. -
http1MaxHeaderSize
public int http1MaxHeaderSize()Returns the maximum length of all headers in an HTTP/1 response. -
http1MaxChunkSize
public int http1MaxChunkSize()Returns the maximum length of each chunk in an HTTP/1 response content. The content or a chunk longer than this value will be split into smaller chunks so that their lengths never exceed it. -
http2InitialConnectionWindowSize
public int http2InitialConnectionWindowSize()Returns the initial connection-level HTTP/2 flow control window size. -
http2InitialStreamWindowSize
public int http2InitialStreamWindowSize()Returns the initial stream-level HTTP/2 flow control window size. -
http2MaxStreamsPerConnection
public long http2MaxStreamsPerConnection()Returns the maximum number of concurrent streams per HTTP/2 connection. -
http2MaxFrameSize
public int http2MaxFrameSize()Returns the maximum size of HTTP/2 frames that can be received. -
http2MaxHeaderListSize
public long http2MaxHeaderListSize()Returns the maximum size of headers that can be received. -
gracefulShutdownQuietPeriod
Returns the number of milliseconds to wait for active requests to go end before shutting down.0
means the server will stop right away without waiting. -
gracefulShutdownTimeout
Returns the number of milliseconds to wait before shutting down the server regardless of active requests. -
blockingTaskExecutor
Returns theScheduledExecutorService
dedicated to the execution of blocking tasks or invocations. Note that theScheduledExecutorService
returned by this method does not set theServiceRequestContext
when executing a submitted task. UseServiceRequestContext.blockingTaskExecutor()
if possible. -
shutdownBlockingTaskExecutorOnStop
public boolean shutdownBlockingTaskExecutorOnStop() -
meterRegistry
Returns theMeterRegistry
that collects various stats. -
proxyProtocolMaxTlvSize
public int proxyProtocolMaxTlvSize()Returns the maximum size of additional data (TLV, Tag-Length-Value). It is only used when PROXY protocol is enabled on the server port. -
clientAddressSources
Returns a list ofClientAddressSource
s which are used to determine where to look for the client address, in the order of preference. -
clientAddressTrustedProxyFilter
Returns a filter which evaluates whether anInetAddress
of a remote endpoint is trusted. -
clientAddressFilter
Returns a filter which evaluates whether anInetAddress
can be used as a client address. -
clientAddressMapper
Returns aFunction
to use when determining the client address fromProxiedAddresses
. -
isServerHeaderEnabled
public boolean isServerHeaderEnabled()Returns whether the response header will include default"Server"
header. -
isDateHeaderEnabled
public boolean isDateHeaderEnabled()Returns whether the response header will include default"Date"
header. -
requestIdGenerator
-
exceptionHandler
-
toString
-