Package com.linecorp.armeria.server
Class VirtualHost
java.lang.Object
com.linecorp.armeria.server.VirtualHost
public final class VirtualHost extends Object
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:
VirtualHostBuilder
-
Method Summary
Modifier and Type Method Description Logger
accessLogger()
Returns theLogger
which is used for writing access logs of this virtual host.AccessLogWriter
accessLogWriter()
Returns the access log writer.String
defaultHostname()
Returns the default hostname of this virtual host.Routed<ServiceConfig>
findServiceConfig(RoutingContext routingCtx)
Routed<ServiceConfig>
findServiceConfig(RoutingContext routingCtx, boolean useFallbackService)
String
hostnamePattern()
Returns the hostname pattern of this virtual host, as defined in the section 3.1 of RFC2818.long
maxRequestLength()
Returns the maximum allowed length of the content decoded at the session layer.long
requestTimeoutMillis()
Returns the timeout of a request.Server
server()
Returns theServer
where thisVirtualHost
belongs to.List<ServiceConfig>
serviceConfigs()
Returns the information about theHttpService
s bound to this virtual host.boolean
shutdownAccessLogWriterOnStop()
Tells whether theAccessLogWriter
is shut down when theServer
stops.SslContext
sslContext()
Returns theSslContext
of this virtual host.String
toString()
boolean
verboseResponses()
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. -
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. -
requestTimeoutMillis
public long requestTimeoutMillis()Returns the timeout of a request.- See Also:
ServiceConfig.requestTimeoutMillis()
-
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:
ServiceConfig.maxRequestLength()
-
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:
ServiceConfig.verboseResponses()
-
accessLogWriter
Returns the access log writer.- See Also:
ServiceConfig.accessLogWriter()
-
shutdownAccessLogWriterOnStop
public boolean shutdownAccessLogWriterOnStop()Tells whether theAccessLogWriter
is shut down when theServer
stops. -
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
-