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
SslContextif TLS is enabled- the list of available
HttpServices and theirRoutes
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns theLoggerwhich 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.longReturns the maximum allowed length of the content decoded at the session layer.Returns theMultipartRemovalStrategythat specifies when to remove the temporary files created for multipart requests.Returns thePaththat is used to store the files uploaded through amultipart/form-datarequest.intport()Returns the port of this virtual host.longReturns the amount of time to wait before aborting anHttpRequestwhen its correspondingHttpResponseis complete.longReturns the timeout of a request.server()Returns theServerwhere thisVirtualHostbelongs to.Returns the information about theHttpServices bound to this virtual host.Returns the serviceEventLoopGroup.booleanDeprecated.This method is not used anymore.booleanDeprecated.This method is not used anymore.Returns theSslContextof this virtual host.Returns theSuccessFunctionthat determines whether a request was handled successfully or not.Returns theTlsEngineTypeof this virtual host.toString()booleanReturns whether the verbose response mode is enabled.
-
Method Details
-
server
Returns theServerwhere thisVirtualHostbelongs 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.-1means that no port number is specified. -
sslContext
Returns theSslContextof this virtual host. -
tlsEngineType
Returns theTlsEngineTypeof this virtual host. -
serviceConfigs
Returns the information about theHttpServices bound to this virtual host. -
accessLogger
Returns theLoggerwhich 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. TheAccessLogWriteris shut down if theshutdownOnStopofVirtualHostBuilder.accessLogWriter(AccessLogWriter, boolean)is set totrue.Tells whether theAccessLogWriteris shut down when theServerstops. -
blockingTaskExecutor
Returns the blocking task executor.- See Also:
-
shutdownBlockingTaskExecutorOnStop
Deprecated.This method is not used anymore. TheblockingTaskExecutoris shut down if theshutdownOnStopofVirtualHostBuilder.blockingTaskExecutor(ScheduledExecutorService, boolean)is set totrue. -
serviceWorkerGroup
Returns the serviceEventLoopGroup.- See Also:
-
successFunction
Returns theSuccessFunctionthat determines whether a request was handled successfully or not. -
requestIdGenerator
-
findServiceConfig
- Parameters:
routingCtx- a context to find theHttpService.- Returns:
- the
ServiceConfigwrapped by aRoutedif 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 fallbackHttpServicewhen there is no match. Iftrue, the returnedRoutedwill always be present.- Returns:
- the
ServiceConfigwrapped by aRoutedif there's a match. The fallbackServiceConfigwrapped byRoutedif there's no match anduseFallbackServiceistrue.Routed.empty()if there's no match anduseFallbackServiceisfalse.
-
requestAutoAbortDelayMillis
public long requestAutoAbortDelayMillis()Returns the amount of time to wait before aborting anHttpRequestwhen its correspondingHttpResponseis complete. -
multipartUploadsLocation
Returns thePaththat is used to store the files uploaded through amultipart/form-datarequest. -
multipartRemovalStrategy
Returns theMultipartRemovalStrategythat specifies when to remove the temporary files created for multipart requests. -
toString
-