Top Description Fields Constructors Methods
org.glassfish.grizzly.http.server

public Class ServerFilterConfiguration

extends Object
Class Inheritance
Known Direct Subclasses
org.glassfish.grizzly.http.server.ServerConfiguration
Imports
java.nio.charset.Charset, org.glassfish.grizzly.Grizzly

HttpServerFilter configuration.
Author
Alexey Stashok

Field Summary

Modifier and TypeField and Description
private BackendConfiguration
backendConfiguration

The auxiliary configuration, which might be used, when Grizzly HttpServer is running behind some HTTP gateway like reverse proxy or load balancer.

private ErrorPageGenerator
defaultErrorPageGenerator

The default error page generator

private Charset
defaultQueryEncoding

Default query string encoding (query part of request URI).

private String
private String
private boolean
isGracefulShutdownSupported

true, if HttpServerFilter has to support graceful shutdown, or false otherwise

public static final int
private int
private int
private long
private int
private boolean
private boolean
private SessionManager
private int
private boolean
public static final String

Constructor Summary

AccessConstructor and Description
public
public
ServerFilterConfiguration(final String serverName, final String serverVersion)

public

Method Summary

Modifier and TypeMethod and Description
private void
public BackendConfiguration
getBackendConfiguration()

Returns: the auxiliary configuration, which might be used, when Grizzly HttpServer is running behind HTTP gateway like reverse proxy or load balancer.

public ErrorPageGenerator
public Charset
getDefaultQueryEncoding()

Returns: the default character encoding used to decode request URI's query part.

public String
getHttpServerName()

Returns: the server name used for headers and default error pages.

public String
getHttpServerVersion()

Returns: the version of this server used for headers and default error pages.

public int
getMaxBufferedPostSize()

Gets the maximum POST body size, which can buffered in memory.

public int
getMaxFormPostSize()

Gets the maximum size of the POST body generated by an HTML form.

public long
getMaxPostSize()

Gets the maximum size of the POST body.

public int

Returns:

the maximum number of parameters, or -1 if there is no imposed limit.
getMaxRequestParameters
()

Returns the maximum number of parameters allowed per request.

public String

Returns:

the HTTP request scheme
getScheme
()

Get the HTTP request scheme, which if non-null overrides default one picked up by framework during runtime.

public SessionManager
getSessionManager()

Returns: the HTTP server SessionManager

public int

Returns:

an integer specifying the number of seconds this session remains open between client requests
getSessionTimeoutSeconds
()

Returns the maximum time interval, in seconds, that the HTTP server will keep this session open between client accesses.

public boolean
isGracefulShutdownSupported()

Returns: true, if HttpServerFilter has to support graceful shutdown, or false otherwise

public boolean
isPassTraceRequest()

Returns: true if the TRACE request will be passed to the registered HttpHandlers, otherwise false if the TRACE request will be handled by Grizzly.

public boolean
isReuseSessionID()
Deprecated since 2.3.17

Returns the "reuse session IDs when creating sessions"

public boolean
public boolean
isTraceEnabled()

Returns: true if a proper response to HTTP TRACE is to be generated, or false if a 405 is to be returned instead.

public void
setBackendConfiguration(final BackendConfiguration backendConfiguration)

Sets the auxiliary configuration, which might be used, when Grizzly HttpServer is running behind HTTP gateway like reverse proxy or load balancer.

public void
setDefaultErrorPageGenerator(final ErrorPageGenerator defaultErrorPageGenerator)

Sets the default ErrorPageGenerator.

public void
setDefaultQueryEncoding(final Charset defaultQueryEncoding)

Sets the default character encoding used to decode request URI's query part.

public void
setGracefulShutdownSupported(final boolean isGracefulShutdownSupported)

Enables or disables graceful shutdown support.

public void
setHttpServerName(String
server name
httpServerName
)

Sets the server name used for HTTP response headers and default generated error pages.

public void
setHttpServerVersion(String
server version
httpServerVersion
)

