Class DefaultSmallJettyConfiguration
java.lang.Object
com.blackrook.small.jetty.DefaultSmallJettyConfiguration
- All Implemented Interfaces:
SmallJettyConfiguration, com.blackrook.small.SmallConfiguration
Configuration builder for the Jetty bootstrap.
Defaults:
- serverPort: 8080
- secureServerPort: null
- contextPath: "/"
- tempPath: null
- servletPaths: ["/*"]
- applicationPackageRoots: [ ]
- allowOptions: false
- allowTrace: false
- allowWebSockets: true
- autoParseMultipart: true
- attributes: NONE
- maxThreads: 20
- idleConnectionTimeout: 30000
- headerCacheSize: 8192
- outputBufferSize: 32768
- requestHeaderSize: 8192
- responseHeaderSize: 8192
- sendServerVersion: false
- sendDateHeader: false
- sendXPoweredBy: false
- servletContextOptions: 0
- sslConfiguration: null
- gzipConfiguration: null
- Author:
- Matthew Tropiano
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from interface SmallJettyConfiguration
SmallJettyConfiguration.GZipConfiguration, SmallJettyConfiguration.SSLConfiguration -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbooleanbooleanString[]<T> TgetAttribute(String attributeName, T def) intintintintintintbooleanbooleanbooleanintintString[]setAllowOptions(boolean value) setAllowTrace(boolean value) setAllowWebSockets(boolean value) setApplicationPackageRoots(String... value) setAttribute(String attributeName, Object value) setAutoParseMultipart(boolean value) setContextPath(String value) Sets the GZip handler configuration for this application.setHeaderCacheSize(int value) setIdleConnectionTimeout(int value) setMaxThreads(int value) setOutputBufferSize(int value) setRequestHeaderSize(int value) setResponseHeaderSize(int value) setSecureServerPort(Integer value) setSendDateHeader(boolean value) setSendServerVersion(boolean value) setSendXPoweredBy(boolean value) setServerPort(int value) setServletPaths(String... value) setTempPath(String value) Sets the HTTPS port and the keystore/truststore file and password.Sets the HTTPS port and the keystore/truststore file and password.useSSL(int port, String keyStorePath, String keyStorePassword, String trustStorePath, String trustStorePassword) Sets the HTTPS port and the keystore/truststore file and password.useSSL(int port, String keyStoreType, String keyStorePath, String keyStorePassword, String trustStoreType, String trustStorePath, String trustStorePassword) Sets the HTTPS port and the keystore/truststore file and password.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.blackrook.small.SmallConfiguration
getAttribute
-
Method Details
-
configure
- Returns:
- a new configuration builder.
-
getServerPort
public int getServerPort()- Specified by:
getServerPortin interfacecom.blackrook.small.SmallConfiguration
-
getSecureServerPort
- Specified by:
getSecureServerPortin interfacecom.blackrook.small.SmallConfiguration
-
getContextPath
- Specified by:
getContextPathin interfacecom.blackrook.small.SmallConfiguration
-
getTempPath
- Specified by:
getTempPathin interfacecom.blackrook.small.SmallConfiguration
-
getServletPaths
- Specified by:
getServletPathsin interfacecom.blackrook.small.SmallConfiguration
-
getApplicationPackageRoots
- Specified by:
getApplicationPackageRootsin interfacecom.blackrook.small.SmallConfiguration
-
allowOptions
public boolean allowOptions()- Specified by:
allowOptionsin interfacecom.blackrook.small.SmallConfiguration
-
allowTrace
public boolean allowTrace()- Specified by:
allowTracein interfacecom.blackrook.small.SmallConfiguration
-
allowWebSockets
public boolean allowWebSockets()- Specified by:
allowWebSocketsin interfacecom.blackrook.small.SmallConfiguration
-
autoParseMultipart
public boolean autoParseMultipart()- Specified by:
autoParseMultipartin interfacecom.blackrook.small.SmallConfiguration
-
getMaxThreads
public int getMaxThreads()- Specified by:
getMaxThreadsin interfaceSmallJettyConfiguration- Returns:
- the maximum amount of connector threads.
-
getIdleConnectionTimeout
public int getIdleConnectionTimeout()- Specified by:
getIdleConnectionTimeoutin interfaceSmallJettyConfiguration- Returns:
- the amount of time in milliseconds before an open HTTP connection times out.
-
getHeaderCacheSize
public int getHeaderCacheSize()- Specified by:
getHeaderCacheSizein interfaceSmallJettyConfiguration- Returns:
- the header cache size in bytes.
-
getOutputBufferSize
public int getOutputBufferSize()- Specified by:
getOutputBufferSizein interfaceSmallJettyConfiguration- Returns:
- the output buffer cache size in bytes.
-
getRequestHeaderSize
public int getRequestHeaderSize()- Specified by:
getRequestHeaderSizein interfaceSmallJettyConfiguration- Returns:
- the request header cache size in bytes.
-
getResponseHeaderSize
public int getResponseHeaderSize()- Specified by:
getResponseHeaderSizein interfaceSmallJettyConfiguration- Returns:
- the response header cache size in bytes.
-
getSendServerVersion
public boolean getSendServerVersion()- Specified by:
getSendServerVersionin interfaceSmallJettyConfiguration- Returns:
- true if the server version should be sent in headers/default pages, false if not.
-
getSendDateHeader
public boolean getSendDateHeader()- Specified by:
getSendDateHeaderin interfaceSmallJettyConfiguration- Returns:
- true if the server date should be sent in headers/default pages, false if not.
-
getSendXPoweredBy
public boolean getSendXPoweredBy()- Specified by:
getSendXPoweredByin interfaceSmallJettyConfiguration- Returns:
- true if the server name should be sent in headers/default pages, false if not.
-
getServletContextOptions
public int getServletContextOptions()- Specified by:
getServletContextOptionsin interfaceSmallJettyConfiguration- Returns:
- the Jetty options to pass to the servlet context handler.
- See Also:
-
getSSLConfiguration
- Specified by:
getSSLConfigurationin interfaceSmallJettyConfiguration- Returns:
- the SSL configuration to use for SSL, or null for no secure socket setup.
-
getGZipCompression
- Specified by:
getGZipCompressionin interfaceSmallJettyConfiguration- Returns:
- the GZip configuration to use, or null for no compression scheme.
-
getAttribute
- Specified by:
getAttributein interfacecom.blackrook.small.SmallConfiguration
-
setServerPort
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setSecureServerPort
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setContextPath
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setTempPath
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setServletPaths
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setApplicationPackageRoots
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setAllowOptions
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setAllowTrace
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setAllowWebSockets
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setAutoParseMultipart
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setMaxThreads
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setIdleConnectionTimeout
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setHeaderCacheSize
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setOutputBufferSize
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setRequestHeaderSize
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setResponseHeaderSize
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setSendServerVersion
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setSendDateHeader
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setSendXPoweredBy
- Parameters:
value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
setAttribute
- Parameters:
attributeName- the attribute name.value- the value to set.- Returns:
- this builder, for chaining.
- See Also:
-
useSSL
public DefaultSmallJettyConfiguration useSSL(int port, String keyStorePath, String keyStorePassword) Sets the HTTPS port and the keystore/truststore file and password. Assumes that the store is in JKS format.- Parameters:
port- the secure HTTP server port.keyStorePath- the keystore/truststore path.keyStorePassword- the keystore/truststore password.- Returns:
- this builder, for chaining.
- See Also:
-
useSSL
public DefaultSmallJettyConfiguration useSSL(int port, String keyStoreType, String keyStorePath, String keyStorePassword) Sets the HTTPS port and the keystore/truststore file and password.- Parameters:
port- the secure HTTP server port.keyStoreType- the keystore/truststore type.keyStorePath- the keystore/truststore path.keyStorePassword- the keystore/truststore password.- Returns:
- this builder, for chaining.
- See Also:
-
useSSL
public DefaultSmallJettyConfiguration useSSL(int port, String keyStorePath, String keyStorePassword, String trustStorePath, String trustStorePassword) Sets the HTTPS port and the keystore/truststore file and password.- Parameters:
port- the secure HTTP server port.keyStorePath- the keystore path.keyStorePassword- the keystore password.trustStorePath- the truststore path.trustStorePassword- the truststore password.- Returns:
- this builder, for chaining.
- See Also:
-
useSSL
public DefaultSmallJettyConfiguration useSSL(int port, String keyStoreType, String keyStorePath, String keyStorePassword, String trustStoreType, String trustStorePath, String trustStorePassword) Sets the HTTPS port and the keystore/truststore file and password.- Parameters:
port- the secure HTTP server port.keyStoreType- the keystore type.keyStorePath- the keystore path.keyStorePassword- the keystore password.trustStoreType- the truststore type.trustStorePath- the truststore path.trustStorePassword- the truststore password.- Returns:
- this builder, for chaining.
- See Also:
-
setGZip
Sets the GZip handler configuration for this application.- Parameters:
gzip- the GZip configuration.- Returns:
- this builder, for chaining.
-