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 the default value of theRequestOnlyLog.name()
property which is used when no name was set viaRequestLogBuilder.name(String, String)
.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.Returns thePath
that is used to store the files uploaded through amultipart/form-data
request.int
port()
Returns the port of this virtual host.long
Returns the amount of time to wait before aborting anHttpRequest
when its correspondingHttpResponse
is complete.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
Deprecated.This method is not used anymore.boolean
Deprecated.This method is not used anymore.Returns theSslContext
of this virtual host.Returns theSuccessFunction
that determines whether a request was handled successfully or not.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:
-
defaultLogName
Returns the default value of theRequestOnlyLog.name()
property which is used when no name was set viaRequestLogBuilder.name(String, String)
. -
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
Deprecated.This method is not used anymore. TheAccessLogWriter
is shut down if theshutdownOnStop
ofVirtualHostBuilder.accessLogWriter(AccessLogWriter, boolean)
is set totrue
.Tells whether theAccessLogWriter
is shut down when theServer
stops. -
blockingTaskExecutor
Returns the blocking task executor.- See Also:
-
shutdownBlockingTaskExecutorOnStop
Deprecated.This method is not used anymore. TheblockingTaskExecutor
is shut down if theshutdownOnStop
ofVirtualHostBuilder.blockingTaskExecutor(ScheduledExecutorService, boolean)
is set totrue
. -
successFunction
Returns theSuccessFunction
that determines whether a request was handled successfully or not. -
requestIdGenerator
-
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. The fallbackServiceConfig
wrapped byRouted
if there's no match anduseFallbackService
istrue
.Routed.empty()
if there's no match anduseFallbackService
isfalse
.
-
requestAutoAbortDelayMillis
public long requestAutoAbortDelayMillis()Returns the amount of time to wait before aborting anHttpRequest
when its correspondingHttpResponse
is complete. -
multipartUploadsLocation
Returns thePath
that is used to store the files uploaded through amultipart/form-data
request. -
toString
-