public final class MobileEventStreamResponseHandler extends Object implements com.ning.http.client.AsyncHandler<Boolean>
ConnectCallback.connected(StatusAndHeaders) the
caller should call consumeBody(). The handler will *not* read any of the response body until consumeBody() is called.
This is done so that the caller can deal with any special handling that may be needed based on response status code and/or
headers before receiving the streamed body.| Constructor and Description |
|---|
MobileEventStreamResponseHandler(Consumer<byte[]> receiver,
ConnectCallback connectCallback) |
| Modifier and Type | Method and Description |
|---|---|
void |
consumeBody() |
com.google.common.base.Optional<Throwable> |
getError() |
com.ning.http.client.AsyncHandler.STATE |
onBodyPartReceived(com.ning.http.client.HttpResponseBodyPart bodyPart) |
Boolean |
onCompleted() |
com.ning.http.client.AsyncHandler.STATE |
onHeadersReceived(com.ning.http.client.HttpResponseHeaders headers) |
com.ning.http.client.AsyncHandler.STATE |
onStatusReceived(com.ning.http.client.HttpResponseStatus responseStatus) |
void |
onThrowable(Throwable t) |
void |
stop() |
public MobileEventStreamResponseHandler(Consumer<byte[]> receiver, ConnectCallback connectCallback)
public void onThrowable(Throwable t)
onThrowable in interface com.ning.http.client.AsyncHandler<Boolean>public com.ning.http.client.AsyncHandler.STATE onStatusReceived(com.ning.http.client.HttpResponseStatus responseStatus)
throws Exception
public com.ning.http.client.AsyncHandler.STATE onHeadersReceived(com.ning.http.client.HttpResponseHeaders headers)
throws Exception
public void consumeBody()
public com.ning.http.client.AsyncHandler.STATE onBodyPartReceived(com.ning.http.client.HttpResponseBodyPart bodyPart)
throws Exception
public com.google.common.base.Optional<Throwable> getError()
public void stop()
throws InterruptedException
InterruptedExceptionCopyright © 2016. All rights reserved.