@ConfigurationProperties(value="micronaut.server", cliPrefix="") public class HttpServerConfiguration extends Object
A base ConfigurationProperties for servers.
| Modifier and Type | Class and Description | 
|---|---|
| static class  | HttpServerConfiguration.CorsConfigurationConfiguration for CORS. | 
| static class  | HttpServerConfiguration.HostResolutionConfigurationConfiguration for host resolution with the  HttpHostResolver. | 
| static class  | HttpServerConfiguration.MultipartConfigurationConfiguration for multipart handling. | 
| Modifier and Type | Field and Description | 
|---|---|
| static boolean | DEFAULT_DATEHEADERThe default date header. | 
| static long | DEFAULT_IDLE_TIME_MINUTESThe default idle time. | 
| static boolean | DEFAULT_LOG_HANDLED_EXCEPTIONSThe default value for log handled exceptions. | 
| static long | DEFAULT_MAX_REQUEST_SIZEThe default max request size. | 
| static int | DEFAULT_PORTThe default port value. | 
| static int | DEFAULT_RANDOM_PORTThe default value random port. | 
| static long | DEFAULT_READ_IDLE_TIME_MINUTESThe default read idle time in minutes. | 
| static long | DEFAULT_WRITE_IDLE_TIME_MINUTESThe default write idle time in minutes. | 
| static String | PREFIXThe prefix used for configuration. | 
| Constructor and Description | 
|---|
| HttpServerConfiguration()Default constructor. | 
| HttpServerConfiguration(ApplicationConfiguration applicationConfiguration) | 
| Modifier and Type | Method and Description | 
|---|---|
| ApplicationConfiguration | getApplicationConfiguration() | 
| String | getClientAddressHeader() | 
| String | getContextPath() | 
| HttpServerConfiguration.CorsConfiguration | getCors() | 
| Charset | getDefaultCharset() | 
| Optional<String> | getHost() | 
| HttpServerConfiguration.HostResolutionConfiguration | getHostResolution() | 
| Duration | getIdleTimeout() | 
| long | getMaxRequestSize() | 
| HttpServerConfiguration.MultipartConfiguration | getMultipart() | 
| Optional<Integer> | getPort() | 
| Duration | getReadIdleTimeout() | 
| Optional<Integer> | getReadTimeout() | 
| Optional<String> | getServerHeader() | 
| Duration | getWriteIdleTimeout() | 
| boolean | isDateHeader() | 
| boolean | isLogHandledExceptions() | 
| void | setClientAddressHeader(String clientAddressHeader) | 
| void | setContextPath(String contextPath)Sets the context path for the web server. | 
| void | setCors(HttpServerConfiguration.CorsConfiguration cors)Sets the cors configuration. | 
| void | setDateHeader(boolean dateHeader)Sets whether a date header should be sent back. | 
| void | setDefaultCharset(Charset defaultCharset) | 
| void | setHost(String host)Sets the host to bind to. | 
| void | setHostResolution(HttpServerConfiguration.HostResolutionConfiguration hostResolution) | 
| void | setIdleTimeout(Duration idleTimeout)Sets the idle time of connections for the server. | 
| void | setLogHandledExceptions(boolean logHandledExceptions)Sets whether exceptions handled by either an error route or exception handler
 should still be logged. | 
| void | setMaxRequestSize(long maxRequestSize)Sets the maximum request size. | 
| void | setMultipart(HttpServerConfiguration.MultipartConfiguration multipart)Sets the multipart configuration. | 
| void | setPort(int port)Sets the port to bind to. | 
| void | setReadIdleTimeout(Duration readIdleTimeout)Sets the amount of time a connection can remain idle without any reads occurring. | 
| void | setReadTimeout(Integer readTimeout)Sets the default read timeout. | 
| void | setServerHeader(String serverHeader)Sets the name of the server header. | 
| void | setWriteIdleTimeout(Duration writeIdleTimeout)Sets the amount of time a connection can remain idle without any writes occurring. | 
public static final int DEFAULT_PORT
public static final String PREFIX
public static final int DEFAULT_RANDOM_PORT
public static final long DEFAULT_MAX_REQUEST_SIZE
public static final long DEFAULT_READ_IDLE_TIME_MINUTES
public static final long DEFAULT_WRITE_IDLE_TIME_MINUTES
public static final boolean DEFAULT_DATEHEADER
public static final long DEFAULT_IDLE_TIME_MINUTES
public static final boolean DEFAULT_LOG_HANDLED_EXCEPTIONS
public HttpServerConfiguration()
@Inject public HttpServerConfiguration(ApplicationConfiguration applicationConfiguration)
applicationConfiguration - The application configurationpublic ApplicationConfiguration getApplicationConfiguration()
public Charset getDefaultCharset()
public Optional<Integer> getReadTimeout()
public HttpServerConfiguration.MultipartConfiguration getMultipart()
public HttpServerConfiguration.CorsConfiguration getCors()
public long getMaxRequestSize()
public Duration getReadIdleTimeout()
public Duration getWriteIdleTimeout()
public Duration getIdleTimeout()
public boolean isDateHeader()
public boolean isLogHandledExceptions()
@Nullable public HttpServerConfiguration.HostResolutionConfiguration getHostResolution()
public String getClientAddressHeader()
public String getContextPath()
public void setDefaultCharset(Charset defaultCharset)
defaultCharset - The default charset to usepublic void setPort(int port)
port - The portpublic void setHost(String host)
host - The hostpublic void setReadTimeout(Integer readTimeout)
readTimeout - The read timeoutpublic void setServerHeader(String serverHeader)
serverHeader - The server headerpublic void setMaxRequestSize(@ReadableBytes long maxRequestSize)
maxRequestSize - The max request sizepublic void setReadIdleTimeout(Duration readIdleTimeout)
readIdleTimeout - The read idle timepublic void setWriteIdleTimeout(Duration writeIdleTimeout)
writeIdleTimeout - The write idle timepublic void setIdleTimeout(Duration idleTimeout)
idleTimeout - The idle timepublic void setMultipart(HttpServerConfiguration.MultipartConfiguration multipart)
multipart - The multipart configurationpublic void setCors(HttpServerConfiguration.CorsConfiguration cors)
cors - The cors configurationpublic void setDateHeader(boolean dateHeader)
dateHeader - True if a date header should be sent.public void setLogHandledExceptions(boolean logHandledExceptions)
logHandledExceptions - True if exceptions should be loggedpublic void setHostResolution(HttpServerConfiguration.HostResolutionConfiguration hostResolution)
hostResolution - The host resolution configurationpublic void setClientAddressHeader(String clientAddressHeader)
clientAddressHeader - The header that stores the original client addresspublic void setContextPath(String contextPath)
contextPath - the context path for the web server