public interface ISession extends Session
The SPI interface for implementing a HTTP/2 session.
This class extends Session by adding the methods required to
implement the HTTP/2 session functionalities.
Session.Listener| Modifier and Type | Method and Description |
|---|---|
void |
data(IStream stream,
Callback callback,
DataFrame frame)
Enqueues the given DATA frame to be written to the connection.
|
void |
frames(IStream stream,
Callback callback,
Frame frame,
Frame... frames)
Enqueues the given frames to be written to the connection.
|
IStream |
getStream(int streamId)
Retrieves the stream with the given
streamId. |
boolean |
isPushEnabled() |
void |
onFrame(Frame frame)
Callback method invoked during an HTTP/1.1 to HTTP/2 upgrade requests
to process the given synthetic frame.
|
void |
onIdleTimeout()
Callback invoked when the idle timeout expires.
|
void |
onShutdown()
Callback invoked when the connection reads -1.
|
void |
onWindowUpdate(IStream stream,
WindowUpdateFrame frame)
Callback method invoked when a WINDOW_UPDATE frame has been received.
|
void |
push(IStream stream,
Promise<Stream> promise,
PushPromiseFrame frame,
Stream.Listener listener)
Enqueues the given PUSH_PROMISE frame to be written to the connection.
|
void |
removeStream(IStream stream,
boolean local)
Removes the given
stream. |
int |
updateRecvWindow(int delta)
Updates the session receive window by the given
delta. |
int |
updateSendWindow(int delta)
Updates the session send window by the given
delta. |
IStream getStream(int streamId)
SessionRetrieves the stream with the given streamId.
void removeStream(IStream stream, boolean local)
Removes the given stream.
stream - the stream to removelocal - whether the stream is local or remotevoid frames(IStream stream, Callback callback, Frame frame, Frame... frames)
Enqueues the given frames to be written to the connection.
stream - the stream the frames belong tocallback - the callback that gets notified when the frames have been sentframe - the first frame to enqueueframes - additional frames to enqueuevoid push(IStream stream, Promise<Stream> promise, PushPromiseFrame frame, Stream.Listener listener)
Enqueues the given PUSH_PROMISE frame to be written to the connection.
Differently from frames(IStream, Callback, Frame, Frame...), this method
generates atomically the stream id for the pushed stream.
stream - the stream associated to the pushed streampromise - the promise that gets notified of the pushed stream creationframe - the PUSH_PROMISE frame to enqueuelistener - the listener that gets notified of pushed stream eventsvoid data(IStream stream, Callback callback, DataFrame frame)
Enqueues the given DATA frame to be written to the connection.
stream - the stream the data frame belongs tocallback - the callback that gets notified when the frame has been sentframe - the DATA frame to sendint updateSendWindow(int delta)
Updates the session send window by the given delta.
delta - the delta value (positive or negative) to add to the session send windowint updateRecvWindow(int delta)
Updates the session receive window by the given delta.
delta - the delta value (positive or negative) to add to the session receive windowvoid onWindowUpdate(IStream stream, WindowUpdateFrame frame)
Callback method invoked when a WINDOW_UPDATE frame has been received.
stream - the stream the window update belongs to, or null if the window update belongs to the sessionframe - the WINDOW_UPDATE frame receivedboolean isPushEnabled()
void onShutdown()
Callback invoked when the connection reads -1.
void onIdleTimeout()
Callback invoked when the idle timeout expires.
onShutdown(),
Session.close(int, String, Callback)void onFrame(Frame frame)
Callback method invoked during an HTTP/1.1 to HTTP/2 upgrade requests to process the given synthetic frame.
frame - the synthetic frame to processCopyright © 1995-2015 Webtide. All Rights Reserved.