@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
An interface that allows a request object to be customized
for a particular HTTP connector configuration.
|
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 |
getOutputAggregationSize() |
int |
getOutputBufferSize() |
int |
getRequestHeaderSize() |
int |
getResponseHeaderSize() |
int |
getSecurePort() |
String |
getSecureScheme() |
boolean |
getSendDateHeader() |
boolean |
getSendServerVersion() |
boolean |
getSendXPoweredBy() |
boolean |
isDelayDispatchUntilContent() |
void |
setCustomizers(List<HttpConfiguration.Customizer> customizers)
Set the
HttpConfiguration.Customizer s that are invoked for every
request received. |
void |
setDelayDispatchUntilContent(boolean delay) |
void |
setHeaderCacheSize(int headerCacheSize)
Set the header field cache size.
|
void |
setOutputAggregationSize(int outputAggregationSize)
Set the max size of the response content write that is copied into the aggregate buffer.
|
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 securePort)
Set the TCP/IP port used for CONFIDENTIAL and INTEGRAL redirections.
|
void |
setSecureScheme(String secureScheme)
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 size in bytes for HTTP output to be aggregated") public int getOutputAggregationSize()
@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 setDelayDispatchUntilContent(boolean delay)
delay
- if true, delay the application dispatch until content is available@ManagedAttribute(value="if true, delay the application dispatch until content is available") public boolean isDelayDispatchUntilContent()
public void setCustomizers(List<HttpConfiguration.Customizer> customizers)
Set the HttpConfiguration.Customizer
s that are invoked for every
request received.
Customizers are often used to interpret optional headers (eg ForwardedRequestCustomizer
) or
optional protocol semantics (eg SecureRequestCustomizer
).
customizers
- the list of customizerspublic void setOutputBufferSize(int responseBufferSize)
responseBufferSize
- buffer size in bytes.public void setOutputAggregationSize(int outputAggregationSize)
outputAggregationSize
- the max write size that is aggregatedpublic 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 securePort)
securePort
- the secure port to redirect to.public void setSecureScheme(String secureScheme)
secureScheme
- A scheme string like "https"Copyright © 1995-2015 Webtide. All Rights Reserved.