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.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 -
Method Summary
Modifier and TypeMethodDescriptionprotected HTTP2ServerConnection
void
onBeforeData
(Stream stream) Callback method invoked before notifying the first DATA frame.void
onClose
(Session session, GoAwayFrame frame, Callback callback) Callback method invoked when a GOAWAY frame caused the session to be closed.void
onDataDemanded
(Stream stream, DataFrame frame, Callback callback) Callback method invoked when a DATA frame has been demanded.void
Callback method invoked when a failure has been detected for this session.void
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
(Session session) Callback method invoked when the idle timeout expired.boolean
onIdleTimeout
(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.void
onReset
(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, onGoAway, onPing, onReset, onSettings
Methods inherited from interface org.eclipse.jetty.http2.api.Stream.Listener
onClosed, onData, onNewStream, onReset
-
Constructor Details
-
HTTPServerSessionListener
-
-
Method Details
-
getConnection
-
onPreface
Description copied from interface:Session.Listener
Callback 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:
onPreface
in interfaceSession.Listener
- Overrides:
onPreface
in 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.Listener
Callback 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.Listener
implementation that overridesStream.Listener.onData(Stream, DataFrame, Callback)
.- Specified by:
onNewStream
in interfaceSession.Listener
- Overrides:
onNewStream
in classSession.Listener.Adapter
- Parameters:
stream
- the newly created streamframe
- the HEADERS frame received- Returns:
- a
Stream.Listener
that will be notified of stream events
-
onBeforeData
Description copied from interface:Stream.Listener
Callback method invoked before notifying the first DATA frame.
The default implementation initializes the demand for DATA frames.
- Specified by:
onBeforeData
in interfaceStream.Listener
- Parameters:
stream
- the stream
-
onIdleTimeout
Description copied from interface:Session.Listener
Callback method invoked when the idle timeout expired.
- Specified by:
onIdleTimeout
in interfaceSession.Listener
- Overrides:
onIdleTimeout
in classSession.Listener.Adapter
- Parameters:
session
- the session- Returns:
- whether the session should be closed
-
onClose
Description copied from interface:Session.Listener
Callback method invoked when a GOAWAY frame caused the session to be closed.
- Specified by:
onClose
in 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.Listener
Callback method invoked when a failure has been detected for this session.
- Specified by:
onFailure
in interfaceSession.Listener
- Parameters:
session
- the sessionfailure
- the failurecallback
- the callback to notify of failure processing
-
onHeaders
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
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 pushed streamframe
- the PUSH_PROMISE frame received- Returns:
- a Stream.Listener that will be notified of pushed stream events
-
onDataDemanded
Description copied from interface:Stream.Listener
Callback method invoked when a DATA frame has been demanded.
Implementations of this method must arrange to call (within the method or otherwise asynchronously)
Stream.demand(long)
.- Specified by:
onDataDemanded
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
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 receivedcallback
- the callback to complete when the reset has been handled
-
onFailure
public void onFailure(Stream stream, int error, String reason, 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
-
onIdleTimeout
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:
-