Sets the version of the server info sent in HTTP response headers and the default generated error pages.

public void
setMaxBufferedPostSize(final int maxBufferedPostSize)

Sets the maximum POST body size, which can buffered in memory.

public void
setMaxFormPostSize(final int maxFormPostSize)

Sets the maximum size of the POST body generated by an HTML form.

public void
setMaxPostSize(final long maxPostSize)

Sets the maximum size of the POST body.

public void
setMaxRequestParameters(int
the maximum number of parameters.
maxRequestParameters
)

Sets the maximum number of parameters allowed for a request.

public void
setPassTraceRequest(boolean
boolean to configure if trace requests will be handled by Grizzly or by a configured HttpHandler.
passTraceRequest
)

If passTraceRequest is true, the TRACE request will be passed to the registered HttpHandlers.

public void
setReuseSessionID(boolean isReuseSessionID)
Deprecated since 2.3.17

Sets the "reuse session IDs when creating sessions"

public void
setScheme(final String
the HTTP request scheme
scheme
)

Set the HTTP request scheme, which if non-null overrides default one picked up by framework during runtime.

public void
public void
setSessionManager(SessionManager sessionManager)

Sets the HTTP server SessionManager.

public void
setSessionTimeoutSeconds(int
An integer specifying the number of seconds
sessionTimeoutSeconds
)

Specifies the time, in seconds, between client requests before the HTTP server will invalidate this session.

public void
setTraceEnabled(final boolean
boolean to configure how grizzly handles TRACE requests
enabled
)

If enabled is true the TRACE method will be respected and a proper response will be generated.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

backendConfigurationback to summary
private BackendConfiguration backendConfiguration

The auxiliary configuration, which might be used, when Grizzly HttpServer is running behind some HTTP gateway like reverse proxy or load balancer.

defaultErrorPageGeneratorback to summary
private ErrorPageGenerator defaultErrorPageGenerator

The default error page generator

defaultQueryEncodingback to summary
private Charset defaultQueryEncoding

Default query string encoding (query part of request URI).

httpServerNameback to summary
private String httpServerName
httpServerVersionback to summary
private String httpServerVersion
isGracefulShutdownSupportedback to summary
private boolean isGracefulShutdownSupported

true, if HttpServerFilter has to support graceful shutdown, or false otherwise

MAX_REQUEST_PARAMETERSback to summary
public static final int MAX_REQUEST_PARAMETERS
maxBufferedPostSizeback to summary
private int maxBufferedPostSize
maxFormPostSizeback to summary
private int maxFormPostSize
maxPostSizeback to summary
private long maxPostSize
maxRequestParametersback to summary
private int maxRequestParameters
passTraceRequestback to summary
private boolean passTraceRequest
sendFileEnabledback to summary
private boolean sendFileEnabled
sessionManagerback to summary
private SessionManager sessionManager

The HTTP server SessionManager.

sessionTimeoutSecondsback to summary
private int sessionTimeoutSeconds
traceEnabledback to summary
private boolean traceEnabled
USE_SEND_FILEback to summary
public static final String USE_SEND_FILE

Constructor Detail

ServerFilterConfigurationback to summary
public ServerFilterConfiguration()
ServerFilterConfigurationback to summary
public ServerFilterConfiguration(final String serverName, final String serverVersion)
ServerFilterConfigurationback to summary
public ServerFilterConfiguration(final ServerFilterConfiguration configuration)

Method Detail

configureSendFileSupportback to summary
private void configureSendFileSupport()
getBackendConfigurationback to summary
public BackendConfiguration getBackendConfiguration()
Returns:BackendConfiguration

the auxiliary configuration, which might be used, when Grizzly HttpServer is running behind HTTP gateway like reverse proxy or load balancer.

Since
2.3.18
getDefaultErrorPageGeneratorback to summary
public ErrorPageGenerator getDefaultErrorPageGenerator()
Returns:ErrorPageGenerator

the default ErrorPageGenerator

