Package org.attribyte.snook
Class ServerConfiguration
java.lang.Object
org.attribyte.snook.ServerConfiguration
HTTP server configuration.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe connection security option. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe property to allow symlinks when searching for static assets ("allowSymlinks").final booleanAllow the use of symlinks when resolving static assets.static final StringThe connection security property name ("connectionSecurity").The configured connection security.final booleanIs "debug" mode configured?static final StringThe "debug" mode property name ("debug").static final booleanThe default value for allowing symlinks (false).static final StringThe default value for connection security ("none").static final booleanThe default "debug" mode (false).static final StringThe default value for idle timeout ("30s").static final StringThe default value for the listen IP "127.0.0.1".static final intThe default listen port 8081.static final intThe default value for the maximum form content size (10000000).static final intThe default value for the maximum request header size (8192).static final intThe default value for the maximum response header size (8192).static final intThe default value for the output buffer size (32768).static final intThe default listen port for secure connections 8443.static final booleanThe default value for sending the date header (false).static final booleanThe default value for sending the server version (false).static final StringThe property name for the enable forwarded request cusomizer flag ("enableForwardedRequestCustomizer".final booleanIs the forwarded request customizer enabled?final intThe port this server is listening on.final intThe port this server is listening on for secure connections.static final StringThe idle timeout property name ("idleTimeout").final longThe maximum idle time in milliseconds.static final StringThe property name for the keystore check interval ("keystoreCheckInterval").static final StringThe property name for the path to the keystore ("keystore.File").static final StringThe property name for the keystore password ("keystorePassword").static final StringThe property name for the keystore provider, e.g.final StringThe time between checks for a key store change.final longThe keystore check interval in milliseconds.final booleanIdentifies if a password was specified for the key store.final StringThe path to the key store.final StringThe key store provider.static final StringThe listen IP property name ("listenIP").static final StringThe listen port property name ("httpPort").final StringThe IP this server is listening on.static final StringThe maximum form content size property name ("maxFormContentSize").static final StringThe maximum request header size property name ("maxRequestHeaderSize").static final StringThe maximum response header size property name ("maxResponseHeaderSize").final intThe maximum size allowed for posted forms.static final StringThe listen output buffer size property name ("outputBufferSize").final intThe size of the buffer into which httpResponse content is aggregated before being sent to the client.final intThe maximum size of a request header.final intThe maximum size of a request header.static final StringThe listen port for secure connections property name ("httpsPort").static final StringThe send date header property name ("sendDateHeader").static final StringThe send server version property name ("sendServerVersion").final booleanShould aDateheader be sent with responses?final booleanShould the server version be sent with responses?static final StringThe property name to suppress stack trace output for unhandled exceptions.final booleanAre stack traces for unhandled exceptions suppressed?static final StringThe property name for the path to the truststore ("truststore.File").static final StringThe property name for the truststore password ("truststorePassword").static final StringThe property name for a truststore resource URL ("truststoreResource").final booleanIdentifies if a password was specified for the trust store.final StringThe path to the trust store.final StringThe URL for a trust store resource. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a server configuration with default values.ServerConfiguration(String namePrefix, Properties props) Creates a server configuration from properties. -
Method Summary
-
Field Details
-
LISTEN_IP_PROPERTY
The listen IP property name ("listenIP").- See Also:
-
DEFAULT_LISTEN_IP
The default value for the listen IP "127.0.0.1".- See Also:
-
LISTEN_PORT_PROPERTY
The listen port property name ("httpPort").- See Also:
-
DEFAULT_LISTEN_PORT
public static final int DEFAULT_LISTEN_PORTThe default listen port 8081.- See Also:
-
SECURE_LISTEN_PORT_PROPERTY
The listen port for secure connections property name ("httpsPort").- See Also:
-
DEFAULT_SECURE_LISTEN_PORT
public static final int DEFAULT_SECURE_LISTEN_PORTThe default listen port for secure connections 8443.- See Also:
-
OUTPUT_BUFFER_SIZE_PROPERTY
The listen output buffer size property name ("outputBufferSize").- See Also:
-
DEFAULT_OUTPUT_BUFFER_SIZE
public static final int DEFAULT_OUTPUT_BUFFER_SIZEThe default value for the output buffer size (32768).- See Also:
-
MAX_REQUEST_HEADER_PROPERTY
The maximum request header size property name ("maxRequestHeaderSize").- See Also:
-
DEFAULT_MAX_REQUEST_HEADER_SIZE
public static final int DEFAULT_MAX_REQUEST_HEADER_SIZEThe default value for the maximum request header size (8192).- See Also:
-
MAX_RESPONSE_HEADER_PROPERTY
The maximum response header size property name ("maxResponseHeaderSize").- See Also:
-
DEFAULT_MAX_RESPONSE_HEADER_SIZE
public static final int DEFAULT_MAX_RESPONSE_HEADER_SIZEThe default value for the maximum response header size (8192).- See Also:
-
SEND_SERVER_VERSION_PROPERTY
The send server version property name ("sendServerVersion").- See Also:
-
DEFAULT_SEND_SERVER_VERSION
public static final boolean DEFAULT_SEND_SERVER_VERSIONThe default value for sending the server version (false).- See Also:
-
SEND_DATE_HEADER_PROPERTY
The send date header property name ("sendDateHeader").- See Also:
-
DEFAULT_SEND_DATE_HEADER
public static final boolean DEFAULT_SEND_DATE_HEADERThe default value for sending the date header (false).- See Also:
-
MAX_FORM_CONTENT_SIZE_PROPERTY
The maximum form content size property name ("maxFormContentSize").- See Also:
-
DEFAULT_MAX_FORM_CONTENT_SIZE
public static final int DEFAULT_MAX_FORM_CONTENT_SIZEThe default value for the maximum form content size (10000000).- See Also:
-
IDLE_TIMEOUT_PROPERTY
The idle timeout property name ("idleTimeout").- See Also:
-
DEFAULT_IDLE_TIMEOUT
The default value for idle timeout ("30s").- See Also:
-
DEBUG_PROPERTY
The "debug" mode property name ("debug").- See Also:
-
CONNECTION_SECURITY_PROPERTY
The connection security property name ("connectionSecurity").- See Also:
-
ALLOW_SYMLINKS_PROPERTY
The property to allow symlinks when searching for static assets ("allowSymlinks").- See Also:
-
DEFAULT_ALLOW_SYMLINKS
public static final boolean DEFAULT_ALLOW_SYMLINKSThe default value for allowing symlinks (false).- See Also:
-
DEFAULT_CONNECTION_SECURITY
The default value for connection security ("none").- See Also:
-
DEFAULT_DEBUG_MODE
public static final boolean DEFAULT_DEBUG_MODEThe default "debug" mode (false).- See Also:
-
KEYSTORE_FILE_PROPERTY
The property name for the path to the keystore ("keystore.File").- See Also:
-
KEYSTORE_PASSWORD_PROPERTY
The property name for the keystore password ("keystorePassword").- See Also:
-
KEYSTORE_PROVIDER_PROPERTY
The property name for the keystore provider, e.g.PKCS12("keystoreProvider").- See Also:
-
KEYSTORE_CHECK_PROPERTY
The property name for the keystore check interval ("keystoreCheckInterval").- See Also:
-
TRUSTSTORE_FILE_PROPERTY
The property name for the path to the truststore ("truststore.File").- See Also:
-
TRUSTSTORE_RESOURCE_PROPERTY
The property name for a truststore resource URL ("truststoreResource").- See Also:
-
TRUSTSTORE_PASSWORD_PROPERTY
The property name for the truststore password ("truststorePassword").- See Also:
-
ENABLE_FORWARDED_REQUEST_CUSTOMIZER_PROPERTY
The property name for the enable forwarded request cusomizer flag ("enableForwardedRequestCustomizer".- See Also:
-
SUPPRESS_STACK_TRACE_PROPERTY
The property name to suppress stack trace output for unhandled exceptions.- See Also:
-
listenIP
The IP this server is listening on. -
httpPort
public final int httpPortThe port this server is listening on. -
httpsPort
public final int httpsPortThe port this server is listening on for secure connections. -
outputBufferSize
public final int outputBufferSizeThe size of the buffer into which httpResponse content is aggregated before being sent to the client. -
requestHeaderSize
public final int requestHeaderSizeThe maximum size of a request header. -
responseHeaderSize
public final int responseHeaderSizeThe maximum size of a request header. -
sendServerVersion
public final boolean sendServerVersionShould the server version be sent with responses? -
sendDateHeader
public final boolean sendDateHeaderShould aDateheader be sent with responses? -
idleTimeout
public final long idleTimeoutThe maximum idle time in milliseconds. -
maxFormContentSize
public final int maxFormContentSizeThe maximum size allowed for posted forms. -
debug
public final boolean debugIs "debug" mode configured? -
connectionSecurity
The configured connection security. -
keyStorePath
The path to the key store. -
keyStoreProvider
The key store provider. -
keyStorePasswordWasSpecified
public final boolean keyStorePasswordWasSpecifiedIdentifies if a password was specified for the key store. -
keyStoreCheckInterval
The time between checks for a key store change. -
keyStoreCheckIntervalMillis
public final long keyStoreCheckIntervalMillisThe keystore check interval in milliseconds. -
trustStorePath
The path to the trust store. -
trustStoreResource
The URL for a trust store resource. -
trustStorePasswordWasSpecified
public final boolean trustStorePasswordWasSpecifiedIdentifies if a password was specified for the trust store. -
allowSymlinks
public final boolean allowSymlinksAllow the use of symlinks when resolving static assets. -
enableForwardedRequestCustomizer
public final boolean enableForwardedRequestCustomizerIs the forwarded request customizer enabled? Defaulttrue.Alters the request by using headers like
X-Forwarded-Forto make the real endpoint visible. -
suppressStackTrace
public final boolean suppressStackTraceAre stack traces for unhandled exceptions suppressed? Defaultfalse.
-
-
Constructor Details
-
ServerConfiguration
public ServerConfiguration() throws org.attribyte.api.InitializationExceptionCreates a server configuration with default values.- Throws:
org.attribyte.api.InitializationException- on invalid configuration.
-
ServerConfiguration
public ServerConfiguration(String namePrefix, Properties props) throws org.attribyte.api.InitializationException Creates a server configuration from properties.- Parameters:
namePrefix- A prefix to be applied to names in the propertiesserver.for example.props- The properties.- Throws:
org.attribyte.api.InitializationException- on invalid configuration.
-
-
Method Details
-
propertyDocumentation
Returns formatted documentation of all server configuration properties.- Returns:
- The property documentation string.
-
toString
-
buildServer
public org.eclipse.jetty.server.Server buildServer()Builds a server instance form this configuration.- Returns:
- The server.
-