public class FrameFileHttpResponseHandler extends Object implements HttpResponseHandler<FrameFilePartialFetch,FrameFilePartialFetch>
HttpResponseHandler that streams data into a ReadableByteChunksFrameChannel.
It is not required that the request actually fetches an entire frame file. The return object for this handler,
FrameFilePartialFetch, allows callers to tell how much of the file was read in a particular request.
This handler implements backpressure through FrameFilePartialFetch.backpressureFuture(). This allows callers
to back off from issuing the next request, if appropriate. However: the handler does not implement backpressure
through the HttpResponseHandler.TrafficCop mechanism. Therefore, it is important that each request retrieve
a modest amount of data.
The last fetch must be empty (zero content bytes) and must have the header HEADER_LAST_FETCH_NAME set to
HEADER_LAST_FETCH_VALUE. Under these conditions, FrameFilePartialFetch.isLastFetch() returns true.HttpResponseHandler.TrafficCop| Modifier and Type | Field and Description |
|---|---|
static String |
HEADER_LAST_FETCH_NAME |
static String |
HEADER_LAST_FETCH_VALUE |
| Constructor and Description |
|---|
FrameFileHttpResponseHandler(ReadableByteChunksFrameChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
ClientResponse<FrameFilePartialFetch> |
done(ClientResponse<FrameFilePartialFetch> clientResponse) |
void |
exceptionCaught(ClientResponse<FrameFilePartialFetch> clientResponse,
Throwable e) |
ClientResponse<FrameFilePartialFetch> |
handleChunk(ClientResponse<FrameFilePartialFetch> clientResponse,
org.jboss.netty.handler.codec.http.HttpChunk chunk,
long chunkNum) |
ClientResponse<FrameFilePartialFetch> |
handleResponse(org.jboss.netty.handler.codec.http.HttpResponse response,
HttpResponseHandler.TrafficCop trafficCop) |
public static final String HEADER_LAST_FETCH_NAME
public static final String HEADER_LAST_FETCH_VALUE
public FrameFileHttpResponseHandler(ReadableByteChunksFrameChannel channel)
public ClientResponse<FrameFilePartialFetch> handleResponse(org.jboss.netty.handler.codec.http.HttpResponse response, HttpResponseHandler.TrafficCop trafficCop)
handleResponse in interface HttpResponseHandler<FrameFilePartialFetch,FrameFilePartialFetch>public ClientResponse<FrameFilePartialFetch> handleChunk(ClientResponse<FrameFilePartialFetch> clientResponse, org.jboss.netty.handler.codec.http.HttpChunk chunk, long chunkNum)
handleChunk in interface HttpResponseHandler<FrameFilePartialFetch,FrameFilePartialFetch>public ClientResponse<FrameFilePartialFetch> done(ClientResponse<FrameFilePartialFetch> clientResponse)
done in interface HttpResponseHandler<FrameFilePartialFetch,FrameFilePartialFetch>public void exceptionCaught(ClientResponse<FrameFilePartialFetch> clientResponse, Throwable e)
exceptionCaught in interface HttpResponseHandler<FrameFilePartialFetch,FrameFilePartialFetch>Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.