public interface PushObserver
HTTP/2 only. Processes server-initiated HTTP requests on the client.
Implementations must quickly dispatch callbacks to avoid creating a bottleneck.
While onReset(int, org.aoju.bus.http.internal.http.second.ErrorCode) may occur at any time, the following callbacks are expected in order,
correlated by stream ID.
onRequest(int, java.util.List<org.aoju.bus.http.internal.http.second.Header>)onHeaders(int, java.util.List<org.aoju.bus.http.internal.http.second.Header>, boolean) (unless canceled)
onData(int, org.aoju.bus.core.io.BufferedSource, int, boolean) (optional sequence of data frames)
As a stream ID is scoped to a single HTTP/2 connection, implementations which target multiple connections should expect repetition of stream IDs.
Return true to request cancellation of a pushed stream. Note that this does not guarantee future frames won't arrive on the stream ID.
| Modifier and Type | Field and Description |
|---|---|
static PushObserver |
CANCEL |
| Modifier and Type | Method and Description |
|---|---|
boolean |
onData(int streamId,
BufferedSource source,
int byteCount,
boolean last) |
boolean |
onHeaders(int streamId,
List<Header> responseHeaders,
boolean last) |
boolean |
onRequest(int streamId,
List<Header> requestHeaders) |
void |
onReset(int streamId,
ErrorCode errorCode) |
static final PushObserver CANCEL
boolean onData(int streamId,
BufferedSource source,
int byteCount,
boolean last)
throws IOException
IOExceptionvoid onReset(int streamId,
ErrorCode errorCode)
Copyright © 2019. All rights reserved.