rx.apache.http.consumers
Class ResponseConsumerDelegate
java.lang.Object
org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<org.apache.http.HttpResponse>
rx.apache.http.consumers.ResponseConsumerDelegate
- All Implemented Interfaces:
- java.io.Closeable, org.apache.http.concurrent.Cancellable, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<org.apache.http.HttpResponse>
public class ResponseConsumerDelegate
- extends org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<org.apache.http.HttpResponse>
AbstractAsyncResponseConsumer that chooses different implementations based on return headers.
- Content-Type:text/event-stream ==
ResponseConsumerEventStream
- All others ==
ResponseConsumerBasic
|
Method Summary |
protected org.apache.http.HttpResponse |
buildResult(org.apache.http.protocol.HttpContext context)
|
protected void |
onContentReceived(org.apache.http.nio.ContentDecoder decoder,
org.apache.http.nio.IOControl ioctrl)
|
protected void |
onEntityEnclosed(org.apache.http.HttpEntity entity,
org.apache.http.entity.ContentType contentType)
|
protected void |
onResponseReceived(org.apache.http.HttpResponse response)
|
protected void |
releaseResources()
|
| Methods inherited from class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer |
cancel, close, consumeContent, failed, getException, getResult, isDone, onClose, responseCompleted, responseReceived |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResponseConsumerDelegate
public ResponseConsumerDelegate(rx.Observer<? super ObservableHttpResponse> observer,
rx.subscriptions.CompositeSubscription subscription)
onResponseReceived
protected void onResponseReceived(org.apache.http.HttpResponse response)
throws org.apache.http.HttpException,
java.io.IOException
- Specified by:
onResponseReceived in class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<org.apache.http.HttpResponse>
- Throws:
org.apache.http.HttpException
java.io.IOException
onContentReceived
protected void onContentReceived(org.apache.http.nio.ContentDecoder decoder,
org.apache.http.nio.IOControl ioctrl)
throws java.io.IOException
- Specified by:
onContentReceived in class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<org.apache.http.HttpResponse>
- Throws:
java.io.IOException
onEntityEnclosed
protected void onEntityEnclosed(org.apache.http.HttpEntity entity,
org.apache.http.entity.ContentType contentType)
throws java.io.IOException
- Specified by:
onEntityEnclosed in class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<org.apache.http.HttpResponse>
- Throws:
java.io.IOException
buildResult
protected org.apache.http.HttpResponse buildResult(org.apache.http.protocol.HttpContext context)
throws java.lang.Exception
- Specified by:
buildResult in class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<org.apache.http.HttpResponse>
- Throws:
java.lang.Exception
releaseResources
protected void releaseResources()
- Specified by:
releaseResources in class org.apache.http.nio.protocol.AbstractAsyncResponseConsumer<org.apache.http.HttpResponse>