Class HTTP2ServerConnectionFactory.HTTPServerSessionListener
- All Implemented Interfaces:
ServerSessionListener,Session.Listener,Stream.Listener
- Enclosing class:
HTTP2ServerConnectionFactory
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.http2.api.server.ServerSessionListener
ServerSessionListener.AdapterNested classes/interfaces inherited from interface org.eclipse.jetty.http2.api.Session.Listener
Session.Listener.AdapterNested classes/interfaces inherited from interface org.eclipse.jetty.http2.api.Stream.Listener
Stream.Listener.Adapter -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHTTPServerSessionListener(org.eclipse.jetty.server.Connector connector, org.eclipse.jetty.io.EndPoint endPoint) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprotected HTTP2ServerConnectionvoidonClose(Session session, GoAwayFrame frame, org.eclipse.jetty.util.Callback callback) Callback method invoked when a GOAWAY frame caused the session to be closed.voidCallback method invoked when a DATA frame has been received.voidCallback method invoked when a failure has been detected for this session.voidonFailure(Stream stream, int error, String reason, Throwable failure, org.eclipse.jetty.util.Callback callback) Callback method invoked when the stream failed.private voidvoidonHeaders(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, Throwable x) Callback method invoked when the stream exceeds its idle timeout.onNewStream(Stream stream, HeadersFrame frame) Callback method invoked when a new stream is being created upon receiving a HEADERS frame representing an HTTP request.Callback method invoked:onPush(Stream stream, PushPromiseFrame frame) Callback method invoked when a PUSH_PROMISE frame has been received.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.Methods inherited from class org.eclipse.jetty.http2.api.server.ServerSessionListener.Adapter
onAcceptMethods inherited from class org.eclipse.jetty.http2.api.Session.Listener.Adapter
onClose, onFailure, onPing, onReset, onSettingsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.jetty.http2.api.Session.Listener
onClose, onFailure, onGoAway, onPing, onReset, onSettingsMethods inherited from interface org.eclipse.jetty.http2.api.Stream.Listener
onClosed, onFailure, onNewStream, onReset, onTimeout
-
Field Details
-
connector
private final org.eclipse.jetty.server.Connector connector -
endPoint
private final org.eclipse.jetty.io.EndPoint endPoint
-
-
Constructor Details
-
HTTPServerSessionListener
public HTTPServerSessionListener(org.eclipse.jetty.server.Connector connector, org.eclipse.jetty.io.EndPoint endPoint)
-
-
Method Details
-
getConnection
-
onPreface
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
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
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
Description copied from interface:Session.ListenerCallback method invoked when a GOAWAY frame caused the session to be closed.
- Specified by:
onClosein interfaceSession.Listener- Parameters:
session- the sessionframe- the GOAWAY frame that caused the session to be closedcallback- the callback to notify of the GOAWAY processing
-
onFailure
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
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
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
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
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, String reason, Throwable failure, org.eclipse.jetty.util.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 nullfailure- the failurecallback- the callback to complete when the failure has been handled
-
onFailure
-
onIdleTimeout
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:
-
close
-