Class HTTP2ServerConnectionFactory.HTTPServerSessionListener
- java.lang.Object
-
- org.eclipse.jetty.http2.api.Session.Listener.Adapter
-
- org.eclipse.jetty.http2.api.server.ServerSessionListener.Adapter
-
- org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory.HTTPServerSessionListener
-
- All Implemented Interfaces:
ServerSessionListener,Session.Listener,Stream.Listener
- Enclosing class:
- HTTP2ServerConnectionFactory
protected class HTTP2ServerConnectionFactory.HTTPServerSessionListener extends ServerSessionListener.Adapter implements Stream.Listener
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.http2.api.server.ServerSessionListener
ServerSessionListener.Adapter
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.http2.api.Session.Listener
Session.Listener.Adapter
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.http2.api.Stream.Listener
Stream.Listener.Adapter
-
-
Constructor Summary
Constructors Constructor Description HTTPServerSessionListener(Connector connector, EndPoint endPoint)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected HTTP2ServerConnectiongetConnection()voidonClose(Session session, GoAwayFrame frame, Callback callback)Callback method invoked when a GOAWAY frame has been received.voidonData(Stream stream, DataFrame frame, Callback callback)Callback method invoked when a DATA frame has been received.voidonFailure(Session session, java.lang.Throwable failure, Callback callback)Callback method invoked when a failure has been detected for this session.voidonFailure(Stream stream, int error, java.lang.String reason, Callback callback)Callback method invoked when the stream failed.voidonHeaders(Stream stream, HeadersFrame frame)Callback method invoked when a HEADERS frame representing the HTTP response has been received.booleanonIdleTimeout(Session session)Callback method invoked when the idle timeout expired.booleanonIdleTimeout(Stream stream, java.lang.Throwable x)Callback method invoked when the stream exceeds its idle timeout.Stream.ListeneronNewStream(Stream stream, HeadersFrame frame)Callback method invoked when a new stream is being created upon receiving a HEADERS frame representing an HTTP request.java.util.Map<java.lang.Integer,java.lang.Integer>onPreface(Session session)Callback method invoked:Stream.ListeneronPush(Stream stream, PushPromiseFrame frame)Callback method invoked when a PUSH_PROMISE frame has been received.voidonReset(Stream stream, ResetFrame frame, Callback callback)Callback method invoked when a RST_STREAM frame has been received for this stream.-
Methods inherited from class org.eclipse.jetty.http2.api.server.ServerSessionListener.Adapter
onAccept
-
Methods inherited from class org.eclipse.jetty.http2.api.Session.Listener.Adapter
onClose, onFailure, onPing, onReset, onSettings
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.http2.api.Session.Listener
onClose, onFailure, onPing, onReset, onSettings
-
Methods inherited from interface org.eclipse.jetty.http2.api.Stream.Listener
onClosed, onReset, onTimeout
-
-
-
-
Method Detail
-
getConnection
protected HTTP2ServerConnection getConnection()
-
onPreface
public java.util.Map<java.lang.Integer,java.lang.Integer> onPreface(Session session)
Description copied from interface:Session.ListenerCallback method invoked:
- for clients, just before the preface is sent, to gather the SETTINGS configuration options the client wants to send to the server;
- for servers, just after having received the preface, to gather the SETTINGS configuration options the server wants to send to the client.
- Specified by:
onPrefacein interfaceSession.Listener- Overrides:
onPrefacein classSession.Listener.Adapter- Parameters:
session- the session- Returns:
- a (possibly empty or null) map containing SETTINGS configuration options to send.
-
onNewStream
public Stream.Listener onNewStream(Stream stream, HeadersFrame frame)
Description copied from interface:Session.ListenerCallback method invoked when a new stream is being created upon receiving a HEADERS frame representing an HTTP request.
Applications should implement this method to process HTTP requests, typically providing an HTTP response via
Stream.headers(HeadersFrame, Callback).Applications can detect whether request DATA frames will be arriving by testing
HeadersFrame.isEndStream(). If the application is interested in processing the DATA frames, it must return aStream.Listenerimplementation that overridesStream.Listener.onData(Stream, DataFrame, Callback).- Specified by:
onNewStreamin interfaceSession.Listener- Overrides:
onNewStreamin classSession.Listener.Adapter- Parameters:
stream- the newly created streamframe- the HEADERS frame received- Returns:
- a
Stream.Listenerthat will be notified of stream events
-
onIdleTimeout
public boolean onIdleTimeout(Session session)
Description copied from interface:Session.ListenerCallback method invoked when the idle timeout expired.
- Specified by:
onIdleTimeoutin interfaceSession.Listener- Overrides:
onIdleTimeoutin classSession.Listener.Adapter- Parameters:
session- the session- Returns:
- whether the session should be closed
-
onClose
public void onClose(Session session, GoAwayFrame frame, Callback callback)
Description copied from interface:Session.ListenerCallback method invoked when a GOAWAY frame has been received.
- Specified by:
onClosein interfaceSession.Listener- Parameters:
session- the sessionframe- the GOAWAY frame receivedcallback- the callback to notify of the GOAWAY processing
-
onFailure
public void onFailure(Session session, java.lang.Throwable failure, Callback callback)
Description copied from interface:Session.ListenerCallback method invoked when a failure has been detected for this session.
- Specified by:
onFailurein interfaceSession.Listener- Parameters:
session- the sessionfailure- the failurecallback- the callback to notify of failure processing
-
onHeaders
public void onHeaders(Stream stream, HeadersFrame frame)
Description copied from interface:Stream.ListenerCallback method invoked when a HEADERS frame representing the HTTP response has been received.
- Specified by:
onHeadersin interfaceStream.Listener- Parameters:
stream- the streamframe- the HEADERS frame received
-
onPush
public Stream.Listener onPush(Stream stream, PushPromiseFrame frame)
Description copied from interface:Stream.ListenerCallback method invoked when a PUSH_PROMISE frame has been received.
- Specified by:
onPushin 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.ListenerCallback method invoked when a DATA frame has been received.
- Specified by:
onDatain 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, Callback callback)
Description copied from interface:Stream.ListenerCallback method invoked when a RST_STREAM frame has been received for this stream.
- Specified by:
onResetin interfaceStream.Listener- Parameters:
stream- the streamframe- the RST_FRAME receivedcallback- the callback to complete when the reset has been handled
-
onFailure
public void onFailure(Stream stream, int error, java.lang.String reason, Callback callback)
Description copied from interface:Stream.ListenerCallback method invoked when the stream failed.
- Specified by:
onFailurein interfaceStream.Listener- Parameters:
stream- the streamerror- the error codereason- the error reason, or nullcallback- the callback to complete when the failure has been handled
-
onIdleTimeout
public boolean onIdleTimeout(Stream stream, java.lang.Throwable x)
Description copied from interface:Stream.ListenerCallback method invoked when the stream exceeds its idle timeout.
- Specified by:
onIdleTimeoutin 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()
-
-