Top Description Fields Constructors Methods
reactor.netty.http

public abstract Class HttpDecoderSpec<T extends reactor.netty.http.HttpDecoderSpec<T>>

extends Object
implements Supplier<T extends HttpDecoderSpec<T>>
Class Inheritance
All Implemented Interfaces
java.util.function.Supplier
Known Direct Subclasses
reactor.netty.http.client.HttpResponseDecoderSpec, reactor.netty.http.server.HttpRequestDecoderSpec
Imports
java.util.function.Supplier

A configuration builder to fine tune the HttpCodec (or more precisely the settings for the decoder).
Author
Violeta Georgieva

Field Summary

Modifier and TypeField and Description
protected boolean
public static final boolean
public static final int
public static final int
DEFAULT_MAX_CHUNK_SIZE

Default max chunk size.

public static final int
public static final int
public static final boolean
protected int
protected int
protected int
protected int
protected int
protected boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

this option builder for further configuration
allowDuplicateContentLengths
(boolean
true to allow duplicate Content-Length headers with the same value, false otherwise
allow
)

Configure whether to allow duplicate Content-Length headers.

public boolean

Returns:

the configuration whether to allow duplicate Content-Length headers
allowDuplicateContentLengths
()

Return the configuration whether to allow duplicate Content-Length headers.

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public T

Returns:

this builder for further configuration
h2cMaxContentLength
(int
the maximum length of the content of the upgrade request
h2cMaxContentLength
)

Configure the maximum length of the content of the HTTP/2.0 clear-text upgrade request.

public int

Returns:

the configured maximum length of the content of the HTTP/2.0 clear-text upgrade request
h2cMaxContentLength
()

Return the configured maximum length of the content of the HTTP/2.0 clear-text upgrade request.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public T

Returns:

this option builder for further configuration
initialBufferSize
(int
the initial buffer size to use (strictly positive)
value
)

Configure the initial buffer size for HTTP request decoding.

public int

Returns:

the configured initial buffer size for HTTP request decoding
initialBufferSize
()

Return the configured initial buffer size for HTTP request decoding.

public T

Returns:

this option builder for further configuration
maxChunkSize
(int
the value for the maximum chunk size (strictly positive)
value
)

Deprecated as of 1.1.0. This will be removed in 2.0.0 as Netty 5 does not support this configuration.
Configure the maximum chunk size that can be decoded for the HTTP request.
public int

Returns:

the configured maximum chunk size that can be decoded for the HTTP request
maxChunkSize
()

Deprecated as of 1.1.0. This will be removed in 2.0.0 as Netty 5 does not support this configuration.
Return the configured maximum chunk size that can be decoded for the HTTP request.
public T

Returns:

this option builder for further configuration
maxHeaderSize
(int
the value for the maximum header size (strictly positive)
value
)

Configure the maximum header size that can be decoded for the HTTP request.

public int

Returns:

the configured maximum header size that can be decoded for the HTTP request
maxHeaderSize
()

Return the configured maximum header size that can be decoded for the HTTP request.

public T

Returns:

this option builder for further configuration
maxInitialLineLength
(int
the value for the maximum initial line length (strictly positive)
value
)

Configure the maximum length that can be decoded for the HTTP request's initial line.

public int

Returns:

the configured maximum length that can be decoded for the HTTP request's initial line
maxInitialLineLength
()

Return the configured maximum length that can be decoded for the HTTP request's initial line.

public T

Returns:

this option builder for further configuration
validateHeaders
(boolean
true to validate headers, false otherwise
validate
)

Configure whether to validate headers when decoding requests.

public boolean

Returns:

the configuration whether to validate headers when decoding requests
validateHeaders
()

Return the configuration whether to validate headers when decoding requests.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

allowDuplicateContentLengthsback to summary
protected boolean allowDuplicateContentLengths
DEFAULT_ALLOW_DUPLICATE_CONTENT_LENGTHSback to summary
public static final boolean DEFAULT_ALLOW_DUPLICATE_CONTENT_LENGTHS
DEFAULT_INITIAL_BUFFER_SIZEback to summary
public static final int DEFAULT_INITIAL_BUFFER_SIZE
DEFAULT_MAX_CHUNK_SIZEback to summary
public static final int DEFAULT_MAX_CHUNK_SIZE

Deprecated

as of 1.1.0. This will be removed in 2.0.0 as Netty 5 does not support this configuration.

Default max chunk size.

Annotations
@Deprecated
DEFAULT_MAX_HEADER_SIZEback to summary
public static final int DEFAULT_MAX_HEADER_SIZE
DEFAULT_MAX_INITIAL_LINE_LENGTHback to summary
public static final int DEFAULT_MAX_INITIAL_LINE_LENGTH
DEFAULT_VALIDATE_HEADERSback to summary
public static final boolean DEFAULT_VALIDATE_HEADERS
h2cMaxContentLengthback to summary
protected int h2cMaxContentLength
initialBufferSizeback to summary
protected int initialBufferSize
maxChunkSizeback to summary
protected int maxChunkSize
maxHeaderSizeback to summary
protected int maxHeaderSize
maxInitialLineLengthback to summary
protected int maxInitialLineLength
validateHeadersback to summary
protected boolean validateHeaders

