Class H1ProtocolConfigBuilder

java.lang.Object
io.servicetalk.http.netty.H1ProtocolConfigBuilder

public final class H1ProtocolConfigBuilder extends Object
Builder for H1ProtocolConfig.
See Also:
  • Method Details

    • headersFactory

      public H1ProtocolConfigBuilder headersFactory(HttpHeadersFactory headersFactory)
      Sets the HttpHeadersFactory to be used for creating HttpHeaders when decoding HTTP messages.
      Parameters:
      headersFactory - HttpHeadersFactory to be used for creating HttpHeaders 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()
      Returns:
      a new H1ProtocolConfig