public interface SessionSPI 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| 限定符和类型 | 方法和说明 |
|---|---|
void |
data(StreamSPI stream,
Callback callback,
DataFrame frame)
Enqueues the given DATA frame to be written to the connection.
|
void |
frames(StreamSPI stream,
Callback callback,
Frame frame,
Frame... frames)
Enqueues the given frames to be written to the connection.
|
long |
getBytesWritten() |
StreamSPI |
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.
|
boolean |
onIdleTimeout()
Callback invoked when the idle timeout expires.
|
void |
onShutdown()
Callback invoked when the connection reads -1.
|
void |
onWindowUpdate(StreamSPI stream,
WindowUpdateFrame frame)
Callback method invoked when a WINDOW_UPDATE frame has been received.
|
void |
push(StreamSPI stream,
Promise<Stream> promise,
PushPromiseFrame frame,
Stream.Listener listener)
Enqueues the given PUSH_PROMISE frame to be written to the connection.
|
void |
removeStream(StreamSPI stream)
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. |
StreamSPI getStream(int streamId)
SessionRetrieves the stream with the given streamId.
void removeStream(StreamSPI stream)
Removes the given stream.
stream - the stream to removevoid frames(StreamSPI 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(StreamSPI stream, Promise<Stream> promise, PushPromiseFrame frame, Stream.Listener listener)
Enqueues the given PUSH_PROMISE frame to be written to the connection.
Differently from frames(StreamSPI, 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(StreamSPI 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(StreamSPI 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.
boolean onIdleTimeout()
Callback invoked when the idle timeout expires.
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 processlong getBytesWritten()
Copyright © 2017. All rights reserved.