V
- public final class NettyResponseFuture<V> extends AbstractListenableFuture<V>
Future
that can be used to track when an asynchronous HTTP request has been fully processed.Modifier and Type | Class and Description |
---|---|
static class |
NettyResponseFuture.STATE |
ListenableFuture.CompletedFailure<T>
Constructor and Description |
---|
NettyResponseFuture(Uri uri,
Request request,
AsyncHandler<V> asyncHandler,
NettyRequest nettyRequest,
int maxRetry,
ConnectionPoolPartitioning connectionPoolPartitioning,
ProxyServer proxyServer) |
Modifier and Type | Method and Description |
---|---|
void |
abort(Throwable t)
|
void |
attachChannel(org.jboss.netty.channel.Channel channel,
boolean reuseChannel) |
boolean |
canBeReplayed()
Return true if the
Future can be recovered. |
boolean |
cancel(boolean force) |
void |
cancelTimeouts() |
boolean |
canRetry() |
org.jboss.netty.channel.Channel |
channel() |
void |
done()
Terminate and if there is no exception, mark this Future as done and release the internal lock.
|
V |
get() |
V |
get(long l,
TimeUnit tu) |
boolean |
getAndSetAuth(boolean inDigestAuth) |
boolean |
getAndSetStatusReceived(boolean sr) |
AsyncHandler<V> |
getAsyncHandler() |
SocketAddress |
getChannelRemoteAddress() |
ConnectionPoolPartitioning |
getConnectionPoolPartitioning() |
org.jboss.netty.handler.codec.http.HttpHeaders |
getHttpHeaders() |
long |
getLastTouch() |
NettyRequest |
getNettyRequest() |
String |
getPartition() |
ProxyServer |
getProxyServer() |
Request |
getRequest() |
long |
getStart() |
NettyResponseFuture.STATE |
getState() |
Uri |
getUri() |
int |
incrementAndGetCurrentRedirectCount() |
boolean |
isCancelled() |
boolean |
isConnectAllowed() |
boolean |
isDone() |
boolean |
isDontWriteBodyBecauseExpectContinue() |
boolean |
isHeadersAlreadyWrittenOnContinue() |
boolean |
isInAuth() |
boolean |
isKeepAlive() |
boolean |
isStreamWasAlreadyConsumed() |
boolean |
reuseChannel() |
void |
setAsyncHandler(AsyncHandler<V> asyncHandler) |
void |
setConnectAllowed(boolean allowConnect) |
void |
setDontWriteBodyBecauseExpectContinue(boolean dontWriteBodyBecauseExpectContinue) |
void |
setHeadersAlreadyWrittenOnContinue(boolean headersAlreadyWrittenOnContinue) |
void |
setHttpHeaders(org.jboss.netty.handler.codec.http.HttpHeaders httpHeaders) |
void |
setKeepAlive(boolean keepAlive) |
void |
setNettyRequest(NettyRequest nettyRequest) |
void |
setRequest(Request request) |
void |
setReuseChannel(boolean reuseChannel) |
void |
setState(NettyResponseFuture.STATE state) |
void |
setStreamWasAlreadyConsumed(boolean streamWasAlreadyConsumed) |
void |
setTimeoutsHolder(TimeoutsHolder timeoutsHolder) |
void |
setUri(Uri uri) |
String |
toString() |
void |
touch()
Touch the current instance to prevent external service to times out.
|
addListener, runListeners
public NettyResponseFuture(Uri uri, Request request, AsyncHandler<V> asyncHandler, NettyRequest nettyRequest, int maxRetry, ConnectionPoolPartitioning connectionPoolPartitioning, ProxyServer proxyServer)
public boolean isDone()
public boolean isCancelled()
public boolean cancel(boolean force)
public V get() throws InterruptedException, ExecutionException
public V get(long l, TimeUnit tu) throws InterruptedException, TimeoutException, ExecutionException
public final void done()
ListenableFuture
public final void abort(Throwable t)
ListenableFuture
public void touch()
ListenableFuture
public Uri getUri()
public void setUri(Uri uri)
public ConnectionPoolPartitioning getConnectionPoolPartitioning()
public ProxyServer getProxyServer()
public void setAsyncHandler(AsyncHandler<V> asyncHandler)
public void cancelTimeouts()
public final Request getRequest()
public final NettyRequest getNettyRequest()
public final void setNettyRequest(NettyRequest nettyRequest)
public final AsyncHandler<V> getAsyncHandler()
public final boolean isKeepAlive()
public final void setKeepAlive(boolean keepAlive)
public final org.jboss.netty.handler.codec.http.HttpHeaders getHttpHeaders()
public final void setHttpHeaders(org.jboss.netty.handler.codec.http.HttpHeaders httpHeaders)
public int incrementAndGetCurrentRedirectCount()
public void setTimeoutsHolder(TimeoutsHolder timeoutsHolder)
public boolean isInAuth()
public boolean getAndSetAuth(boolean inDigestAuth)
public NettyResponseFuture.STATE getState()
public void setState(NettyResponseFuture.STATE state)
public boolean getAndSetStatusReceived(boolean sr)
public boolean isStreamWasAlreadyConsumed()
public void setStreamWasAlreadyConsumed(boolean streamWasAlreadyConsumed)
public long getLastTouch()
public void setHeadersAlreadyWrittenOnContinue(boolean headersAlreadyWrittenOnContinue)
public boolean isHeadersAlreadyWrittenOnContinue()
public void setDontWriteBodyBecauseExpectContinue(boolean dontWriteBodyBecauseExpectContinue)
public boolean isDontWriteBodyBecauseExpectContinue()
public void setReuseChannel(boolean reuseChannel)
public boolean isConnectAllowed()
public void setConnectAllowed(boolean allowConnect)
public void attachChannel(org.jboss.netty.channel.Channel channel, boolean reuseChannel)
public org.jboss.netty.channel.Channel channel()
public boolean reuseChannel()
public boolean canRetry()
public SocketAddress getChannelRemoteAddress()
public void setRequest(Request request)
public boolean canBeReplayed()
Future
can be recovered. There is some scenario where a connection can be closed by an
unexpected IOException, and in some situation we can recover from that exception.Future
cannot be recovered.public long getStart()
public String getPartition()
Copyright © 2015. All Rights Reserved.