public static interface ServerConfig.Builder
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_ENV_PREFIX |
static String |
DEFAULT_PROP_PREFIX |
static String |
DEFAULT_PROPERTIES_FILE_NAME |
Modifier and Type | Method and Description |
---|---|
ServerConfig.Builder |
address(InetAddress address)
Sets the address to bind to.
|
ServerConfig |
build() |
ServerConfig.Builder |
compressionBlackListMimeTypes(List<String> mimeTypes)
Adds the given values as non-compressible mime types.
|
ServerConfig.Builder |
compressionBlackListMimeTypes(String... mimeTypes)
Adds the given values as non-compressible mime types.
|
ServerConfig.Builder |
compressionMinSize(long compressionMinSize)
The minimum size at which responses should be compressed, in bytes.
|
ServerConfig.Builder |
compressionWhiteListMimeTypes(List<String> mimeTypes)
Adds the given values as compressible mime types.
|
ServerConfig.Builder |
compressionWhiteListMimeTypes(String... mimeTypes)
Adds the given values as compressible mime types.
|
ServerConfig.Builder |
compressResponses(boolean compressResponses)
Whether to compress responses.
|
ServerConfig.Builder |
development(boolean development)
Whether or not the application is "development".
|
ServerConfig.Builder |
env()
Adds a configuration source for environment variables starting with the prefix .
|
ServerConfig.Builder |
env(String prefix)
Adds a configuration source for environment variables starting with the specified prefix.
|
ServerConfig.Builder |
indexFiles(List<String> indexFiles)
Adds the given values as potential index file names.
|
ServerConfig.Builder |
indexFiles(String... indexFiles)
Adds the given values as potential index file names.
|
ServerConfig.Builder |
maxContentLength(int maxContentLength)
The max number of bytes a request body can be.
|
ServerConfig.Builder |
port(int port) |
ServerConfig.Builder |
props(ByteSource byteSource)
Adds a configuration source for a properties file.
|
ServerConfig.Builder |
props(Map<String,String> map)
Adds a configuration source for a Map (flat key-value pairs).
|
ServerConfig.Builder |
props(Path path)
Adds a configuration source for a properties file.
|
ServerConfig.Builder |
props(Properties properties)
Adds a configuration source for a properties object.
|
ServerConfig.Builder |
props(String path)
Adds a configuration source for a properties file.
|
ServerConfig.Builder |
props(URL url)
Adds a configuration source for a properties file.
|
ServerConfig.Builder |
publicAddress(URI publicAddress)
The public address of the application.
|
ServerConfig.Builder |
ssl(SSLContext sslContext)
The SSL context to use if the application serves content over HTTPS.
|
ServerConfig.Builder |
sysProps()
Adds a configuration source for system properties starting with the prefix
|
ServerConfig.Builder |
sysProps(String prefix)
Adds a configuration source for system properties starting with the specified prefix.
|
ServerConfig.Builder |
threads(int threads)
The number of threads to use.
|
ServerConfig.Builder |
timeResponses(boolean timeResponses)
Whether to time responses.
|
static final String DEFAULT_ENV_PREFIX
static final String DEFAULT_PROP_PREFIX
static final String DEFAULT_PROPERTIES_FILE_NAME
ServerConfig.Builder port(int port)
ServerConfig.Builder address(InetAddress address)
Default value is null
.
address
- The address to bind toServerConfig.getAddress()
ServerConfig.Builder development(boolean development)
Default value is false
.
development
- Whether or not the application is "development".ServerConfig.isDevelopment()
ServerConfig.Builder threads(int threads)
Defaults to ServerConfig.DEFAULT_THREADS
threads
- the size of the event loop thread poolServerConfig.getThreads()
ServerConfig.Builder publicAddress(URI publicAddress)
Default value is null
.
publicAddress
- The public address of the applicationServerConfig.getPublicAddress()
ServerConfig.Builder maxContentLength(int maxContentLength)
1048576
(1 megabyte).maxContentLength
- The max content length to accept.ServerConfig.getMaxContentLength()
ServerConfig.Builder timeResponses(boolean timeResponses)
false
.timeResponses
- Whether to time responsesServerConfig.isTimeResponses()
ServerConfig.Builder compressResponses(boolean compressResponses)
false
.compressResponses
- Whether to compress responsesServerConfig.isCompressResponses()
ServerConfig.Builder compressionMinSize(long compressionMinSize)
compressionMinSize
- The minimum size at which responses should be compressed, in bytesServerConfig.getCompressionMinSize()
ServerConfig.Builder compressionWhiteListMimeTypes(String... mimeTypes)
mimeTypes
- the compressible mime types.ServerConfig.getCompressionMimeTypeWhiteList()
ServerConfig.Builder compressionWhiteListMimeTypes(List<String> mimeTypes)
mimeTypes
- the compressible mime types.ServerConfig.getCompressionMimeTypeWhiteList()
ServerConfig.Builder compressionBlackListMimeTypes(String... mimeTypes)
mimeTypes
- the non-compressible mime types.ServerConfig.getCompressionMimeTypeBlackList()
ServerConfig.Builder compressionBlackListMimeTypes(List<String> mimeTypes)
mimeTypes
- the non-compressible mime types.ServerConfig.getCompressionMimeTypeBlackList()
ServerConfig.Builder indexFiles(String... indexFiles)
indexFiles
- the potential index file names.ServerConfig.getIndexFiles()
ServerConfig.Builder indexFiles(List<String> indexFiles)
indexFiles
- the potential index file names.ServerConfig.getIndexFiles()
ServerConfig.Builder ssl(SSLContext sslContext)
sslContext
- the SSL context.SSLContexts
,
ServerConfig.getSSLContext()
ServerConfig.Builder env()
ServerConfig.Builder env(String prefix)
prefix
- the prefix which should be used to identify relevant environment variables;
the prefix will be removed before loading the dataServerConfig.Builder props(ByteSource byteSource)
byteSource
- the source of the properties dataServerConfig.Builder props(String path)
path
- the source of the properties dataServerConfig.Builder props(Path path)
path
- the source of the properties dataServerConfig.Builder props(Properties properties)
properties
- the properties objectServerConfig.Builder props(Map<String,String> map)
map
- the mapServerConfig.Builder props(URL url)
url
- the source of the properties dataServerConfig.Builder sysProps()
ServerConfig.Builder sysProps(String prefix)
prefix
- the prefix which should be used to identify relevant system properties;
the prefix will be removed before loading the dataServerConfig build()