| Package | Description |
|---|---|
| com.linecorp.armeria.server |
Server core.
|
| Modifier and Type | Method and Description |
|---|---|
ServerBuilder |
ServerBuilder.accessLogFormat(String accessLogFormat)
Sets the format of this
Server's access log. |
ServerBuilder |
ServerBuilder.accessLogger(Function<? super VirtualHost,? extends org.slf4j.Logger> mapper)
Sets the default access logger mapper for all
VirtualHosts. |
ServerBuilder |
ServerBuilder.accessLogger(org.slf4j.Logger logger)
Sets the default access
Logger for all VirtualHosts. |
ServerBuilder |
ServerBuilder.accessLogger(String loggerName)
Sets the default access logger name for all
VirtualHosts. |
ServerBuilder |
ServerBuilder.accessLogWriter(AccessLogWriter accessLogWriter,
boolean shutdownOnStop)
Sets an access log writer of this
Server. |
ServerBuilder |
VirtualHostBuilder.and()
Returns the parent
ServerBuilder. |
ServerBuilder |
ServerBuilder.annotatedService(Object service)
Binds the specified annotated service object under the path prefix
"/". |
ServerBuilder |
ServerBuilder.annotatedService(Object service,
Function<? super HttpService,? extends HttpService> decorator,
Object... exceptionHandlersAndConverters)
Binds the specified annotated service object under the path prefix
"/". |
ServerBuilder |
ServerBuilder.annotatedService(Object service,
Object... exceptionHandlersAndConverters)
Binds the specified annotated service object under the path prefix
"/". |
ServerBuilder |
ServerBuilder.annotatedService(String pathPrefix,
Object service)
Binds the specified annotated service object under the specified path prefix.
|
ServerBuilder |
ServerBuilder.annotatedService(String pathPrefix,
Object service,
Function<? super HttpService,? extends HttpService> decorator,
Iterable<?> exceptionHandlersAndConverters)
Binds the specified annotated service object under the specified path prefix.
|
ServerBuilder |
ServerBuilder.annotatedService(String pathPrefix,
Object service,
Function<? super HttpService,? extends HttpService> decorator,
Iterable<? extends ExceptionHandlerFunction> exceptionHandlerFunctions,
Iterable<? extends RequestConverterFunction> requestConverterFunctions,
Iterable<? extends ResponseConverterFunction> responseConverterFunctions)
Binds the specified annotated service object under the specified path prefix.
|
ServerBuilder |
ServerBuilder.annotatedService(String pathPrefix,
Object service,
Function<? super HttpService,? extends HttpService> decorator,
Object... exceptionHandlersAndConverters)
Binds the specified annotated service object under the specified path prefix.
|
ServerBuilder |
ServerBuilder.annotatedService(String pathPrefix,
Object service,
Iterable<?> exceptionHandlersAndConverters)
Binds the specified annotated service object under the specified path prefix.
|
ServerBuilder |
ServerBuilder.annotatedService(String pathPrefix,
Object service,
Object... exceptionHandlersAndConverters)
Binds the specified annotated service object under the specified path prefix.
|
ServerBuilder |
ServerBuilder.annotatedServiceExtensions(Iterable<? extends RequestConverterFunction> requestConverterFunctions,
Iterable<? extends ResponseConverterFunction> responseConverterFunctions,
Iterable<? extends ExceptionHandlerFunction> exceptionHandlerFunctions)
Sets the
RequestConverterFunctions, ResponseConverterFunction
and ExceptionHandlerFunctions for creating an AnnotatedServiceExtensions. |
ServerBuilder |
ServerBuilder.blockingTaskExecutor(ScheduledExecutorService blockingTaskExecutor,
boolean shutdownOnStop)
Sets the
ScheduledExecutorService dedicated to the execution of blocking tasks or invocations. |
ServerBuilder |
DecoratingServiceBindingBuilder.build(DecoratingHttpServiceFunction decoratingHttpServiceFunction)
Sets the
DecoratingHttpServiceFunction and returns ServerBuilder that this
DecoratingServiceBindingBuilder was created from. |
ServerBuilder |
DecoratingServiceBindingBuilder.build(Function<? super HttpService,? extends HttpService> decorator)
Sets the
decorator and returns ServerBuilder that this
DecoratingServiceBindingBuilder was created from. |
ServerBuilder |
ServiceBindingBuilder.build(HttpService service)
Sets the
HttpService and returns the ServerBuilder that this
ServiceBindingBuilder was created from. |
ServerBuilder |
AnnotatedServiceBindingBuilder.build(Object service)
|
static ServerBuilder |
Server.builder()
Creates a new
ServerBuilder. |
<T> ServerBuilder |
ServerBuilder.channelOption(io.netty.channel.ChannelOption<T> option,
T value)
Sets the
ChannelOption of the server socket bound by Server. |
<T> ServerBuilder |
ServerBuilder.childChannelOption(io.netty.channel.ChannelOption<T> option,
T value)
Sets the
ChannelOption of sockets accepted by Server. |
ServerBuilder |
ServerBuilder.clientAddressFilter(Predicate<? super InetAddress> clientAddressFilter)
Sets a filter which evaluates whether an
InetAddress can be used as a client address. |
ServerBuilder |
ServerBuilder.clientAddressMapper(Function<? super ProxiedAddresses,? extends InetSocketAddress> clientAddressMapper)
Sets a
Function to use when determining the client address from ProxiedAddresses. |
ServerBuilder |
ServerBuilder.clientAddressSources(ClientAddressSource... clientAddressSources)
Sets a list of
ClientAddressSources which are used to determine where to look for the
client address, in the order of preference. |
ServerBuilder |
ServerBuilder.clientAddressSources(Iterable<ClientAddressSource> clientAddressSources)
Sets a list of
ClientAddressSources which are used to determine where to look for the
client address, in the order of preference. |
ServerBuilder |
ServerBuilder.clientAddressTrustedProxyFilter(Predicate<? super InetAddress> clientAddressTrustedProxyFilter)
Sets a filter which evaluates whether an
InetAddress of a remote endpoint is trusted. |
ServerBuilder |
ServerBuilder.decorator(DecoratingHttpServiceFunction decoratingHttpServiceFunction)
Decorates all
HttpServices with the specified DecoratingHttpServiceFunction. |
ServerBuilder |
ServerBuilder.decorator(Function<? super HttpService,? extends HttpService> decorator)
Decorates all
HttpServices with the specified decorator. |
ServerBuilder |
ServerBuilder.decorator(Route route,
DecoratingHttpServiceFunction decoratingHttpServiceFunction)
Decorates
HttpServices with the specified Route. |
ServerBuilder |
ServerBuilder.decorator(Route route,
Function<? super HttpService,? extends HttpService> decorator)
Decorates
HttpServices with the specified Route. |
ServerBuilder |
ServerBuilder.decorator(String pathPattern,
DecoratingHttpServiceFunction decoratingHttpServiceFunction)
|
ServerBuilder |
ServerBuilder.decorator(String pathPattern,
Function<? super HttpService,? extends HttpService> decorator)
|
ServerBuilder |
ServerBuilder.decoratorUnder(String prefix,
DecoratingHttpServiceFunction decoratingHttpServiceFunction)
Decorates
HttpServices under the specified directory. |
ServerBuilder |
ServerBuilder.decoratorUnder(String prefix,
Function<? super HttpService,? extends HttpService> decorator)
Decorates
HttpServices under the specified directory. |
ServerBuilder |
ServerBuilder.defaultHostname(String defaultHostname)
Sets the default hostname of the default
VirtualHostBuilder. |
ServerBuilder |
ServerBuilder.defaultMaxRequestLength(long maxRequestLength)
Deprecated.
|
ServerBuilder |
ServerBuilder.defaultRequestTimeout(Duration requestTimeout)
Deprecated.
|
ServerBuilder |
ServerBuilder.defaultRequestTimeoutMillis(long requestTimeoutMillis)
Deprecated.
|
ServerBuilder |
ServerBuilder.disableDateHeader()
Sets the response header not to include default
"Date" header. |
ServerBuilder |
ServerBuilder.disableServerHeader()
Sets the response header not to include default
"Server" header. |
ServerBuilder |
ServerBuilder.gracefulShutdownTimeout(Duration quietPeriod,
Duration timeout)
Sets the amount of time to wait after calling
Server.stop() for
requests to go away before actually shutting down. |
ServerBuilder |
ServerBuilder.gracefulShutdownTimeout(long quietPeriodMillis,
long timeoutMillis)
Deprecated.
|
ServerBuilder |
ServerBuilder.gracefulShutdownTimeoutMillis(long quietPeriodMillis,
long timeoutMillis)
Sets the amount of time to wait after calling
Server.stop() for
requests to go away before actually shutting down. |
ServerBuilder |
ServerBuilder.http(InetSocketAddress localAddress)
Adds an HTTP port that listens to the specified
localAddress. |
ServerBuilder |
ServerBuilder.http(int port)
Adds an HTTP port that listens on all available network interfaces.
|
ServerBuilder |
ServerBuilder.http1MaxChunkSize(int http1MaxChunkSize)
Sets the maximum length of each chunk in an HTTP/1 response content.
|
ServerBuilder |
ServerBuilder.http1MaxHeaderSize(int http1MaxHeaderSize)
Sets the maximum length of all headers in an HTTP/1 response.
|
ServerBuilder |
ServerBuilder.http1MaxInitialLineLength(int http1MaxInitialLineLength)
Sets the maximum length of an HTTP/1 response initial line.
|
ServerBuilder |
ServerBuilder.http2InitialConnectionWindowSize(int http2InitialConnectionWindowSize)
Sets the initial connection-level HTTP/2 flow control window size.
|
ServerBuilder |
ServerBuilder.http2InitialStreamWindowSize(int http2InitialStreamWindowSize)
Sets the initial stream-level HTTP/2 flow control window size.
|
ServerBuilder |
ServerBuilder.http2MaxFrameSize(int http2MaxFrameSize)
Sets the maximum size of HTTP/2 frame that can be received.
|
ServerBuilder |
ServerBuilder.http2MaxHeaderListSize(long http2MaxHeaderListSize)
Sets the maximum size of headers that can be received.
|
ServerBuilder |
ServerBuilder.http2MaxStreamsPerConnection(long http2MaxStreamsPerConnection)
Sets the maximum number of concurrent streams per HTTP/2 connection.
|
ServerBuilder |
ServerBuilder.https(InetSocketAddress localAddress)
Adds an HTTPS port that listens to the specified
localAddress. |
ServerBuilder |
ServerBuilder.https(int port)
Adds an HTTPS port that listens on all available network interfaces.
|
ServerBuilder |
ServerBuilder.idleTimeout(Duration idleTimeout)
Sets the idle timeout of a connection for keep-alive.
|
ServerBuilder |
ServerBuilder.idleTimeoutMillis(long idleTimeoutMillis)
Sets the idle timeout of a connection in milliseconds for keep-alive.
|
ServerBuilder |
ServerBuilder.maxNumConnections(int maxNumConnections)
Sets the maximum allowed number of open connections.
|
ServerBuilder |
ServerBuilder.maxRequestLength(long maxRequestLength)
Sets the maximum allowed length of the content decoded at the session layer.
|
ServerBuilder |
ServerBuilder.meterRegistry(MeterRegistry meterRegistry)
Sets the
MeterRegistry that collects various stats. |
ServerBuilder |
ServerBuilder.port(InetSocketAddress localAddress,
Iterable<SessionProtocol> protocols)
Adds a new
ServerPort that listens to the specified localAddress using the specified
SessionProtocols. |
ServerBuilder |
ServerBuilder.port(InetSocketAddress localAddress,
SessionProtocol... protocols)
Adds a new
ServerPort that listens to the specified localAddress using the specified
SessionProtocols. |
ServerBuilder |
ServerBuilder.port(InetSocketAddress localAddress,
String protocol)
Deprecated.
|
ServerBuilder |
ServerBuilder.port(int port,
Iterable<SessionProtocol> protocols)
Adds a new
ServerPort that listens to the specified port of all available network
interfaces using the specified SessionProtocols. |
ServerBuilder |
ServerBuilder.port(int port,
SessionProtocol... protocols)
Adds a new
ServerPort that listens to the specified port of all available network
interfaces using the specified SessionProtocols. |
ServerBuilder |
ServerBuilder.port(int port,
String protocol)
Deprecated.
Use
http(int) or https(int). |
ServerBuilder |
ServerBuilder.port(ServerPort port)
Adds the specified
ServerPort. |
ServerBuilder |
ServerBuilder.proxyProtocolMaxTlvSize(int proxyProtocolMaxTlvSize)
Sets the maximum size of additional data for PROXY protocol.
|
ServerBuilder |
ServerBuilder.rejectedRouteHandler(RejectedRouteHandler handler)
Sets the
RejectedRouteHandler which will be invoked when an attempt to bind
an HttpService at a certain Route is rejected. |
ServerBuilder |
ServerBuilder.requestIdGenerator(Supplier<? extends RequestId> requestIdGenerator)
|
ServerBuilder |
ServerBuilder.requestTimeout(Duration requestTimeout)
Sets the timeout of a request.
|
ServerBuilder |
ServerBuilder.requestTimeoutMillis(long requestTimeoutMillis)
Sets the timeout of a request in milliseconds.
|
ServerBuilder |
ServerBuilder.serverListener(ServerListener serverListener)
Adds the specified
ServerListener. |
ServerBuilder |
ServerBuilder.service(HttpServiceWithRoutes serviceWithRoutes,
Function<? super HttpService,? extends HttpService>... decorators)
Decorates and binds the specified
HttpServiceWithRoutes at multiple Routes
of the default VirtualHost. |
ServerBuilder |
ServerBuilder.service(HttpServiceWithRoutes serviceWithRoutes,
Iterable<? extends Function<? super HttpService,? extends HttpService>> decorators)
Decorates and binds the specified
HttpServiceWithRoutes at multiple Routes
of the default VirtualHost. |
ServerBuilder |
ServerBuilder.service(Route route,
HttpService service)
|
ServerBuilder |
ServerBuilder.service(String pathPattern,
HttpService service)
Binds the specified
HttpService at the specified path pattern of the default VirtualHost. |
ServerBuilder |
ServerBuilder.serviceAt(String pathPattern,
HttpService service)
Deprecated.
Use
service(String, HttpService) instead. |
ServerBuilder |
ServerBuilder.serviceUnder(String pathPrefix,
HttpService service)
Binds the specified
HttpService under the specified directory of the default VirtualHost. |
ServerBuilder |
ServerBuilder.startStopExecutor(Executor startStopExecutor)
Sets the
Executor which will invoke the callbacks of Server.start(),
Server.stop() and ServerListener. |
ServerBuilder |
ServerBuilder.tls(File keyCertChainFile,
File keyFile)
|
ServerBuilder |
ServerBuilder.tls(File keyCertChainFile,
File keyFile,
Consumer<io.netty.handler.ssl.SslContextBuilder> tlsCustomizer)
Deprecated.
Use
tls(File, File) and tlsCustomizer(Consumer). |
ServerBuilder |
ServerBuilder.tls(File keyCertChainFile,
File keyFile,
String keyPassword)
|
ServerBuilder |
ServerBuilder.tls(File keyCertChainFile,
File keyFile,
String keyPassword,
Consumer<io.netty.handler.ssl.SslContextBuilder> tlsCustomizer)
Deprecated.
|
ServerBuilder |
ServerBuilder.tls(InputStream keyCertChainInputStream,
InputStream keyInputStream)
Configures SSL or TLS of this
Server with the specified keyCertChainInputStream and
cleartext keyInputStream. |
ServerBuilder |
ServerBuilder.tls(InputStream keyCertChainInputStream,
InputStream keyInputStream,
String keyPassword)
Configures SSL or TLS of this
Server with the specified keyCertChainInputStream,
keyInputStream and keyPassword. |
ServerBuilder |
ServerBuilder.tls(KeyManagerFactory keyManagerFactory)
Configures SSL or TLS of this
Server with the specified KeyManagerFactory. |
ServerBuilder |
ServerBuilder.tls(KeyManagerFactory keyManagerFactory,
Consumer<io.netty.handler.ssl.SslContextBuilder> tlsCustomizer)
Deprecated.
|
ServerBuilder |
ServerBuilder.tls(PrivateKey key,
Iterable<? extends X509Certificate> keyCertChain)
Configures SSL or TLS of this
Server with the specified cleartext PrivateKey and
X509Certificate chain. |
ServerBuilder |
ServerBuilder.tls(PrivateKey key,
String keyPassword,
Iterable<? extends X509Certificate> keyCertChain)
Configures SSL or TLS of this
Server with the specified PrivateKey, keyPassword
and X509Certificate chain. |
ServerBuilder |
ServerBuilder.tls(PrivateKey key,
String keyPassword,
X509Certificate... keyCertChain)
Configures SSL or TLS of this
Server with the specified PrivateKey, keyPassword
and X509Certificate chain. |
ServerBuilder |
ServerBuilder.tls(PrivateKey key,
X509Certificate... keyCertChain)
Configures SSL or TLS of this
Server with the specified cleartext PrivateKey and
X509Certificate chain. |
ServerBuilder |
ServerBuilder.tls(io.netty.handler.ssl.SslContext sslContext)
Deprecated.
This method has been deprecated because an incorrectly built
SslContext can cause
a Server to malfunction. Use other tls() methods. |
ServerBuilder |
ServerBuilder.tlsCustomizer(Consumer<? super io.netty.handler.ssl.SslContextBuilder> tlsCustomizer)
Adds the
Consumer which can arbitrarily configure the SslContextBuilder that will be
applied to the SSL session. |
ServerBuilder |
ServerBuilder.tlsSelfSigned()
Configures SSL or TLS of the
Server with an auto-generated self-signed certificate. |
ServerBuilder |
ServerBuilder.tlsSelfSigned(boolean tlsSelfSigned)
Configures SSL or TLS of the
Server with an auto-generated self-signed certificate. |
ServerBuilder |
ServerBuilder.verboseResponses(boolean verboseResponses)
Sets whether the verbose response mode is enabled.
|
ServerBuilder |
ServerBuilder.withDefaultVirtualHost(Consumer<? super VirtualHostBuilder> customizer)
Configures the default
VirtualHost with the customizer. |
ServerBuilder |
ServerBuilder.withRoute(Consumer<? super ServiceBindingBuilder> customizer)
|
ServerBuilder |
ServerBuilder.withVirtualHost(Consumer<? super VirtualHostBuilder> customizer)
Configures a
VirtualHost with the customizer. |
ServerBuilder |
ServerBuilder.workerGroup(io.netty.channel.EventLoopGroup workerGroup,
boolean shutdownOnStop)
Sets the worker
EventLoopGroup which is responsible for performing socket I/O and running
Service.serve(ServiceRequestContext, Request). |
| Modifier and Type | Method and Description |
|---|---|
ServiceRequestContextBuilder |
ServiceRequestContextBuilder.serverConfigurator(Consumer<? super ServerBuilder> serverConfigurator)
Adds the
Consumer that configures the given ServerBuilder. |
Copyright © 2020 LeanCloud. All rights reserved.