public class ServerFilterConfiguration extends Object
HttpServerFilter
configuration.Modifier and Type | Field and Description |
---|---|
static int |
MAX_REQUEST_PARAMETERS |
static String |
USE_SEND_FILE |
Constructor and Description |
---|
ServerFilterConfiguration() |
ServerFilterConfiguration(ServerFilterConfiguration configuration) |
ServerFilterConfiguration(String serverName,
String serverVersion) |
Modifier and Type | Method and Description |
---|---|
BackendConfiguration |
getBackendConfiguration() |
ErrorPageGenerator |
getDefaultErrorPageGenerator()
Returns the default
ErrorPageGenerator . |
Charset |
getDefaultQueryEncoding()
Returns the default character encoding used to decode request URI's query part.
|
String |
getHttpServerName() |
String |
getHttpServerVersion() |
int |
getMaxBufferedPostSize()
Gets the maximum POST body size, which can buffered in memory.
|
int |
getMaxFormPostSize()
Gets the maximum size of the POST body generated by an HTML form.
|
long |
getMaxPostSize()
Gets the maximum size of the POST body.
|
int |
getMaxRequestParameters()
Returns the maximum number of parameters allowed per request.
|
String |
getScheme()
Get the HTTP request scheme, which if non-null overrides default one
picked up by framework during runtime.
|
boolean |
isGracefulShutdownSupported() |
boolean |
isPassTraceRequest() |
boolean |
isReuseSessionID()
Deprecated.
since 2.3.17
|
boolean |
isSendFileEnabled()
Returns
true if File resources may be be sent using
FileChannel.transferTo(long, long, java.nio.channels.WritableByteChannel) . |
boolean |
isTraceEnabled() |
void |
setBackendConfiguration(BackendConfiguration backendConfiguration)
Sets the auxiliary configuration, which might be used, when Grizzly
HttpServer is running behind HTTP gateway like reverse proxy or load
balancer.
|
void |
setDefaultErrorPageGenerator(ErrorPageGenerator defaultErrorPageGenerator)
Sets the default
ErrorPageGenerator . |
void |
setDefaultQueryEncoding(Charset defaultQueryEncoding)
Sets the default character encoding used to decode request URI's query part.
|
void |
setGracefulShutdownSupported(boolean isGracefulShutdownSupported)
Enables or disables graceful shutdown support.
|
void |
setHttpServerName(String httpServerName)
Sets the server name used for HTTP response headers and default generated error pages.
|
void |
setHttpServerVersion(String httpServerVersion)
Sets the version of the server info sent in HTTP response headers and the default generated error pages.
|
void |
setMaxBufferedPostSize(int maxBufferedPostSize)
Sets the maximum POST body size, which can buffered in memory.
|
void |
setMaxFormPostSize(int maxFormPostSize)
Sets the maximum size of the POST body generated by an HTML form.
|
void |
setMaxPostSize(long maxPostSize)
Sets the maximum size of the POST body.
|
void |
setMaxRequestParameters(int maxRequestParameters)
Sets the maximum number of parameters allowed for a request.
|
void |
setPassTraceRequest(boolean passTraceRequest)
If passTraceRequest is true, the TRACE request
will be passed to the registered
HttpHandler s. |
void |
setReuseSessionID(boolean isReuseSessionID)
Deprecated.
since 2.3.17
|
void |
setScheme(String scheme)
Set the HTTP request scheme, which if non-null overrides default one
picked up by framework during runtime.
|
void |
setSendFileEnabled(boolean sendFileEnabled)
Configure whether or sendfile support will enabled which allows sending
File resources via FileChannel.transferTo(long, long, java.nio.channels.WritableByteChannel) . |
void |
setTraceEnabled(boolean enabled)
If enabled is true the TRACE method will be
respected and a proper response will be generated.
|
public static final int MAX_REQUEST_PARAMETERS
public static final String USE_SEND_FILE
public ServerFilterConfiguration()
public ServerFilterConfiguration(ServerFilterConfiguration configuration)
public String getHttpServerName()
public void setHttpServerName(String httpServerName)
Grizzly
.httpServerName
- server namepublic String getHttpServerVersion()
public void setHttpServerVersion(String httpServerVersion)
httpServerVersion
- server versionpublic boolean isSendFileEnabled()
Returns true
if File resources may be be sent using
FileChannel.transferTo(long, long, java.nio.channels.WritableByteChannel)
.
By default, this property will be true, except in the following cases:
This logic can be overridden by explicitly setting the property via
setSendFileEnabled(boolean)
or by specifying the system property
"org.glassfish.grizzly.http.USE_SEND_FILE" with a value of true
Finally, if the connection between endpoints is secure, send file functionality will be disabled regardless of configuration.
true
if resources will be sent using
FileChannel.transferTo(long, long, java.nio.channels.WritableByteChannel)
.public void setSendFileEnabled(boolean sendFileEnabled)
File
resources via FileChannel.transferTo(long, long, java.nio.channels.WritableByteChannel)
.
If disabled, the more traditional byte[] copy will be used to send content.sendFileEnabled
- true
to enable FileChannel.transferTo(long, long, java.nio.channels.WritableByteChannel)
support.public String getScheme()
public void setScheme(String scheme)
scheme
- the HTTP request schemepublic BackendConfiguration getBackendConfiguration()
public void setBackendConfiguration(BackendConfiguration backendConfiguration)
backendConfiguration
- BackendConfiguration
public boolean isPassTraceRequest()
HttpHandler
s, otherwise false if the
TRACE request will be handled by Grizzly.public void setPassTraceRequest(boolean passTraceRequest)
HttpHandler
s. Otherwise,
TRACE will be handled by Grizzly.
By default, TRACE requests will be handled by Grizzly.passTraceRequest
- boolean to configure if trace requests will
be handled by Grizzly or by a configured
HttpHandler
.public boolean isTraceEnabled()
public void setTraceEnabled(boolean enabled)
setPassTraceRequest(false)
has been called.enabled
- boolean to configure how grizzly handles TRACE requestspublic int getMaxRequestParameters()
public void setMaxRequestParameters(int maxRequestParameters)
maxRequestParameters
- the maximum number of parameters.public boolean isReuseSessionID()
public void setReuseSessionID(boolean isReuseSessionID)
public long getMaxPostSize()
-1
value means no size limits applied.public void setMaxPostSize(long maxPostSize)
-1
value means no size limits applied.public int getMaxFormPostSize()
-1
value means no size limits applied.public void setMaxFormPostSize(int maxFormPostSize)
-1
value means no size limits applied.public int getMaxBufferedPostSize()
-1
value means no size limits applied.public void setMaxBufferedPostSize(int maxBufferedPostSize)
-1
value means no size limits applied.public Charset getDefaultQueryEncoding()
null
value means specific request's character encoding will be used.public void setDefaultQueryEncoding(Charset defaultQueryEncoding)
null
value means specific request's character encoding will be used.public ErrorPageGenerator getDefaultErrorPageGenerator()
ErrorPageGenerator
.public void setDefaultErrorPageGenerator(ErrorPageGenerator defaultErrorPageGenerator)
ErrorPageGenerator
.defaultErrorPageGenerator
- public boolean isGracefulShutdownSupported()
HttpServerFilter
has to support
graceful shutdown, or false otherwisepublic void setGracefulShutdownSupported(boolean isGracefulShutdownSupported)
isGracefulShutdownSupported
- Copyright © 2015 Oracle Corporation. All Rights Reserved.