Interface Http2Stream

All Known Implementing Classes:
DefaultHttp2Connection.ConnectionStream, DefaultHttp2Connection.DefaultStream

public interface Http2Stream
A single stream within an HTTP2 connection. Streams are compared to each other by priority.
  • Method Details

    • id

      int id()
      Gets the unique identifier for this stream within the connection.
    • state

      Gets the state of this stream.
    • open

      Http2Stream open(boolean halfClosed) throws Http2Exception
      Opens this stream, making it available via Http2Connection.forEachActiveStream(Http2StreamVisitor) and transition state to:
      Throws:
      Http2Exception
    • close

      Http2Stream close()
      Closes the stream.
    • closeLocalSide

      Http2Stream closeLocalSide()
      Closes the local side of this stream. If this makes the stream closed, the child is closed as well.
    • closeRemoteSide

      Http2Stream closeRemoteSide()
      Closes the remote side of this stream. If this makes the stream closed, the child is closed as well.
    • isResetSent

      boolean isResetSent()
      Indicates whether a RST_STREAM frame has been sent from the local endpoint for this stream.
    • resetSent

      Http2Stream resetSent()
      Sets the flag indicating that a RST_STREAM frame has been sent from the local endpoint for this stream. This does not affect the stream state.
    • setProperty

      <V> V setProperty(Http2Connection.PropertyKey key, V value)
      Associates the application-defined data with this stream.
      Returns:
      The value that was previously associated with key, or null if there was none.
    • getProperty

      <V> V getProperty(Http2Connection.PropertyKey key)
      Returns application-defined data if any was associated with this stream.
    • removeProperty

      <V> V removeProperty(Http2Connection.PropertyKey key)
      Returns and removes application-defined data if any was associated with this stream.
    • headersSent

      Http2Stream headersSent(boolean isInformational)
      Indicates that headers have been sent to the remote endpoint on this stream. The first call to this method would be for the initial headers (see isHeadersSent()} and the second call would indicate the trailers (see isTrailersReceived()).
      Parameters:
      isInformational - true if the headers contain an informational status code (for responses only).
    • isHeadersSent

      boolean isHeadersSent()
      Indicates whether or not headers were sent to the remote endpoint.
    • isTrailersSent

      boolean isTrailersSent()
      Indicates whether or not trailers were sent to the remote endpoint.
    • headersReceived

      Http2Stream headersReceived(boolean isInformational)
      Indicates that headers have been received. The first call to this method would be for the initial headers (see isHeadersReceived()} and the second call would indicate the trailers (see isTrailersReceived()).
      Parameters:
      isInformational - true if the headers contain an informational status code (for responses only).
    • isHeadersReceived

      boolean isHeadersReceived()
      Indicates whether or not the initial headers have been received.
    • isTrailersReceived

      boolean isTrailersReceived()
      Indicates whether or not the trailers have been received.
    • pushPromiseSent

      Http2Stream pushPromiseSent()
      Indicates that a push promise was sent to the remote endpoint.
    • isPushPromiseSent

      boolean isPushPromiseSent()
      Indicates whether or not a push promise was sent to the remote endpoint.