Package io.servicetalk.http.netty
Class H1ProtocolConfigBuilder
- java.lang.Object
-
- io.servicetalk.http.netty.H1ProtocolConfigBuilder
-
public final class H1ProtocolConfigBuilder extends java.lang.Object
Builder forH1ProtocolConfig
.- See Also:
HttpProtocolConfigs.h1()
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description H1ProtocolConfig
build()
BuildsH1ProtocolConfig
.H1ProtocolConfigBuilder
headersEncodedSizeEstimate(int headersEncodedSizeEstimate)
Sets the value used to calculate an exponential moving average of the encoded size of the HTTP start line and header fields for a guess for future buffer allocations.H1ProtocolConfigBuilder
headersFactory(HttpHeadersFactory headersFactory)
Sets theHttpHeadersFactory
to be used for creatingHttpHeaders
when decoding HTTP messages.H1ProtocolConfigBuilder
maxHeaderFieldLength(int maxHeaderFieldLength)
Sets the maximum length of the HTTP header fields and trailer fields to parse.H1ProtocolConfigBuilder
maxPipelinedRequests(int maxPipelinedRequests)
Sets the maximum number of pipelined HTTP requests to queue up.H1ProtocolConfigBuilder
maxStartLineLength(int maxStartLineLength)
Sets the maximum length of the HTTP start line for an HTTP message.H1ProtocolConfigBuilder
specExceptions(H1SpecExceptions specExceptions)
Sets additional exceptions for HTTP/1.1 specification.H1ProtocolConfigBuilder
trailersEncodedSizeEstimate(int trailersEncodedSizeEstimate)
Sets the value used to calculate an exponential moving average of the encoded size of the HTTP trailer fields for a guess for future buffer allocations.
-
-
-
Method Detail
-
headersFactory
public H1ProtocolConfigBuilder headersFactory(HttpHeadersFactory headersFactory)
Sets theHttpHeadersFactory
to be used for creatingHttpHeaders
when decoding HTTP messages.- Parameters:
headersFactory
-HttpHeadersFactory
to be used for creatingHttpHeaders
when decoding HTTP messages- Returns:
this
-
maxPipelinedRequests
public H1ProtocolConfigBuilder maxPipelinedRequests(int maxPipelinedRequests)
Sets the maximum number of pipelined HTTP requests to queue up.Anything above this value will be rejected,
1
means pipelining is disabled and requests/responses are processed sequentially.Note:
reserved connections
will not be restricted by this setting.- Parameters:
maxPipelinedRequests
- maximum number of pipelined requests to queue up- Returns:
this
-
maxStartLineLength
public H1ProtocolConfigBuilder maxStartLineLength(int maxStartLineLength)
Sets the maximum length of the HTTP start line for an HTTP message.Note: a decoder will close the connection with
TooLongFrameException
if the start line exceeds this value.- Parameters:
maxStartLineLength
- maximum size of the HTTP start line for an HTTP message- Returns:
this
-
maxHeaderFieldLength
public H1ProtocolConfigBuilder maxHeaderFieldLength(int maxHeaderFieldLength)
Sets the maximum length of the HTTP header fields and trailer fields to parse.Note: a decoder will close the connection with
TooLongFrameException
if the length of a header or trailer field exceeds this value.- Parameters:
maxHeaderFieldLength
- maximum length of HTTP header fields and trailer fields to parse- Returns:
this
-
headersEncodedSizeEstimate
public H1ProtocolConfigBuilder headersEncodedSizeEstimate(int headersEncodedSizeEstimate)
Sets the value used to calculate an exponential moving average of the encoded size of the HTTP start line and header fields for a guess for future buffer allocations.- Parameters:
headersEncodedSizeEstimate
- value used to calculate an exponential moving average of the encoded size of the HTTP start line and header fields- Returns:
this
-
trailersEncodedSizeEstimate
public H1ProtocolConfigBuilder trailersEncodedSizeEstimate(int trailersEncodedSizeEstimate)
Sets the value used to calculate an exponential moving average of the encoded size of the HTTP trailer fields for a guess for future buffer allocations.- Parameters:
trailersEncodedSizeEstimate
- value used to calculate an exponential moving average of the encoded size of the HTTP trailer fields- Returns:
this
-
specExceptions
public H1ProtocolConfigBuilder specExceptions(H1SpecExceptions specExceptions)
Sets additional exceptions for HTTP/1.1 specification.- Parameters:
specExceptions
- exceptions for HTTP/1.1 specification- Returns:
this
-
build
public H1ProtocolConfig build()
BuildsH1ProtocolConfig
.- Returns:
- a new
H1ProtocolConfig
-
-