Package com.linecorp.armeria.server
Interface ServerConfig
public interface ServerConfig
Server
configuration.-
Method Summary
Modifier and TypeMethodDescriptionReturns theFunction
that transforms the absolute URI in an HTTP/1 request line into an absolute path.Returns theBlockingTaskExecutor
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 extensionReturns theDependencyInjector
that injects dependencies in annotations.Returns theServerErrorHandler
that provides the error responses in case of unexpected exceptions or protocol errors.findVirtualHost
(String hostname) Deprecated.findVirtualHost
(String hostname, int port) 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.Returns theHttp1HeaderNaming
which converts a lower-cased HTTP/2 header name into another HTTP/1 header name.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).Deprecated.server()
Returns theServer
.Returns the information of all availableHttpService
s in theServer
.default boolean
Deprecated.This method is not used anymore.boolean
Deprecated.This method will be hidden from public API.long
Returns the interval between reporting unhandled exceptions in milliseconds.Returns theList
of availableVirtualHost
s.Returns the workerEventLoopGroup
which is responsible for performing socket I/O and runningService.serve(ServiceRequestContext, Request)
.
-
Method Details
-
server
Server server()Returns theServer
. -
ports
List<ServerPort> ports()Returns theServerPort
s to listen on.- See Also:
-
defaultVirtualHost
VirtualHost 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
List<VirtualHost> virtualHosts()Returns theList
of availableVirtualHost
s.- Returns:
- the
List
of availableVirtualHost
s where its lastVirtualHost
isdefaultVirtualHost()
-
findVirtualHost
Deprecated.UsefindVirtualHost(String, int)
instead.Finds theVirtualHost
that matches the specifiedhostname
. If there's no match, thedefaultVirtualHost()
is returned. -
findVirtualHost
Finds theVirtualHost
that matches the specifiedhostname
andport
. Theport
is used to find a port-based virtual host that was bound to theport
. If there's no match, thedefaultVirtualHost()
is returned.- See Also:
-
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
List<ServiceConfig> serviceConfigs()Returns the information of all availableHttpService
s in theServer
. -
workerGroup
EventLoopGroup workerGroup()Returns the workerEventLoopGroup
which is responsible for performing socket I/O and runningService.serve(ServiceRequestContext, Request)
. -
shutdownWorkerGroupOnStop
Deprecated.This method will be hidden from public API. TheEventLoopGroup
is shut down if theshutdownOnStop
ofServerBuilder.workerGroup(EventLoopGroup, boolean)
is set totrue
.Returns whether the workerEventLoopGroup
is shut down when theServer
stops. -
channelOptions
Map<ChannelOption<?>,?> channelOptions()Returns theChannelOption
s and their values ofServer
's server sockets. -
childChannelOptions
Map<ChannelOption<?>,?> childChannelOptions()Returns theChannelOption
s and their values of sockets accepted byServer
. -
maxNumConnections
int maxNumConnections()Returns the maximum allowed number of open connections. -
idleTimeoutMillis
long idleTimeoutMillis()Returns the idle timeout of a connection in milliseconds for keep-alive. -
pingIntervalMillis
long pingIntervalMillis()Returns the HTTP/2 PING interval in milliseconds. -
maxConnectionAgeMillis
long maxConnectionAgeMillis()Returns the maximum allowed age of a connection in milliseconds for keep-alive. -
connectionDrainDurationMicros
long connectionDrainDurationMicros()Returns the graceful connection shutdown drain duration. -
maxNumRequestsPerConnection
int maxNumRequestsPerConnection()Returns the maximum allowed number of requests that can be served through one connection. -
http1MaxInitialLineLength
int http1MaxInitialLineLength()Returns the maximum length of an HTTP/1 response initial line. -
http1MaxHeaderSize
int http1MaxHeaderSize()Returns the maximum length of all headers in an HTTP/1 response. -
http1MaxChunkSize
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
int http2InitialConnectionWindowSize()Returns the initial connection-level HTTP/2 flow control window size. -
http2InitialStreamWindowSize
int http2InitialStreamWindowSize()Returns the initial stream-level HTTP/2 flow control window size. -
http2MaxStreamsPerConnection
long http2MaxStreamsPerConnection()Returns the maximum number of concurrent streams per HTTP/2 connection. -
http2MaxFrameSize
int http2MaxFrameSize()Returns the maximum size of HTTP/2 frames that can be received. -
http2MaxHeaderListSize
long http2MaxHeaderListSize()Returns the maximum size of headers that can be received. -
gracefulShutdownQuietPeriod
Duration 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
Duration gracefulShutdownTimeout()Returns the number of milliseconds to wait before shutting down the server regardless of active requests. -
blockingTaskExecutor
BlockingTaskExecutor blockingTaskExecutor()Returns theBlockingTaskExecutor
dedicated to the execution of blocking tasks or invocations. Note that theBlockingTaskExecutor
returned by this method does not set theServiceRequestContext
when executing a submitted task. UseServiceRequestContext.blockingTaskExecutor()
if possible. -
shutdownBlockingTaskExecutorOnStop
Deprecated.This method is not used anymore. TheblockingTaskExecutor
is shut down if theshutdownOnStop
ofServerBuilder.blockingTaskExecutor(BlockingTaskExecutor, boolean)
is set totrue
. -
meterRegistry
MeterRegistry meterRegistry()Returns theMeterRegistry
that collects various stats. -
proxyProtocolMaxTlvSize
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
List<ClientAddressSource> clientAddressSources()Returns a list ofClientAddressSource
s which are used to determine where to look for the client address, in the order of preference. -
clientAddressTrustedProxyFilter
Predicate<? super InetAddress> clientAddressTrustedProxyFilter()Returns a filter which evaluates whether anInetAddress
of a remote endpoint is trusted. -
clientAddressFilter
Predicate<? super InetAddress> clientAddressFilter()Returns a filter which evaluates whether anInetAddress
can be used as a client address. -
clientAddressMapper
Function<? super ProxiedAddresses,? extends InetSocketAddress> clientAddressMapper()Returns aFunction
to use when determining the client address fromProxiedAddresses
. -
isDateHeaderEnabled
boolean isDateHeaderEnabled()Returns whether the response header will include default"Date"
header. -
isServerHeaderEnabled
boolean isServerHeaderEnabled()Returns whether the response header will include default"Server"
header. -
requestIdGenerator
Deprecated. -
errorHandler
ServerErrorHandler errorHandler()Returns theServerErrorHandler
that provides the error responses in case of unexpected exceptions or protocol errors. -
http1HeaderNaming
Http1HeaderNaming http1HeaderNaming()Returns theHttp1HeaderNaming
which converts a lower-cased HTTP/2 header name into another HTTP/1 header name. This is useful when communicating with a legacy system that only supports case sensitive HTTP/1 headers. -
dependencyInjector
DependencyInjector dependencyInjector()Returns theDependencyInjector
that injects dependencies in annotations. -
absoluteUriTransformer
Returns theFunction
that transforms the absolute URI in an HTTP/1 request line into an absolute path. -
unhandledExceptionsReportIntervalMillis
long unhandledExceptionsReportIntervalMillis()Returns the interval between reporting unhandled exceptions in milliseconds.
-
findVirtualHost(String, int)
instead.