getDefaultQueryEncodingback to summary
public Charset getDefaultQueryEncoding()
Returns:Charset

the default character encoding used to decode request URI's query part. null value means specific request's character encoding will be used

getHttpServerNameback to summary
public String getHttpServerName()
Returns:String

the server name used for headers and default error pages.

getHttpServerVersionback to summary
public String getHttpServerVersion()
Returns:String

the version of this server used for headers and default error pages.

getMaxBufferedPostSizeback to summary
public int getMaxBufferedPostSize()

Gets the maximum POST body size, which can buffered in memory. -1 value means no size limits applied.

Since
2.3
getMaxFormPostSizeback to summary
public int getMaxFormPostSize()

Gets the maximum size of the POST body generated by an HTML form. -1 value means no size limits applied.

Since
2.3
getMaxPostSizeback to summary
public long getMaxPostSize()

Gets the maximum size of the POST body. -1 value means no size limits applied.

Since
2.3.13
getMaxRequestParametersback to summary
public int getMaxRequestParameters()

Returns the maximum number of parameters allowed per request. If the value is less than zero, then there will be no limit on parameters. By default, the limit imposed is 10000.

Returns:int

the maximum number of parameters, or -1 if there is no imposed limit.

Since
2.2.8
getSchemeback to summary
public String getScheme()

Get the HTTP request scheme, which if non-null overrides default one picked up by framework during runtime.

Returns:String

the HTTP request scheme

Since
2.2.4
getSessionManagerback to summary
public SessionManager getSessionManager()
Returns:SessionManager

the HTTP server SessionManager

See Also
setSessionManager
getSessionTimeoutSecondsback to summary
public int getSessionTimeoutSeconds()

Returns the maximum time interval, in seconds, that the HTTP server will keep this session open between client accesses. After this interval, the HTTP server will invalidate the session.

A return value of zero or less indicates that the session will never timeout.

Returns:int

an integer specifying the number of seconds this session remains open between client requests

See Also
setSessionTimeoutSeconds
isGracefulShutdownSupportedback to summary
public boolean isGracefulShutdownSupported()
Returns:boolean

true, if HttpServerFilter has to support graceful shutdown, or false otherwise

isPassTraceRequestback to summary
public boolean isPassTraceRequest()
Returns:boolean

true if the TRACE request will be passed to the registered HttpHandlers, otherwise false if the TRACE request will be handled by Grizzly.

Since
2.2.7
isReuseSessionIDback to summary
public boolean isReuseSessionID()

Deprecated

since 2.3.17

Returns the "reuse session IDs when creating sessions"

Annotations
@Deprecated
Since
2.2.19
isSendFileEnabledback to summary
public boolean isSendFileEnabled()

Returns true if File resources may be be sent using java.nio.channels.FileChannel#transferTo(long, long, java.nio.channels.WritableByteChannel).

By default, this property will be true, except in the following cases:

  • JVM OS is HP-UX
  • JVM OS is Linux, and the Oracle JVM in use is 1.6.0_17 or older

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.

Returns:boolean

true if resources will be sent using java.nio.channels.FileChannel#transferTo(long, long, java.nio.channels.WritableByteChannel).

Since
2.2
isTraceEnabledback to summary
public boolean isTraceEnabled()
Returns:boolean

true if a proper response to HTTP TRACE is to be generated, or false if a 405 is to be returned instead.

Since
2.2.7
setBackendConfigurationback to summary
public void setBackendConfiguration(final BackendConfiguration backendConfiguration)

Sets the auxiliary configuration, which might be used, when Grizzly HttpServer is running behind HTTP gateway like reverse proxy or load balancer.

Parameters
backendConfiguration:BackendConfiguration

BackendConfiguration

Since
2.3.18
setDefaultErrorPageGeneratorback to summary
public void setDefaultErrorPageGenerator(final ErrorPageGenerator defaultErrorPageGenerator)

Sets the default ErrorPageGenerator.

setDefaultQueryEncodingback to summary
public void setDefaultQueryEncoding(final Charset defaultQueryEncoding)