Constructor Detail

HttpDecoderSpecback to summary
public HttpDecoderSpec()

Method Detail

allowDuplicateContentLengthsback to summary
public T allowDuplicateContentLengths(boolean allow)

Configure whether to allow duplicate Content-Length headers. Defaults to DEFAULT_ALLOW_DUPLICATE_CONTENT_LENGTHS which means that a message with duplicate Content-Length headers is rejected. When this is configured to true, duplicate Content-Length headers are accepted only if they are all the same value, otherwise such message is rejected. The duplicated Content-Length headers are replaced with a single valid Content-Length header.

Parameters
allow:boolean

true to allow duplicate Content-Length headers with the same value, false otherwise

Returns:T

this option builder for further configuration

Since
1.0.8
allowDuplicateContentLengthsback to summary
public boolean allowDuplicateContentLengths()

Return the configuration whether to allow duplicate Content-Length headers.

Returns:boolean

the configuration whether to allow duplicate Content-Length headers

Since
1.0.8
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
h2cMaxContentLengthback to summary
public T h2cMaxContentLength(int h2cMaxContentLength)

Configure the maximum length of the content of the HTTP/2.0 clear-text upgrade request.

  • By default the server will reject an upgrade request with non-empty content, because the upgrade request is most likely a GET request. If the client sends a non-GET upgrade request, h2cMaxContentLength specifies the maximum length of the content of the upgrade request.
  • By default the client will allow an upgrade request with up to 65536 as the maximum length of the aggregated content.
Parameters
h2cMaxContentLength:int

the maximum length of the content of the upgrade request

Returns:T

this builder for further configuration

h2cMaxContentLengthback to summary
public int h2cMaxContentLength()

Return the configured maximum length of the content of the HTTP/2.0 clear-text upgrade request.

Returns:int

the configured maximum length of the content of the HTTP/2.0 clear-text upgrade request

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
initialBufferSizeback to summary
public T initialBufferSize(int value)

Configure the initial buffer size for HTTP request decoding. Defaults to DEFAULT_INITIAL_BUFFER_SIZE.

Parameters
value:int

the initial buffer size to use (strictly positive)

Returns:T

this option builder for further configuration

initialBufferSizeback to summary
public int initialBufferSize()

Return the configured initial buffer size for HTTP request decoding.

Returns:int

the configured initial buffer size for HTTP request decoding

maxChunkSizeback to summary
public T maxChunkSize(int value)

Deprecated

as of 1.1.0. This will be removed in 2.0.0 as Netty 5 does not support this configuration.

Configure the maximum chunk size that can be decoded for the HTTP request. Defaults to DEFAULT_MAX_CHUNK_SIZE.

Parameters
value:int

the value for the maximum chunk size (strictly positive)

Returns:T

this option builder for further configuration

Annotations
@Deprecated
maxChunkSizeback to summary
public int maxChunkSize()

Deprecated

as of 1.1.0. This will be removed in 2.0.0 as Netty 5 does not support this configuration.

Return the configured maximum chunk size that can be decoded for the HTTP request.

Returns:int

the configured maximum chunk size that can be decoded for the HTTP request

Annotations
@Deprecated
maxHeaderSizeback to summary
public T maxHeaderSize(int value)

Configure the maximum header size that can be decoded for the HTTP request. Defaults to DEFAULT_MAX_HEADER_SIZE.

Parameters
value:int

the value for the maximum header size (strictly positive)

Returns:T

this option builder for further configuration

maxHeaderSizeback to summary
public int maxHeaderSize()

Return the configured maximum header size that can be decoded for the HTTP request.

Returns:int

the configured maximum header size that can be decoded for the HTTP request

maxInitialLineLengthback to summary
public T maxInitialLineLength(int value)

Configure the maximum length that can be decoded for the HTTP request's initial line. Defaults to DEFAULT_MAX_INITIAL_LINE_LENGTH.

Parameters
value:int

the value for the maximum initial line length (strictly positive)

Returns:T

this option builder for further configuration

maxInitialLineLengthback to summary
public int maxInitialLineLength()

Return the configured maximum length that can be decoded for the HTTP request's initial line.

Returns:int

the configured maximum length that can be decoded for the HTTP request's initial line

validateHeadersback to summary
public T validateHeaders(boolean validate)

Configure whether to validate headers when decoding requests. Defaults to DEFAULT_VALIDATE_HEADERS.

Parameters
validate:boolean

true to validate headers, false otherwise

Returns:T

this option builder for further configuration

validateHeadersback to summary
public boolean validateHeaders()

Return the configuration whether to validate headers when decoding requests.

Returns:boolean

the configuration whether to validate headers when decoding requests