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 HTTP2ServerConnection
getConnection()
void
onClose(Session session, GoAwayFrame frame, Callback callback)
Callback method invoked when a GOAWAY frame caused the session to be closed.void
onData(Stream stream, DataFrame frame, Callback callback)
Callback method invoked when a DATA frame has been received.void
onFailure(Session session, java.lang.Throwable failure, Callback callback)
Callback method invoked when a failure has been detected for this session.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(Session session)
Callback method invoked when the idle timeout expired.boolean
onIdleTimeout(Stream stream, java.lang.Throwable x)
Callback method invoked when the stream exceeds its idle timeout.Stream.Listener
onNewStream(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.Listener
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, onFailure, onNewStream, 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.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
public Stream.Listener onNewStream(Stream stream, HeadersFrame frame)
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
-
onIdleTimeout
public boolean onIdleTimeout(Session session)
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
public void onClose(Session session, GoAwayFrame frame, Callback callback)
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
public void onFailure(Session session, java.lang.Throwable failure, Callback callback)
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
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, Callback callback)
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, 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
-
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()
-
-