public static interface Session.Listener
A Session.Listener
is the passive counterpart of a Session
and
receives events happening on a HTTP/2 connection.
Session
Modifier and Type | Interface and Description |
---|---|
static class |
Session.Listener.Adapter
Empty implementation of
Stream.Listener . |
Modifier and Type | Method and Description |
---|---|
void |
onClose(Session session,
GoAwayFrame frame)
Callback method invoked when a GOAWAY frame has been received.
|
void |
onFailure(Session session,
Throwable failure)
Callback method invoked when a failure has been detected for this session.
|
boolean |
onIdleTimeout(Session session)
Callback method invoked when the idle timeout expired.
|
Stream.Listener |
onNewStream(Stream stream,
HeadersFrame frame)
Callback method invoked when a new stream is being created upon
receiving a HEADERS frame representing a HTTP request.
|
void |
onPing(Session session,
PingFrame frame)
Callback method invoked when a PING frame has been received.
|
Map<Integer,Integer> |
onPreface(Session session)
Callback method invoked:
|
void |
onReset(Session session,
ResetFrame frame)
Callback method invoked when a RST_STREAM frame has been received for an unknown stream.
|
void |
onSettings(Session session,
SettingsFrame frame)
Callback method invoked when a SETTINGS frame has been received.
|
Map<Integer,Integer> onPreface(Session session)
Callback method invoked:
session
- the sessionStream.Listener onNewStream(Stream stream, HeadersFrame frame)
Callback method invoked when a new stream is being created upon receiving a HEADERS frame representing a HTTP request.
Applications should implement this method to process HTTP requests,
typically providing a 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 a
Stream.Listener
implementation that overrides
Stream.Listener.onData(Stream, DataFrame, Callback)
.
stream
- the newly created streamframe
- the HEADERS frame receivedStream.Listener
that will be notified of stream eventsvoid onSettings(Session session, SettingsFrame frame)
Callback method invoked when a SETTINGS frame has been received.
session
- the sessionframe
- the SETTINGS frame receivedvoid onPing(Session session, PingFrame frame)
Callback method invoked when a PING frame has been received.
session
- the sessionframe
- the PING frame receivedvoid onReset(Session session, ResetFrame frame)
Callback method invoked when a RST_STREAM frame has been received for an unknown stream.
session
- the sessionframe
- the RST_STREAM frame receivedStream.Listener.onReset(Stream, ResetFrame)
void onClose(Session session, GoAwayFrame frame)
Callback method invoked when a GOAWAY frame has been received.
session
- the sessionframe
- the GOAWAY frame receivedboolean onIdleTimeout(Session session)
Callback method invoked when the idle timeout expired.
session
- the sessionCopyright © 1995-2016 Webtide. All Rights Reserved.