Package com.linecorp.armeria.server
Class VirtualHost
java.lang.Object
com.linecorp.armeria.server.VirtualHost
A name-based virtual host.
A
VirtualHost
contains the following information:
- the hostname pattern, as defined in the section 3.1 of RFC2818
SslContext
if TLS is enabled- the list of available
HttpService
s and theirRoute
s
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns theLogger
which is used for writing access logs of this virtual host.Returns the access log writer.Returns the blocking task executor.Returns the default hostname of this virtual host.Returns a default naming rule for the name of services.findServiceConfig
(RoutingContext routingCtx) findServiceConfig
(RoutingContext routingCtx, boolean useFallbackService) Returns the hostname pattern of this virtual host, as defined in the section 3.1 of RFC2818.long
Returns the maximum allowed length of the content decoded at the session layer.int
port()
Returns the port of this virtual host.long
Returns the timeout of a request.server()
Returns theServer
where thisVirtualHost
belongs to.Returns the information about theHttpService
s bound to this virtual host.boolean
Tells whether theAccessLogWriter
is shut down when theServer
stops.boolean
Returns theSslContext
of this virtual host.toString()
boolean
Returns whether the verbose response mode is enabled.
-
Method Details
-
server
Returns theServer
where thisVirtualHost
belongs to. -
defaultHostname
Returns the default hostname of this virtual host. -
hostnamePattern
Returns the hostname pattern of this virtual host, as defined in the section 3.1 of RFC2818. -
port
public int port()Returns the port of this virtual host.-1
means that no port number is specified. -
sslContext
Returns theSslContext
of this virtual host. -
serviceConfigs
Returns the information about theHttpService
s bound to this virtual host. -
accessLogger
Returns theLogger
which is used for writing access logs of this virtual host. -
defaultServiceNaming
Returns a default naming rule for the name of services.- See Also:
-
requestTimeoutMillis
public long requestTimeoutMillis()Returns the timeout of a request.- See Also:
-
maxRequestLength
public long maxRequestLength()Returns the maximum allowed length of the content decoded at the session layer. e.g. the content length of an HTTP request.- See Also:
-
verboseResponses
public boolean verboseResponses()Returns whether the verbose response mode is enabled. When enabled, the server responses will contain the exception type and its full stack trace, which may be useful for debugging while potentially insecure. When disabled, the server responses will not expose such server-side details to the client.- See Also:
-
accessLogWriter
Returns the access log writer.- See Also:
-
shutdownAccessLogWriterOnStop
public boolean shutdownAccessLogWriterOnStop()Tells whether theAccessLogWriter
is shut down when theServer
stops. -
blockingTaskExecutor
Returns the blocking task executor.- See Also:
-
shutdownBlockingTaskExecutorOnStop
public boolean shutdownBlockingTaskExecutorOnStop() -
findServiceConfig
- Parameters:
routingCtx
- a context to find theHttpService
.- Returns:
- the
ServiceConfig
wrapped by aRouted
if there's a match.Routed.empty()
if there's no match.
-
findServiceConfig
public Routed<ServiceConfig> findServiceConfig(RoutingContext routingCtx, boolean useFallbackService) - Parameters:
routingCtx
- a context to find theHttpService
.useFallbackService
- whether to use the fallbackHttpService
when there is no match. Iftrue
, the returnedRouted
will always be present.- Returns:
- the
ServiceConfig
wrapped by aRouted
if there's a match.Routed.empty()
if there's no match.
-
toString
-