@ManagedObject(value="HTTP Configuration") public class HttpConfiguration extends Object
This class is a holder of HTTP configuration for use by the
HttpChannel
class. Typically a HTTPConfiguration instance
is instantiated and passed to a ConnectionFactory
that can
create HTTP channels (eg HTTP, AJP or SPDY).
The configuration held by this class is not for the wire protocol, but for the interpretation and handling of HTTP requests that could be transported by a variety of protocols.
Modifier and Type | Class and Description |
---|---|
static interface |
HttpConfiguration.ConnectionFactory |
static interface |
HttpConfiguration.Customizer |
Modifier and Type | Field and Description |
---|---|
static String |
SERVER_VERSION |
Constructor and Description |
---|
HttpConfiguration() |
HttpConfiguration(HttpConfiguration config)
Create a configuration from another.
|
Modifier and Type | Method and Description |
---|---|
void |
addCustomizer(HttpConfiguration.Customizer customizer)
Add a
HttpConfiguration.Customizer that is invoked for every
request received. |
<T> T |
getCustomizer(Class<T> type) |
List<HttpConfiguration.Customizer> |
getCustomizers() |
int |
getHeaderCacheSize() |
int |
getOutputBufferSize() |
int |
getRequestHeaderSize() |
int |
getResponseHeaderSize() |
int |
getSecurePort() |
String |
getSecureScheme() |
boolean |
getSendDateHeader() |
boolean |
getSendServerVersion() |
boolean |
getSendXPoweredBy() |
void |
setCustomizers(List<HttpConfiguration.Customizer> customizers)
Set the
HttpConfiguration.Customizer s that are invoked for every
request received. |
void |
setHeaderCacheSize(int headerCacheSize)
Set the header field cache size.
|
void |
setOutputBufferSize(int responseBufferSize)
Set the size of the buffer into which response content is aggregated
before being sent to the client.
|
void |
setRequestHeaderSize(int requestHeaderSize)
Set the maximum size of a request header.
|
void |
setResponseHeaderSize(int responseHeaderSize)
Set the maximum size of a response header.
|
void |
setSecurePort(int confidentialPort)
Set the TCP/IP port used for CONFIDENTIAL and INTEGRAL
redirections.
|
void |
setSecureScheme(String confidentialScheme)
Set the URI scheme used for CONFIDENTIAL and INTEGRAL
redirections.
|
void |
setSendDateHeader(boolean sendDateHeader) |
void |
setSendServerVersion(boolean sendServerVersion) |
void |
setSendXPoweredBy(boolean sendXPoweredBy) |
String |
toString() |
public static final String SERVER_VERSION
public HttpConfiguration()
public HttpConfiguration(HttpConfiguration config)
config
- The configuration to copy.public void addCustomizer(HttpConfiguration.Customizer customizer)
Add a HttpConfiguration.Customizer
that is invoked for every
request received.
Customiser are often used to interpret optional headers (eg ForwardedRequestCustomizer
) or
optional protocol semantics (eg SecureRequestCustomizer
).
customizer
- A request customizerpublic List<HttpConfiguration.Customizer> getCustomizers()
public <T> T getCustomizer(Class<T> type)
@ManagedAttribute(value="The size in bytes of the output buffer used to aggregate HTTP output") public int getOutputBufferSize()
@ManagedAttribute(value="The maximum allowed size in bytes for a HTTP request header") public int getRequestHeaderSize()
@ManagedAttribute(value="The maximum allowed size in bytes for a HTTP response header") public int getResponseHeaderSize()
@ManagedAttribute(value="The maximum allowed size in bytes for a HTTP header field cache") public int getHeaderCacheSize()
@ManagedAttribute(value="The port to which Integral or Confidential security constraints are redirected") public int getSecurePort()
@ManagedAttribute(value="The scheme with which Integral or Confidential security constraints are redirected") public String getSecureScheme()
public void setSendServerVersion(boolean sendServerVersion)
@ManagedAttribute(value="if true, send the Server header in responses") public boolean getSendServerVersion()
public void setSendXPoweredBy(boolean sendXPoweredBy)
@ManagedAttribute(value="if true, send the X-Powered-By header in responses") public boolean getSendXPoweredBy()
public void setSendDateHeader(boolean sendDateHeader)
@ManagedAttribute(value="if true, include the date in HTTP headers") public boolean getSendDateHeader()
public void setCustomizers(List<HttpConfiguration.Customizer> customizers)
Set the HttpConfiguration.Customizer
s that are invoked for every
request received.
Customisers are often used to interpret optional headers (eg ForwardedRequestCustomizer
) or
optional protocol semantics (eg SecureRequestCustomizer
).
customizers
- public void setOutputBufferSize(int responseBufferSize)
responseBufferSize
- buffer size in bytes.public void setRequestHeaderSize(int requestHeaderSize)
Larger headers will allow for more and/or larger cookies plus larger form content encoded in a URL. However, larger headers consume more memory and can make a server more vulnerable to denial of service attacks.
requestHeaderSize
- Max header size in bytespublic void setResponseHeaderSize(int responseHeaderSize)
Larger headers will allow for more and/or larger cookies and longer HTTP headers (eg for redirection). However, larger headers will also consume more memory.
responseHeaderSize
- Response header size in bytes.public void setHeaderCacheSize(int headerCacheSize)
headerCacheSize
- The size in bytes of the header field cache.public void setSecurePort(int confidentialPort)
confidentialPort
- public void setSecureScheme(String confidentialScheme)
confidentialScheme
- A string like"https"Copyright © 1995-2014 Mort Bay Consulting. All Rights Reserved.