Interface Session.Listener
- 
- All Known Subinterfaces:
- ServerSessionListener
 - All Known Implementing Classes:
- HTTP2ServerConnectionFactory.HTTPServerSessionListener,- ServerSessionListener.Adapter,- Session.Listener.Adapter
 - Enclosing interface:
- Session
 
 public static interface Session.ListenerA Session.Listeneris the passive counterpart of aSessionand receives events happening on an HTTP/2 connection.- See Also:
- Session
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classSession.Listener.AdapterEmpty implementation ofStream.Listener.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidonClose(Session session, GoAwayFrame frame)default voidonClose(Session session, GoAwayFrame frame, Callback callback)Callback method invoked when a GOAWAY frame caused the session to be closed.voidonFailure(Session session, java.lang.Throwable failure)default voidonFailure(Session session, java.lang.Throwable failure, Callback callback)Callback method invoked when a failure has been detected for this session.default voidonGoAway(Session session, GoAwayFrame frame)Callback method invoked when a GOAWAY frame has been received.booleanonIdleTimeout(Session session)Callback method invoked when the idle timeout expired.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.voidonPing(Session session, PingFrame frame)Callback method invoked when a PING frame has been received.java.util.Map<java.lang.Integer,java.lang.Integer>onPreface(Session session)Callback method invoked:voidonReset(Session session, ResetFrame frame)Callback method invoked when a RST_STREAM frame has been received for an unknown stream.voidonSettings(Session session, SettingsFrame frame)Callback method invoked when a SETTINGS frame has been received.
 
- 
- 
- 
Method Detail- 
onPrefacejava.util.Map<java.lang.Integer,java.lang.Integer> onPreface(Session session) 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.
 - Parameters:
- session- the session
- Returns:
- a (possibly empty or null) map containing SETTINGS configuration options to send.
 
 - 
onNewStreamStream.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. 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).- Parameters:
- stream- the newly created stream
- frame- the HEADERS frame received
- Returns:
- a Stream.Listenerthat will be notified of stream events
 
 - 
onSettingsvoid onSettings(Session session, SettingsFrame frame) Callback method invoked when a SETTINGS frame has been received. - Parameters:
- session- the session
- frame- the SETTINGS frame received
 
 - 
onPingvoid onPing(Session session, PingFrame frame) Callback method invoked when a PING frame has been received. - Parameters:
- session- the session
- frame- the PING frame received
 
 - 
onResetvoid onReset(Session session, ResetFrame frame) Callback method invoked when a RST_STREAM frame has been received for an unknown stream. - Parameters:
- session- the session
- frame- the RST_STREAM frame received
- See Also:
- Stream.Listener.onReset(Stream, ResetFrame)
 
 - 
onGoAwaydefault void onGoAway(Session session, GoAwayFrame frame) Callback method invoked when a GOAWAY frame has been received. - Parameters:
- session- the session
- frame- the GOAWAY frame received
 
 - 
onClosedefault void onClose(Session session, GoAwayFrame frame, Callback callback) Callback method invoked when a GOAWAY frame caused the session to be closed. - Parameters:
- session- the session
- frame- the GOAWAY frame that caused the session to be closed
- callback- the callback to notify of the GOAWAY processing
 
 - 
onClosevoid onClose(Session session, GoAwayFrame frame) 
 - 
onIdleTimeoutboolean onIdleTimeout(Session session) Callback method invoked when the idle timeout expired. - Parameters:
- session- the session
- Returns:
- whether the session should be closed
 
 - 
onFailuredefault void onFailure(Session session, java.lang.Throwable failure, Callback callback) Callback method invoked when a failure has been detected for this session. - Parameters:
- session- the session
- failure- the failure
- callback- the callback to notify of failure processing
 
 - 
onFailurevoid onFailure(Session session, java.lang.Throwable failure) 
 
- 
 
-