Interface Stream.Listener
- All Known Implementing Classes:
HTTP2ServerConnectionFactory.HTTPServerSessionListener,HttpReceiverOverHTTP2,Stream.Listener.Adapter
- Enclosing interface:
Stream
A Stream.Listener is the passive counterpart of a Stream and receives
events happening on an HTTP/2 stream.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault voidCallback method invoked after the stream has been closed.voidCallback method invoked when a DATA frame has been received.default voidonFailure(Stream stream, int error, String reason, Throwable failure, org.eclipse.jetty.util.Callback callback) Callback method invoked when the stream failed.default voidDeprecated.voidonHeaders(Stream stream, HeadersFrame frame) Callback method invoked when a HEADERS frame representing the HTTP response has been received.default booleanonIdleTimeout(Stream stream, Throwable x) Callback method invoked when the stream exceeds its idle timeout.default voidonNewStream(Stream stream) Callback method invoked when a stream is created locally bySession.newStream(HeadersFrame, Promise, Listener).onPush(Stream stream, PushPromiseFrame frame) Callback method invoked when a PUSH_PROMISE frame has been received.default voidonReset(Stream stream, ResetFrame frame) Callback method invoked when a RST_STREAM frame has been received for this stream.default voidonReset(Stream stream, ResetFrame frame, org.eclipse.jetty.util.Callback callback) Callback method invoked when a RST_STREAM frame has been received for this stream.default voidDeprecated.useonIdleTimeout(Stream, Throwable)instead
-
Method Details
-
onNewStream
Callback method invoked when a stream is created locally by
Session.newStream(HeadersFrame, Promise, Listener).- Parameters:
stream- the newly created stream
-
onHeaders
Callback method invoked when a HEADERS frame representing the HTTP response has been received.
- Parameters:
stream- the streamframe- the HEADERS frame received
-
onPush
Callback method invoked when a PUSH_PROMISE frame has been received.
- Parameters:
stream- the streamframe- the PUSH_PROMISE frame received- Returns:
- a Stream.Listener that will be notified of pushed stream events
-
onData
Callback method invoked when a DATA frame has been received.
- Parameters:
stream- the streamframe- the DATA frame receivedcallback- the callback to complete when the bytes of the DATA frame have been consumed
-
onReset
Callback method invoked when a RST_STREAM frame has been received for this stream.
- Parameters:
stream- the streamframe- the RST_FRAME receivedcallback- the callback to complete when the reset has been handled
-
onReset
Callback method invoked when a RST_STREAM frame has been received for this stream.
- Parameters:
stream- the streamframe- the RST_FRAME received- See Also:
-
onTimeout
Deprecated.useonIdleTimeout(Stream, Throwable)insteadCallback method invoked when the stream exceeds its idle timeout.
- Parameters:
stream- the streamx- the timeout failure- See Also:
-
onIdleTimeout
Callback method invoked when the stream exceeds its idle timeout.
- Parameters:
stream- the streamx- 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 streamerror- the error codereason- the error reason, or nullfailure- the failurecallback- 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) Deprecated.Callback method invoked when the stream failed.
- Parameters:
stream- the streamerror- the error codereason- the error reason, or nullcallback- the callback to complete when the failure has been handled
-
onClosed
Callback method invoked after the stream has been closed.
- Parameters:
stream- the stream
-
onFailure(Stream, int, String, Throwable, Callback)instead