Sets the default character encoding used to decode request URI's query part. null value means specific request's character encoding will be used.

setGracefulShutdownSupportedback to summary
public void setGracefulShutdownSupported(final boolean isGracefulShutdownSupported)

Enables or disables graceful shutdown support.

setHttpServerNameback to summary
public void setHttpServerName(String httpServerName)

Sets the server name used for HTTP response headers and default generated error pages. If not value is explicitly set, this value defaults to Grizzly.

Parameters
httpServerName:String

server name

setHttpServerVersionback to summary
public void setHttpServerVersion(String httpServerVersion)

Sets the version of the server info sent in HTTP response headers and the default generated error pages. If not value is explicitly set, this value defaults to the current version of the Grizzly runtime.

Parameters
httpServerVersion:String

server version

setMaxBufferedPostSizeback to summary
public void setMaxBufferedPostSize(final int maxBufferedPostSize)

Sets the maximum POST body size, which can buffered in memory. -1 value means no size limits applied.

Since
2.3
setMaxFormPostSizeback to summary
public void setMaxFormPostSize(final int maxFormPostSize)

Sets the maximum size of the POST body generated by an HTML form. -1 value means no size limits applied.

Since
2.3
setMaxPostSizeback to summary
public void setMaxPostSize(final long maxPostSize)

Sets the maximum size of the POST body. -1 value means no size limits applied.

Since
2.3.13
setMaxRequestParametersback to summary
public void setMaxRequestParameters(int maxRequestParameters)

Sets the maximum number of parameters allowed for a request.

Parameters
maxRequestParameters:int

the maximum number of parameters.

Since
2.2.8
setPassTraceRequestback to summary
public void setPassTraceRequest(boolean passTraceRequest)

If passTraceRequest is true, the TRACE request will be passed to the registered HttpHandlers. Otherwise, TRACE will be handled by Grizzly. By default, TRACE requests will be handled by Grizzly.

Parameters
passTraceRequest:boolean

boolean to configure if trace requests will be handled by Grizzly or by a configured HttpHandler.

Since
2.2.7
setReuseSessionIDback to summary
public void setReuseSessionID(boolean isReuseSessionID)

Deprecated

since 2.3.17

Sets the "reuse session IDs when creating sessions"

Annotations
@Deprecated
Since
2.2.19
setSchemeback to summary
public void setScheme(final String scheme)

Set the HTTP request scheme, which if non-null overrides default one picked up by framework during runtime.

Parameters
scheme:String

the HTTP request scheme

Since
2.2.4
setSendFileEnabledback to summary
public void setSendFileEnabled(boolean sendFileEnabled)

Configure whether or sendfile support will enabled which allows sending java.io.File resources via java.nio.channels.FileChannel#transferTo(long, long, java.nio.channels.WritableByteChannel). If disabled, the more traditional byte[] copy will be used to send content.

Parameters
sendFileEnabled:boolean

true to enable java.nio.channels.FileChannel#transferTo(long, long, java.nio.channels.WritableByteChannel) support.

Since
2.2
setSessionManagerback to summary
public void setSessionManager(SessionManager sessionManager)

Sets the HTTP server SessionManager.

Parameters
sessionManager:SessionManager

SessionManager

setSessionTimeoutSecondsback to summary
public void setSessionTimeoutSeconds(int sessionTimeoutSeconds)

Specifies the time, in seconds, between client requests before the HTTP server will invalidate this session.

An interval value of zero or less indicates that the session should never timeout.

Parameters
sessionTimeoutSeconds:int

An integer specifying the number of seconds

setTraceEnabledback to summary
public void setTraceEnabled(final boolean enabled)

If enabled is true the TRACE method will be respected and a proper response will be generated. Otherwise, the method will be considered as not allowed and an HTTP 405 will be returned. This method only comes into effect when setPassTraceRequest(false) has been called.

Parameters
enabled:boolean

boolean to configure how grizzly handles TRACE requests

Since
2.2.7