Class HttpConfiguration
- java.lang.Object
-
- org.eclipse.jetty.server.HttpConfiguration
-
- All Implemented Interfaces:
Dumpable
@ManagedObject("HTTP Configuration") @Deprecated(since="2021-05-27") public class HttpConfiguration extends java.lang.Object implements Dumpable
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.HTTP Configuration.This class is a holder of HTTP configuration for use by the
HttpChannel
class. Typically an HTTPConfiguration instance is instantiated and passed to aHttpConfiguration.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 Class Summary
Nested Classes Modifier and Type Class Description static interface
HttpConfiguration.ConnectionFactory
Deprecated.static interface
HttpConfiguration.Customizer
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SERVER_VERSION
Deprecated.
-
Constructor Summary
Constructors Constructor Description HttpConfiguration()
Deprecated.HttpConfiguration(HttpConfiguration config)
Deprecated.Creates a configuration from another.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addCustomizer(HttpConfiguration.Customizer customizer)
Deprecated.Adds aHttpConfiguration.Customizer
that is invoked for every request received.void
addFormEncodedMethod(java.lang.String method)
Deprecated.Adds a form encoded HTTP Methodjava.lang.String
dump()
Deprecated.void
dump(java.lang.Appendable out, java.lang.String indent)
Deprecated.Dump this object (and children) into an Appendable using the provided indent after any new lines.long
getBlockingTimeout()
Deprecated.Replaced bygetMinResponseDataRate()
andgetMinRequestDataRate()
CookieCompliance
getCookieCompliance()
Deprecated.<T> T
getCustomizer(java.lang.Class<T> type)
Deprecated.java.util.List<HttpConfiguration.Customizer>
getCustomizers()
Deprecated.java.util.Set<java.lang.String>
getFormEncodedMethods()
Deprecated.int
getHeaderCacheSize()
Deprecated.long
getIdleTimeout()
Deprecated.The max idle time is applied to an HTTP request for IO operations and delayed dispatch.java.net.SocketAddress
getLocalAddress()
Deprecated.Get the SocketAddress override to be reported as the local address of all connectionsint
getMaxErrorDispatches()
Deprecated.long
getMinRequestDataRate()
Deprecated.long
getMinResponseDataRate()
Deprecated.MultiPartFormDataCompliance
getMultipartFormDataCompliance()
Deprecated.int
getOutputAggregationSize()
Deprecated.int
getOutputBufferSize()
Deprecated.CookieCompliance
getRequestCookieCompliance()
Deprecated.int
getRequestHeaderSize()
Deprecated.CookieCompliance
getResponseCookieCompliance()
Deprecated.int
getResponseHeaderSize()
Deprecated.int
getSecurePort()
Deprecated.java.lang.String
getSecureScheme()
Deprecated.boolean
getSendDateHeader()
Deprecated.Indicates if theDate
header will be sent in responses.boolean
getSendServerVersion()
Deprecated.boolean
getSendXPoweredBy()
Deprecated.HostPort
getServerAuthority()
Deprecated.Get the Server authority override to be used if no authority is provided by a request.boolean
isCookieCompliance(CookieCompliance compliance)
Deprecated.boolean
isDelayDispatchUntilContent()
Deprecated.boolean
isFormEncodedMethod(java.lang.String method)
Deprecated.Tests whether the HTTP method supportsx-www-form-urlencoded
contentboolean
isNotifyRemoteAsyncErrors()
Deprecated.boolean
isPersistentConnectionsEnabled()
Deprecated.boolean
isRelativeRedirectAllowed()
Deprecated.void
setBlockingTimeout(long blockingTimeout)
Deprecated.Replaced bysetMinResponseDataRate(long)
andsetMinRequestDataRate(long)
void
setCookieCompliance(CookieCompliance compliance)
Deprecated.void
setCustomizers(java.util.List<HttpConfiguration.Customizer> customizers)
Deprecated.Sets theHttpConfiguration.Customizer
s that are invoked for every request received.void
setDelayDispatchUntilContent(boolean delay)
Deprecated.void
setFormEncodedMethods(java.lang.String... methods)
Deprecated.Sets the form encoded HTTP methods.void
setHeaderCacheSize(int headerCacheSize)
Deprecated.void
setIdleTimeout(long timeoutMs)
Deprecated.The max idle time is applied to an HTTP request for IO operations and delayed dispatch.void
setLocalAddress(java.net.SocketAddress localAddress)
Deprecated.Specify the connection local address used within application API layer when identifying the local host name/port of a connected endpoint.void
setMaxErrorDispatches(int max)
Deprecated.void
setMinRequestDataRate(long bytesPerSecond)
Deprecated.void
setMinResponseDataRate(long bytesPerSecond)
Deprecated.Sets an minimum response content data rate.void
setMultiPartFormDataCompliance(MultiPartFormDataCompliance multiPartCompliance)
Deprecated.Sets the compliance level for multipart/form-data handling.void
setNotifyRemoteAsyncErrors(boolean notifyRemoteAsyncErrors)
Deprecated.void
setOutputAggregationSize(int outputAggregationSize)
Deprecated.Set the max size of the response content write that is copied into the aggregate buffer.void
setOutputBufferSize(int outputBufferSize)
Deprecated.Set the size of the buffer into which response content is aggregated before being sent to the client.void
setPersistentConnectionsEnabled(boolean persistentConnectionsEnabled)
Deprecated.void
setRelativeRedirectAllowed(boolean allowed)
Deprecated.void
setRequestCookieCompliance(CookieCompliance cookieCompliance)
Deprecated.void
setRequestHeaderSize(int requestHeaderSize)
Deprecated.Larger headers will allow for more and/or larger cookies plus larger form content encoded in a URL.void
setResponseCookieCompliance(CookieCompliance cookieCompliance)
Deprecated.void
setResponseHeaderSize(int responseHeaderSize)
Deprecated.Larger headers will allow for more and/or larger cookies and longer HTTP headers (eg for redirection).void
setSecurePort(int securePort)
Deprecated.Sets the TCP/IP port used for CONFIDENTIAL and INTEGRAL redirections.void
setSecureScheme(java.lang.String secureScheme)
Deprecated.Set the URI scheme used for CONFIDENTIAL and INTEGRAL redirections.void
setSendDateHeader(boolean sendDateHeader)
Deprecated.Indicates if theDate
header should be sent in responses.void
setSendServerVersion(boolean sendServerVersion)
Deprecated.void
setSendXPoweredBy(boolean sendXPoweredBy)
Deprecated.void
setServerAuthority(HostPort authority)
Deprecated.Specify the connection server authority (name/port) used within application API layer when identifying the server host name/port of a connected endpoint.java.lang.String
toString()
Deprecated.void
writePoweredBy(java.lang.Appendable out, java.lang.String preamble, java.lang.String postamble)
Deprecated.
-
-
-
Constructor Detail
-
HttpConfiguration
public HttpConfiguration()
Deprecated.
-
HttpConfiguration
public HttpConfiguration(HttpConfiguration config)
Deprecated.Creates a configuration from another.- Parameters:
config
- The configuration to copy.
-
-
Method Detail
-
addCustomizer
public void addCustomizer(HttpConfiguration.Customizer customizer)
Deprecated.Adds a
HttpConfiguration.Customizer
that is invoked for every request received.Customizers are often used to interpret optional headers (eg
ForwardedRequestCustomizer
) or optional protocol semantics (egSecureRequestCustomizer
).- Parameters:
customizer
- A request customizer
-
getCustomizers
public java.util.List<HttpConfiguration.Customizer> getCustomizers()
Deprecated.
-
getCustomizer
public <T> T getCustomizer(java.lang.Class<T> type)
Deprecated.
-
getOutputBufferSize
@ManagedAttribute("The size in bytes of the output buffer used to aggregate HTTP output") public int getOutputBufferSize()
Deprecated.
-
getOutputAggregationSize
@ManagedAttribute("The maximum size in bytes for HTTP output to be aggregated") public int getOutputAggregationSize()
Deprecated.
-
getRequestHeaderSize
@ManagedAttribute("The maximum allowed size in bytes for an HTTP request header") public int getRequestHeaderSize()
Deprecated.
-
getResponseHeaderSize
@ManagedAttribute("The maximum allowed size in bytes for an HTTP response header") public int getResponseHeaderSize()
Deprecated.
-
getHeaderCacheSize
@ManagedAttribute("The maximum allowed size in Trie nodes for an HTTP header field cache") public int getHeaderCacheSize()
Deprecated.
-
getSecurePort
@ManagedAttribute("The port to which Integral or Confidential security constraints are redirected") public int getSecurePort()
Deprecated.
-
getSecureScheme
@ManagedAttribute("The scheme with which Integral or Confidential security constraints are redirected") public java.lang.String getSecureScheme()
Deprecated.
-
isPersistentConnectionsEnabled
@ManagedAttribute("Whether persistent connections are enabled") public boolean isPersistentConnectionsEnabled()
Deprecated.
-
getIdleTimeout
@ManagedAttribute("The idle timeout in ms for I/O operations during the handling of an HTTP request") public long getIdleTimeout()
Deprecated.The max idle time is applied to an HTTP request for IO operations and delayed dispatch.
- 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.
-
setIdleTimeout
public void setIdleTimeout(long timeoutMs)
Deprecated.The max idle time is applied to an HTTP request for IO operations and delayed dispatch.
- Parameters:
timeoutMs
- 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.
-
getBlockingTimeout
@ManagedAttribute(value="Total timeout in ms for blocking I/O operations. DEPRECATED!", readonly=true) @Deprecated public long getBlockingTimeout()
Deprecated.Replaced bygetMinResponseDataRate()
andgetMinRequestDataRate()
This timeout is in addition to the
Connector.getIdleTimeout()
, and applies to the total operation (as opposed to the idle timeout that applies to the time no data is being sent). This applies only to blocking operations and does not affect asynchronous read and write.- Returns:
- -1, for no blocking timeout (default), 0 for a blocking timeout equal to the idle timeout; >0 for a timeout in ms applied to the total blocking operation.
-
setBlockingTimeout
@Deprecated public void setBlockingTimeout(long blockingTimeout)
Deprecated.Replaced bysetMinResponseDataRate(long)
andsetMinRequestDataRate(long)
This timeout is in addition to the
Connector.getIdleTimeout()
, and applies to the total operation (as opposed to the idle timeout that applies to the time no data is being sent).This applies only to blocking operations and does not affect asynchronous read and write.- Parameters:
blockingTimeout
- -1, for no blocking timeout (default), 0 for a blocking timeout equal to the idle timeout; >0 for a timeout in ms applied to the total blocking operation.
-
setPersistentConnectionsEnabled
public void setPersistentConnectionsEnabled(boolean persistentConnectionsEnabled)
Deprecated.
-
setSendServerVersion
public void setSendServerVersion(boolean sendServerVersion)
Deprecated.
-
getSendServerVersion
@ManagedAttribute("Whether to send the Server header in responses") public boolean getSendServerVersion()
Deprecated.
-
writePoweredBy
public void writePoweredBy(java.lang.Appendable out, java.lang.String preamble, java.lang.String postamble) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
setSendXPoweredBy
public void setSendXPoweredBy(boolean sendXPoweredBy)
Deprecated.
-
getSendXPoweredBy
@ManagedAttribute("Whether to send the X-Powered-By header in responses") public boolean getSendXPoweredBy()
Deprecated.
-
setSendDateHeader
public void setSendDateHeader(boolean sendDateHeader)
Deprecated.Indicates if theDate
header should be sent in responses.- Parameters:
sendDateHeader
- true if theDate
header should be sent in responses- See Also:
- HTTP/1.1 Standard Header: Date,
getSendDateHeader()
-
getSendDateHeader
@ManagedAttribute("Whether to send the Date header in responses") public boolean getSendDateHeader()
Deprecated.Indicates if theDate
header will be sent in responses.- Returns:
- true by default
-
setDelayDispatchUntilContent
public void setDelayDispatchUntilContent(boolean delay)
Deprecated.- Parameters:
delay
- if true, delays the application dispatch until content is available (defaults to true)
-
isDelayDispatchUntilContent
@ManagedAttribute("Whether to delay the application dispatch until content is available") public boolean isDelayDispatchUntilContent()
Deprecated.
-
setCustomizers
public void setCustomizers(java.util.List<HttpConfiguration.Customizer> customizers)
Deprecated.Sets 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 (egSecureRequestCustomizer
).- Parameters:
customizers
- the list of customizers
-
setOutputBufferSize
public void setOutputBufferSize(int outputBufferSize)
Deprecated.Set the size of the buffer into which response content is aggregated before being sent to the client. A larger buffer can improve performance by allowing a content producer to run without blocking, however larger buffers consume more memory and may induce some latency before a client starts processing the content.- Parameters:
outputBufferSize
- buffer size in bytes.
-
setOutputAggregationSize
public void setOutputAggregationSize(int outputAggregationSize)
Deprecated.Set the max size of the response content write that is copied into the aggregate buffer. Writes that are smaller of this size are copied into the aggregate buffer, while writes that are larger of this size will cause the aggregate buffer to be flushed and the write to be executed without being copied.- Parameters:
outputAggregationSize
- the max write size that is aggregated
-
setRequestHeaderSize
public void setRequestHeaderSize(int requestHeaderSize)
Deprecated.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.
- Parameters:
requestHeaderSize
- the maximum size in bytes of the request header
-
setResponseHeaderSize
public void setResponseHeaderSize(int responseHeaderSize)
Deprecated.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.
- Parameters:
responseHeaderSize
- the maximum size in bytes of the response header
-
setHeaderCacheSize
public void setHeaderCacheSize(int headerCacheSize)
Deprecated.- Parameters:
headerCacheSize
- The size of the header field cache, in terms of unique characters branches in the lookupTrie
and associated data structures.
-
setSecurePort
public void setSecurePort(int securePort)
Deprecated.Sets the TCP/IP port used for CONFIDENTIAL and INTEGRAL redirections.
- Parameters:
securePort
- the secure port to redirect to.
-
setSecureScheme
public void setSecureScheme(java.lang.String secureScheme)
Deprecated.Set the URI scheme used for CONFIDENTIAL and INTEGRAL redirections.
- Parameters:
secureScheme
- A scheme string like "https"
-
setFormEncodedMethods
public void setFormEncodedMethods(java.lang.String... methods)
Deprecated.Sets the form encoded HTTP methods.- Parameters:
methods
- the HTTP methods of requests that can be decoded asx-www-form-urlencoded
content to be made available via theRequest.getParameter(String)
and associated APIs
-
getFormEncodedMethods
public java.util.Set<java.lang.String> getFormEncodedMethods()
Deprecated.- Returns:
- the set of HTTP methods of requests that can be decoded as
x-www-form-urlencoded
content to be made available via theRequest.getParameter(String)
and associated APIs
-
addFormEncodedMethod
public void addFormEncodedMethod(java.lang.String method)
Deprecated.Adds a form encoded HTTP Method- Parameters:
method
- the HTTP method of requests that can be decoded asx-www-form-urlencoded
content to be made available via theRequest.getParameter(String)
and associated APIs
-
isFormEncodedMethod
public boolean isFormEncodedMethod(java.lang.String method)
Deprecated.Tests whether the HTTP method supportsx-www-form-urlencoded
content- Parameters:
method
- the HTTP method- Returns:
- true if requests with this method can be
decoded as
x-www-form-urlencoded
content to be made available via theRequest.getParameter(String)
and associated APIs
-
getMaxErrorDispatches
@ManagedAttribute("The maximum ERROR dispatches for a request for loop prevention (default 10)") public int getMaxErrorDispatches()
Deprecated.- Returns:
- The maximum error dispatches for a request to prevent looping on an error
-
setMaxErrorDispatches
public void setMaxErrorDispatches(int max)
Deprecated.- Parameters:
max
- The maximum error dispatches for a request to prevent looping on an error
-
getMinRequestDataRate
@ManagedAttribute("The minimum request content data rate in bytes per second") public long getMinRequestDataRate()
Deprecated.- Returns:
- The minimum request data rate in bytes per second; or <=0 for no limit
-
setMinRequestDataRate
public void setMinRequestDataRate(long bytesPerSecond)
Deprecated.- Parameters:
bytesPerSecond
- The minimum request data rate in bytes per second; or <=0 for no limit
-
getMinResponseDataRate
@ManagedAttribute("The minimum response content data rate in bytes per second") public long getMinResponseDataRate()
Deprecated.- Returns:
- The minimum response data rate in bytes per second; or <=0 for no limit
-
setMinResponseDataRate
public void setMinResponseDataRate(long bytesPerSecond)
Deprecated.Sets an minimum response content data rate.
The value is enforced only approximately - not precisely - due to the fact that for efficiency reasons buffer writes may be comprised of both response headers and response content.
- Parameters:
bytesPerSecond
- The minimum response data rate in bytes per second; or <=0 for no limit
-
getRequestCookieCompliance
public CookieCompliance getRequestCookieCompliance()
Deprecated.- Returns:
- The CookieCompliance used for parsing request
Cookie
headers. - See Also:
getResponseCookieCompliance()
-
getResponseCookieCompliance
public CookieCompliance getResponseCookieCompliance()
Deprecated.- Returns:
- The CookieCompliance used for generating response
Set-Cookie
headers - See Also:
getRequestCookieCompliance()
-
setRequestCookieCompliance
public void setRequestCookieCompliance(CookieCompliance cookieCompliance)
Deprecated.- Parameters:
cookieCompliance
- The CookieCompliance to use for parsing requestCookie
headers.- See Also:
setRequestCookieCompliance(CookieCompliance)
-
setResponseCookieCompliance
public void setResponseCookieCompliance(CookieCompliance cookieCompliance)
Deprecated.- Parameters:
cookieCompliance
- The CookieCompliance to use for generating responseSet-Cookie
headers- See Also:
setResponseCookieCompliance(CookieCompliance)
-
setCookieCompliance
@Deprecated public void setCookieCompliance(CookieCompliance compliance)
Deprecated.
-
getCookieCompliance
@Deprecated public CookieCompliance getCookieCompliance()
Deprecated.
-
isCookieCompliance
@Deprecated public boolean isCookieCompliance(CookieCompliance compliance)
Deprecated.
-
setMultiPartFormDataCompliance
public void setMultiPartFormDataCompliance(MultiPartFormDataCompliance multiPartCompliance)
Deprecated.Sets the compliance level for multipart/form-data handling.- Parameters:
multiPartCompliance
- The multipart/form-data compliance level.
-
getMultipartFormDataCompliance
public MultiPartFormDataCompliance getMultipartFormDataCompliance()
Deprecated.
-
setNotifyRemoteAsyncErrors
public void setNotifyRemoteAsyncErrors(boolean notifyRemoteAsyncErrors)
Deprecated.- Parameters:
notifyRemoteAsyncErrors
- whether remote errors, when detected, are notified to async applications
-
isNotifyRemoteAsyncErrors
@ManagedAttribute("Whether remote errors, when detected, are notified to async applications") public boolean isNotifyRemoteAsyncErrors()
Deprecated.- Returns:
- whether remote errors, when detected, are notified to async applications
-
setRelativeRedirectAllowed
public void setRelativeRedirectAllowed(boolean allowed)
Deprecated.- Parameters:
allowed
- True if relative redirection locations are allowed
-
isRelativeRedirectAllowed
@ManagedAttribute("Whether relative redirection locations are allowed") public boolean isRelativeRedirectAllowed()
Deprecated.- Returns:
- True if relative redirection locations are allowed
-
getLocalAddress
@ManagedAttribute("Local SocketAddress override") public java.net.SocketAddress getLocalAddress()
Deprecated.Get the SocketAddress override to be reported as the local address of all connections- Returns:
- Returns the connection local address override or null.
-
setLocalAddress
public void setLocalAddress(java.net.SocketAddress localAddress)
Deprecated.Specify the connection local address used within application API layer when identifying the local host name/port of a connected endpoint.
This allows an override of higher level APIs, such as
ServletRequest.getLocalName()
,ServletRequest.getLocalAddr()
, andServletRequest.getLocalPort()
.- Parameters:
localAddress
- the address to use for host/addr/port, or null to reset to default behavior
-
getServerAuthority
@ManagedAttribute("The server authority if none provided by requests") public HostPort getServerAuthority()
Deprecated.Get the Server authority override to be used if no authority is provided by a request.- Returns:
- Returns the connection server authority (name/port) or null
-
setServerAuthority
public void setServerAuthority(HostPort authority)
Deprecated.Specify the connection server authority (name/port) used within application API layer when identifying the server host name/port of a connected endpoint.
This allows an override of higher level APIs, such as
ServletRequest.getServerName()
, andServletRequest.getServerPort()
.- Parameters:
authority
- the authority host (and optional port), or null to reset to default behavior
-
dump
public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOException
Deprecated.Description copied from interface:Dumpable
Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toString
in classjava.lang.Object
-
-