Interface Stream.Listener

All Known Implementing Classes:
HTTP2ServerConnectionFactory.HTTPServerSessionListener, HttpReceiverOverHTTP2, Stream.Listener.Adapter
Enclosing interface:
Stream

public static interface Stream.Listener

A Stream.Listener is the passive counterpart of a Stream and receives events happening on an HTTP/2 stream.

See Also:
  • Method Details

    • onNewStream

      default void onNewStream(Stream stream)

      Callback method invoked when a stream is created locally by Session.newStream(HeadersFrame, Promise, Listener).

      Parameters:
      stream - the newly created stream
    • onHeaders

      void onHeaders(Stream stream, HeadersFrame frame)

      Callback method invoked when a HEADERS frame representing the HTTP response has been received.

      Parameters:
      stream - the stream
      frame - the HEADERS frame received
    • onPush

      Stream.Listener onPush(Stream stream, PushPromiseFrame frame)

      Callback method invoked when a PUSH_PROMISE frame has been received.

      Parameters:
      stream - the stream
      frame - the PUSH_PROMISE frame received
      Returns:
      a Stream.Listener that will be notified of pushed stream events
    • onData

      void onData(Stream stream, DataFrame frame, org.eclipse.jetty.util.Callback callback)

      Callback method invoked when a DATA frame has been received.

      Parameters:
      stream - the stream
      frame - the DATA frame received
      callback - the callback to complete when the bytes of the DATA frame have been consumed
    • onReset

      default void onReset(Stream stream, ResetFrame frame, org.eclipse.jetty.util.Callback callback)

      Callback method invoked when a RST_STREAM frame has been received for this stream.

      Parameters:
      stream - the stream
      frame - the RST_FRAME received
      callback - the callback to complete when the reset has been handled
    • onReset

      default void onReset(Stream stream, ResetFrame frame)

      Callback method invoked when a RST_STREAM frame has been received for this stream.

      Parameters:
      stream - the stream
      frame - the RST_FRAME received
      See Also:
    • onTimeout

      @Deprecated default void onTimeout(Stream stream, Throwable x)
      Deprecated.

      Callback method invoked when the stream exceeds its idle timeout.

      Parameters:
      stream - the stream
      x - the timeout failure
      See Also:
    • onIdleTimeout

      default boolean onIdleTimeout(Stream stream, Throwable x)

      Callback method invoked when the stream exceeds its idle timeout.

      Parameters:
      stream - the stream
      x - the timeout failure
      Returns:
      true to reset the stream, false to ignore the idle timeout
      See Also:
    • onFailure

      default void onFailure(Stream stream, int error, String reason, Throwable failure, org.eclipse.jetty.util.Callback callback)

      Callback method invoked when the stream failed.

      Parameters:
      stream - the stream
      error - the error code
      reason - the error reason, or null
      failure - the failure
      callback - the callback to complete when the failure has been handled
    • onFailure

      @Deprecated default void onFailure(Stream stream, int error, String reason, org.eclipse.jetty.util.Callback callback)

      Callback method invoked when the stream failed.

      Parameters:
      stream - the stream
      error - the error code
      reason - the error reason, or null
      callback - the callback to complete when the failure has been handled
    • onClosed

      default void onClosed(Stream stream)

      Callback method invoked after the stream has been closed.

      Parameters:
      stream - the stream