Package io.servicetalk.http.netty
Class H1ProtocolConfigBuilder
- java.lang.Object
-
- io.servicetalk.http.netty.H1ProtocolConfigBuilder
-
public final class H1ProtocolConfigBuilder extends java.lang.ObjectBuilder forH1ProtocolConfig.- See Also:
HttpProtocolConfigs.h1()
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description H1ProtocolConfigbuild()BuildsH1ProtocolConfig.H1ProtocolConfigBuilderheadersEncodedSizeEstimate(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.H1ProtocolConfigBuilderheadersFactory(HttpHeadersFactory headersFactory)Sets theHttpHeadersFactoryto be used for creatingHttpHeaderswhen decoding HTTP messages.H1ProtocolConfigBuildermaxHeaderFieldLength(int maxHeaderFieldLength)Sets the maximum length of the HTTP header fields and trailer fields to parse.H1ProtocolConfigBuildermaxPipelinedRequests(int maxPipelinedRequests)Sets the maximum number of pipelined HTTP requests to queue up.H1ProtocolConfigBuildermaxStartLineLength(int maxStartLineLength)Sets the maximum length of the HTTP start line for an HTTP message.H1ProtocolConfigBuilderspecExceptions(H1SpecExceptions specExceptions)Sets additional exceptions for HTTP/1.1 specification.H1ProtocolConfigBuildertrailersEncodedSizeEstimate(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 theHttpHeadersFactoryto be used for creatingHttpHeaderswhen decoding HTTP messages.- Parameters:
headersFactory-HttpHeadersFactoryto be used for creatingHttpHeaderswhen 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,
1means pipelining is disabled and requests/responses are processed sequentially.Note:
reserved connectionswill 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
TooLongFrameExceptionif 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
TooLongFrameExceptionif 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
-
-