Class HttpReceiverOverHTTP2
- java.lang.Object
-
- org.eclipse.jetty.client.HttpReceiver
-
- org.eclipse.jetty.http2.client.http.HttpReceiverOverHTTP2
-
- All Implemented Interfaces:
Stream.Listener
public class HttpReceiverOverHTTP2 extends HttpReceiver implements Stream.Listener
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.http2.api.Stream.Listener
Stream.Listener.Adapter
-
-
Field Summary
-
Fields inherited from class org.eclipse.jetty.client.HttpReceiver
LOG
-
-
Constructor Summary
Constructors Constructor Description HttpReceiverOverHTTP2(HttpChannel channel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected HttpChannelOverHTTP2
getHttpChannel()
void
onData(Stream stream, DataFrame frame, Callback callback)
Callback method invoked when a DATA frame has been received.void
onFailure(Stream stream, int error, java.lang.String reason, java.lang.Throwable failure, Callback callback)
Callback method invoked when the stream failed.void
onHeaders(Stream stream, HeadersFrame frame)
Callback method invoked when a HEADERS frame representing the HTTP response has been received.boolean
onIdleTimeout(Stream stream, java.lang.Throwable x)
Callback method invoked when the stream exceeds its idle timeout.void
onNewStream(Stream stream)
Callback method invoked when a stream is created locally bySession.newStream(HeadersFrame, Promise, Listener)
.Stream.Listener
onPush(Stream stream, PushPromiseFrame frame)
Callback method invoked when a PUSH_PROMISE frame has been received.void
onReset(Stream stream, ResetFrame frame)
Callback method invoked when a RST_STREAM frame has been received for this stream.protected void
receive()
protected void
reset()
Resets the state of this HttpReceiver.-
Methods inherited from class org.eclipse.jetty.client.HttpReceiver
abort, demand, dispose, getHttpDestination, getHttpExchange, hasDemandOrStall, isFailed, responseBegin, responseContent, responseFailure, responseHeader, responseHeaders, responseSuccess, storeCookie, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.http2.api.Stream.Listener
onClosed, onFailure, onReset, onTimeout
-
-
-
-
Constructor Detail
-
HttpReceiverOverHTTP2
public HttpReceiverOverHTTP2(HttpChannel channel)
-
-
Method Detail
-
getHttpChannel
protected HttpChannelOverHTTP2 getHttpChannel()
- Overrides:
getHttpChannel
in classHttpReceiver
-
receive
protected void receive()
- Overrides:
receive
in classHttpReceiver
-
reset
protected void reset()
Description copied from class:HttpReceiver
Resets the state of this HttpReceiver.Subclasses should override (but remember to call
super
) to reset their own state.Either this method or
HttpReceiver.dispose()
is called.- Overrides:
reset
in classHttpReceiver
-
onNewStream
public void onNewStream(Stream stream)
Description copied from interface:Stream.Listener
Callback method invoked when a stream is created locally by
Session.newStream(HeadersFrame, Promise, Listener)
.- Specified by:
onNewStream
in interfaceStream.Listener
- Parameters:
stream
- the newly created stream
-
onHeaders
public void onHeaders(Stream stream, HeadersFrame frame)
Description copied from interface:Stream.Listener
Callback method invoked when a HEADERS frame representing the HTTP response has been received.
- Specified by:
onHeaders
in interfaceStream.Listener
- Parameters:
stream
- the streamframe
- the HEADERS frame received
-
onPush
public Stream.Listener onPush(Stream stream, PushPromiseFrame frame)
Description copied from interface:Stream.Listener
Callback method invoked when a PUSH_PROMISE frame has been received.
- Specified by:
onPush
in interfaceStream.Listener
- Parameters:
stream
- the streamframe
- the PUSH_PROMISE frame received- Returns:
- a Stream.Listener that will be notified of pushed stream events
-
onData
public void onData(Stream stream, DataFrame frame, Callback callback)
Description copied from interface:Stream.Listener
Callback method invoked when a DATA frame has been received.
- Specified by:
onData
in interfaceStream.Listener
- Parameters:
stream
- the streamframe
- the DATA frame receivedcallback
- the callback to complete when the bytes of the DATA frame have been consumed
-
onReset
public void onReset(Stream stream, ResetFrame frame)
Description copied from interface:Stream.Listener
Callback method invoked when a RST_STREAM frame has been received for this stream.
- Specified by:
onReset
in interfaceStream.Listener
- Parameters:
stream
- the streamframe
- the RST_FRAME received- See Also:
Session.Listener.onReset(Session, ResetFrame)
-
onIdleTimeout
public boolean onIdleTimeout(Stream stream, java.lang.Throwable x)
Description copied from interface:Stream.Listener
Callback method invoked when the stream exceeds its idle timeout.
- Specified by:
onIdleTimeout
in interfaceStream.Listener
- Parameters:
stream
- the streamx
- the timeout failure- Returns:
- true to reset the stream, false to ignore the idle timeout
- See Also:
Stream.getIdleTimeout()
-
onFailure
public void onFailure(Stream stream, int error, java.lang.String reason, java.lang.Throwable failure, Callback callback)
Description copied from interface:Stream.Listener
Callback method invoked when the stream failed.
- Specified by:
onFailure
in interfaceStream.Listener
- Parameters:
stream
- the streamerror
- the error codereason
- the error reason, or nullfailure
- the failurecallback
- the callback to complete when the failure has been handled
-
-