V
- the result typepublic final class NettyResponseFuture<V> extends AbstractListenableFuture<V>
Future
that can be used to track when an asynchronous HTTP request has been fully processed.ListenableFuture.CompletedFailure<T>
Constructor and Description |
---|
NettyResponseFuture(Request originalRequest,
AsyncHandler<V> asyncHandler,
NettyRequest nettyRequest,
int maxRetry,
ChannelPoolPartitioning connectionPoolPartitioning,
ProxyServer proxyServer) |
addListener, runListeners
public NettyResponseFuture(Request originalRequest, AsyncHandler<V> asyncHandler, NettyRequest nettyRequest, int maxRetry, ChannelPoolPartitioning 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
t
- the exceptionpublic void touch()
ListenableFuture
public CompletableFuture<V> toCompletableFuture()
public Uri getUri()
public ChannelPoolPartitioning getConnectionPoolPartitioning()
public ProxyServer getProxyServer()
public void setAsyncHandler(AsyncHandler<V> asyncHandler)
public void cancelTimeouts()
public final Request getTargetRequest()
public final Request getCurrentRequest()
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 int incrementAndGetCurrentRedirectCount()
public void setTimeoutsHolder(TimeoutsHolder timeoutsHolder)
public AtomicBoolean getInAuth()
public AtomicBoolean getInProxyAuth()
public ChannelState getChannelState()
public void setChannelState(ChannelState channelState)
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(io.netty.channel.Channel channel, boolean reuseChannel)
public io.netty.channel.Channel channel()
public boolean reuseChannel()
public boolean canRetry()
public SocketAddress getChannelRemoteAddress()
public void setTargetRequest(Request targetRequest)
public void setCurrentRequest(Request currentRequest)
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 Object getPartitionKey()
public Realm getRealm()
public void setRealm(Realm realm)
public Realm getProxyRealm()
public void setProxyRealm(Realm proxyRealm)
Copyright © 2015. All Rights Reserved.