Package com.linecorp.armeria.server
Interface ServerConfig
public interface ServerConfig
Server configuration.-
Method Summary
Modifier and TypeMethodDescriptionReturns theFunctionthat transforms the absolute URI in an HTTP/1 request line into an absolute path.Returns theBlockingTaskExecutordedicated to the execution of blocking tasks or invocations.Map<ChannelOption<?>,?> Returns theChannelOptions and their values ofServer's server sockets.Map<ChannelOption<?>,?> Returns theChannelOptions and their values of sockets accepted byServer.Predicate<? super InetAddress>Returns a filter which evaluates whether anInetAddresscan be used as a client address.Function<? super ProxiedAddresses,? extends InetSocketAddress> Returns aFunctionto use when determining the client address fromProxiedAddresses.Returns a list ofClientAddressSources 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 anInetAddressof a remote endpoint is trusted.longReturns the graceful connection shutdown drain duration.Returns the defaultVirtualHost, which is used when no otherVirtualHosts match the host name of a client request. e.g. the"Host"header in HTTP or host name in TLS SNI extensionReturns theDependencyInjectorthat injects dependencies in annotations.Returns theServerErrorHandlerthat 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 theHttp1HeaderNamingwhich converts a lower-cased HTTP/2 header name into another HTTP/1 header name.intReturns the maximum length of each chunk in an HTTP/1 response content.intReturns the maximum length of all headers in an HTTP/1 response.intReturns the maximum length of an HTTP/1 response initial line.intReturns the initial connection-level HTTP/2 flow control window size.intReturns the initial stream-level HTTP/2 flow control window size.intReturns the maximum size of HTTP/2 frames that can be received.longReturns the maximum size of headers that can be received.longReturns the maximum number of concurrent streams per HTTP/2 connection.longReturns the idle timeout of a connection in milliseconds for keep-alive.booleanReturns whether the response header will include default"Date"header.booleanReturns whether the response header will include default"Server"header.longReturns the maximum allowed age of a connection in milliseconds for keep-alive.intReturns the maximum allowed number of open connections.intReturns the maximum allowed number of requests that can be served through one connection.Returns theMeterRegistrythat collects various stats.longReturns the HTTP/2 PING interval in milliseconds.ports()Returns theServerPorts to listen on.intReturns the maximum size of additional data (TLV, Tag-Length-Value).Deprecated.server()Returns theServer.Returns the information of all availableHttpServices in theServer.default booleanDeprecated.This method is not used anymore.booleanDeprecated.This method will be hidden from public API.longReturns the interval between reporting unhandled exceptions in milliseconds.Returns theListof availableVirtualHosts.Returns the workerEventLoopGroupwhich is responsible for performing socket I/O and runningService.serve(ServiceRequestContext, Request).
-
Method Details
-
server
Server server()Returns theServer. -
ports
List<ServerPort> ports()Returns theServerPorts to listen on.- See Also:
-
defaultVirtualHost
VirtualHost defaultVirtualHost()Returns the defaultVirtualHost, which is used when no otherVirtualHosts 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 theListof availableVirtualHosts.- Returns:
- the
Listof availableVirtualHosts where its lastVirtualHostisdefaultVirtualHost()
-
findVirtualHost
Deprecated.UsefindVirtualHost(String, int)instead.Finds theVirtualHostthat matches the specifiedhostname. If there's no match, thedefaultVirtualHost()is returned. -
findVirtualHost
Finds theVirtualHostthat matches the specifiedhostnameandport. Theportis 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 theListofVirtualHosts that contains the specifiedHttpService. If there's no match, an emptyListis 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 availableHttpServices in theServer. -
workerGroup
EventLoopGroup workerGroup()Returns the workerEventLoopGroupwhich is responsible for performing socket I/O and runningService.serve(ServiceRequestContext, Request). -
shutdownWorkerGroupOnStop
Deprecated.This method will be hidden from public API. TheEventLoopGroupis shut down if theshutdownOnStopofServerBuilder.workerGroup(EventLoopGroup, boolean)is set totrue.Returns whether the workerEventLoopGroupis shut down when theServerstops. -
channelOptions
Map<ChannelOption<?>,?> channelOptions()Returns theChannelOptions and their values ofServer's server sockets. -
childChannelOptions
Map<ChannelOption<?>,?> childChannelOptions()Returns theChannelOptions 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.0means 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 theBlockingTaskExecutordedicated to the execution of blocking tasks or invocations. Note that theBlockingTaskExecutorreturned by this method does not set theServiceRequestContextwhen executing a submitted task. UseServiceRequestContext.blockingTaskExecutor()if possible. -
shutdownBlockingTaskExecutorOnStop
Deprecated.This method is not used anymore. TheblockingTaskExecutoris shut down if theshutdownOnStopofServerBuilder.blockingTaskExecutor(BlockingTaskExecutor, boolean)is set totrue. -
meterRegistry
MeterRegistry meterRegistry()Returns theMeterRegistrythat 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 ofClientAddressSources 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 anInetAddressof a remote endpoint is trusted. -
clientAddressFilter
Predicate<? super InetAddress> clientAddressFilter()Returns a filter which evaluates whether anInetAddresscan be used as a client address. -
clientAddressMapper
Function<? super ProxiedAddresses,? extends InetSocketAddress> clientAddressMapper()Returns aFunctionto 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 theServerErrorHandlerthat provides the error responses in case of unexpected exceptions or protocol errors. -
http1HeaderNaming
Http1HeaderNaming http1HeaderNaming()Returns theHttp1HeaderNamingwhich 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 theDependencyInjectorthat injects dependencies in annotations. -
absoluteUriTransformer
Returns theFunctionthat 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.