Top Description Inners Fields Constructors Methods
org.eclipse.jetty.server

public Class HttpConfiguration

extends Object
implements Dumpable
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.component.Dumpable
Annotations
@ManagedObject:HTTP Configuration
Imports
java.io.IOException, java.net.SocketAddress, java.util.ArrayList, .List, .Objects, .Set, java.util.concurrent.CopyOnWriteArrayList, org.eclipse.jetty.http.ComplianceViolation, .CookieCompliance, .HttpCompliance, .HttpFields, .HttpMethod, .HttpScheme, .MultiPartCompliance, .UriCompliance, org.eclipse.jetty.util.HostPort, .Index, .Jetty, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedObject, org.eclipse.jetty.util.component.Dumpable, .DumpableCollection

HTTP Configuration.

This class is a holder of HTTP configuration. Typically an HTTPConfiguration instance is instantiated and passed to a ConnectionFactory that can create HTTP channels (e.g. HTTP, AJP or FCGI).

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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
public static interface
HttpConfiguration.Customizer

An interface that allows a request object to be customized for a particular HTTP connector configuration.

Field Summary

Modifier and TypeField and Description
private final List<ComplianceViolation.Listener>
private final List<HttpConfiguration.Customizer>
private boolean
private final Index.Mutable<Boolean>
private boolean
private int
private HttpCompliance
private long
private SocketAddress
private int
private int
private long
private long
private MultiPartCompliance
private boolean
private int
private int
private boolean
private boolean
private CookieCompliance
private int
private CookieCompliance
private int
private int
private String
private boolean
private boolean
private boolean
private HostPort
private UriCompliance
private boolean
private boolean
public static final String

Constructor Summary

AccessConstructor and Description
public
public
HttpConfiguration(HttpConfiguration
The configuration to copy.
config
)

Creates a configuration from another.

Method Summary

Modifier and TypeMethod and Description
public void
addComplianceViolationListener(ComplianceViolation.Listener
the listener to add
listener
)

Add a ComplianceViolation.Listener to the configuration

public void
addCustomizer(HttpConfiguration.Customizer
A request customizer
customizer
)

Adds a Customizer that is invoked for every request received.

public void
addFormEncodedMethod(String
the HTTP method of requests that can be decoded as x-www-form-urlencoded content.
method
)

Adds a form encoded HTTP Method

public String
public void
dump(Appendable
The appendable to dump to
out
,
String
The indent to apply after any new lines.
indent
)

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines.
public List<ComplianceViolation.Listener>

Returns:

the list of configured listeners
getComplianceViolationListeners
()

Get the list of configured ComplianceViolation.Listener to use.

public <T> T
public List<HttpConfiguration.Customizer>
public Set<String>

Returns:

the set of HTTP methods of requests that can be decoded as x-www-form-urlencoded content.
getFormEncodedMethods
()

public int
public HttpCompliance
public long

Returns:

the max idle time in ms or if == 0 implies an infinite timeout, <0 implies no HTTP channel timeout and the connection timeout is used instead.
getIdleTimeout
()

The max idle time is applied to an HTTP request for IO operations and delayed dispatch.

public SocketAddress

Returns:

Returns the connection local address override or null.
getLocalAddress
()

Get the SocketAddress override to be reported as the local address of all connections

public int

Returns:

The maximum error dispatches for a request to prevent looping on an error
getMaxErrorDispatches
()

public int

Returns:

the maximum amount of reads for unconsumed content or -1 for unlimited.
getMaxUnconsumedRequestContentReads
()

Gets the maximum amount of HttpStream#read()s that can be done by the HttpStream if the content is not fully consumed by the application.

public long

Returns:

The minimum request data rate in bytes per second; or <=0 for no limit
getMinRequestDataRate
()

public long

Returns:

The minimum response data rate in bytes per second; or <=0 for no limit
getMinResponseDataRate
()

public MultiPartCompliance

Returns:

the MultiPartCompliance used for validating multipart form syntax.
getMultiPartCompliance
()

public int
public int
public CookieCompliance

Returns:

The CookieCompliance used for parsing request Cookie headers.
getRequestCookieCompliance
()

public int
public CookieCompliance

Returns:

The CookieCompliance used for generating response Set-Cookie headers
getResponseCookieCompliance
()

public int
public int
public String
public boolean

Returns:

true by default
getSendDateHeader
()

Indicates if the Date header will be sent in responses.

public boolean
public boolean
public HostPort

Returns:

Returns the connection server authority (name/port) or null
getServerAuthority
()

Get the Server authority override to be used if no authority is provided by a request.

public UriCompliance
public boolean
public boolean

Returns:

true if requests with this method can be decoded as x-www-form-urlencoded content.
isFormEncodedMethod
(String
the HTTP method
method
)

Tests whether the HTTP method supports x-www-form-urlencoded content

public boolean
public boolean

Returns:

whether remote errors, when detected, are notified to async applications
isNotifyRemoteAsyncErrors
()

public boolean
public boolean

Returns:

