Class Http2SubStream

java.lang.Object
org.apache.pekko.http.impl.engine.http2.Http2SubStream
All Implemented Interfaces:
Serializable, scala.Equals, scala.Product

public class Http2SubStream extends Object implements scala.Product, Serializable
Represents one direction of an Http2 substream.
See Also:
  • Constructor Details

  • Method Details

    • apply

      public static Http2SubStream apply(HttpEntity entity, FrameEvent.ParsedHeadersFrame headers, org.apache.pekko.util.OptionVal<FrameEvent.ParsedHeadersFrame> trailingHeaders, scala.collection.immutable.Map<AttributeKey<?>,Object> correlationAttributes)
    • initialHeaders

      public FrameEvent.ParsedHeadersFrame initialHeaders()
    • trailingHeaders

      public org.apache.pekko.util.OptionVal<FrameEvent.ParsedHeadersFrame> trailingHeaders()
    • data

      public scala.util.Either<org.apache.pekko.util.ByteString,org.apache.pekko.stream.scaladsl.Source<Object,Object>> data()
    • correlationAttributes

      public scala.collection.immutable.Map<AttributeKey<?>,Object> correlationAttributes()
    • streamId

      public int streamId()
    • hasEntity

      public boolean hasEntity()
    • withCorrelationAttributes

      public Http2SubStream withCorrelationAttributes(scala.collection.immutable.Map<AttributeKey<?>,Object> newAttributes)
    • withoutData

      public Http2SubStream withoutData()
      Returns a copy that carries no data and ends the stream with its initial headers. The header pairs are kept as they are, so that a response keeps advertising the content-length the peer would have received otherwise.

      Used for responses to HEAD requests, which must not carry content (RFC 9110 section 9.3.2). The caller is responsible for cancelling data if it is a stream.

      Returns:
      (undocumented)
    • createEntity

      public RequestEntity createEntity(long contentLength, org.apache.pekko.util.OptionVal<ContentType> contentTypeOption)
      Create the request entity (when we're the server) or response entity (when we're the client) for this substream
      Parameters:
      contentLength - (undocumented)
      contentTypeOption - (undocumented)
      Returns:
      (undocumented)