True if relative redirection locations are allowed
isRelativeRedirectAllowed
()

public boolean
public boolean
public boolean

Returns:

true if this list contained the specified element
removeComplianceViolationListener
(ComplianceViolation.Listener
the listener to remove
listener
)

Remove a ComplianceViolation.Listener from the configuration

public boolean
public void
setCustomizers(List<HttpConfiguration.Customizer>
the list of customizers
customizers
)

Sets the Customizers that are invoked for every request received.

public void
setDelayDispatchUntilContent(boolean
if true, delays the application dispatch until content is available (defaults to true)
delay
)

Set if true, delays the application dispatch until content is available (defaults to true).

public void
setFormEncodedMethods(String...
the HTTP methods of requests that can be decoded as x-www-form-urlencoded content.
methods
)

Sets the form encoded HTTP methods.

public void
setHeaderCacheCaseSensitive(boolean headerCacheCaseSensitive)

public void
setHeaderCacheSize(int
The size of the header field cache, in terms of unique characters branches in the lookup Index.Mutable and associated data structures.
headerCacheSize
)

public void
public void
setIdleTimeout(long
the max idle time in ms or if == 0 implies an infinite timeout, <0 implies no HTTP channel timeout and the connection timeout is used instead.
timeoutMs
)

The max idle time is applied to an HTTP request for IO operations and delayed dispatch.

public void
setLocalAddress(SocketAddress
the address to use for host/addr/port, or null to reset to default behavior
localAddress
)

Specify the connection local address used within application API layer when identifying the local host name/port of a connected endpoint.

public void
setMaxErrorDispatches(int
The maximum error dispatches for a request to prevent looping on an error
max
)

public void
setMaxUnconsumedRequestContentReads(int
the maximum amount of reads for unconsumed content or -1 for unlimited.
maxUnconsumedRequestContentReads
)

Sets the maximum amount of HttpStream#read()s that can be done by the HttpStream if the content is not fully consumed by the application.

public void
setMinRequestDataRate(long
The minimum request data rate in bytes per second; or <=0 for no limit
bytesPerSecond
)

public void
setMinResponseDataRate(long
The minimum response data rate in bytes per second; or <=0 for no limit
bytesPerSecond
)

Sets an minimum response content data rate.

public void
setMultiPartCompliance(MultiPartCompliance
the MultiPartCompliance used for validating multipart form syntax.
multiPartCompliance
)

public void
setNotifyRemoteAsyncErrors(boolean
whether remote errors, when detected, are notified to async applications
notifyRemoteAsyncErrors
)

Set whether remote errors, when detected, are notified to async applications.

public void
setOutputAggregationSize(int
the max write size that is aggregated
outputAggregationSize
)

Set the max size of the response content write that is copied into the aggregate buffer.

public void
setOutputBufferSize(int
buffer size in bytes.
outputBufferSize
)

Set the size of the buffer into which response content is aggregated before being sent to the client.

public void
setPersistentConnectionsEnabled(boolean persistentConnectionsEnabled)

public void
setRelativeRedirectAllowed(boolean
True if relative redirection locations are allowed
allowed
)

public void
setRequestCookieCompliance(CookieCompliance
The CookieCompliance to use for parsing request Cookie headers.
cookieCompliance
)

public void
setRequestHeaderSize(int
the maximum size in bytes of the request header
requestHeaderSize
)

Larger headers will allow for more and/or larger cookies plus larger form content encoded in a URL.

public void
setResponseCookieCompliance(CookieCompliance
The CookieCompliance to use for generating response Set-Cookie headers
cookieCompliance
)

public void
setResponseHeaderSize(int
the maximum size in bytes of the response header
responseHeaderSize
)

Larger headers will allow for more and/or larger cookies and longer HTTP headers (eg for redirection).

public void
setSecurePort(int
the secure port to redirect to.
securePort
)

Sets the TCP/IP port used for CONFIDENTIAL and INTEGRAL redirections.

public void
setSecureScheme(String
A scheme string like "https"
secureScheme
)

Set the URI scheme used for CONFIDENTIAL and INTEGRAL redirections.

public void
setSendDateHeader(boolean
true if the Date header should be sent in responses
sendDateHeader
)

Indicates if the Date header should be sent in responses.

public void
setSendServerVersion(boolean sendServerVersion)

public void
setSendXPoweredBy(boolean sendXPoweredBy)

public void
setServerAuthority(HostPort
the authority host (and optional port), or null to reset to default behavior
authority
)

Specify the connection server authority (name/port) used within application API layer when identifying the server host name/port of a connected endpoint.

public void
public void
setUseInputDirectByteBuffers(boolean
whether to use direct ByteBuffers for reading
useInputDirectByteBuffers
)

Set whether to use direct ByteBuffers for reading.

public void
setUseOutputDirectByteBuffers(boolean
whether to use direct ByteBuffers for writing
useOutputDirectByteBuffers
)

Set whether to use direct ByteBuffers for writing.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
writePoweredBy(Appendable out, String preamble, String postamble)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait