Class NettyResponseFuture<V>

  • Type Parameters:
    V - the result type
    All Implemented Interfaces:
    Future<V>, ListenableFuture<V>

    public final class NettyResponseFuture<V>
    extends Object
    implements ListenableFuture<V>
    A Future that can be used to track when an asynchronous HTTP request has been fully processed.
    • Field Detail

      • pendingException

        public Throwable pendingException
    • Method Detail

      • takePartitionKeyLock

        public Object takePartitionKeyLock()
      • isDone

        public boolean isDone()
        Specified by:
        isDone in interface Future<V>
      • isCancelled

        public boolean isCancelled()
        Specified by:
        isCancelled in interface Future<V>
      • cancel

        public boolean cancel​(boolean force)
        Specified by:
        cancel in interface Future<V>
      • done

        public void done()
        Description copied from interface: ListenableFuture
        Terminate and if there is no exception, mark this Future as done and release the internal lock.
        Specified by:
        done in interface ListenableFuture<V>
      • touch

        public void touch()
        Description copied from interface: ListenableFuture
        Touch the current instance to prevent external service to times out.
        Specified by:
        touch in interface ListenableFuture<V>
      • addListener

        public ListenableFuture<V> addListener​(Runnable listener,
                                               Executor exec)
        Description copied from interface: ListenableFuture
        Adds a listener and executor to the ListenableFuture. The listener will be passed to the executor for execution when the Future's computation is complete.
        Executor can be null, in that case executor will be executed in the thread where completion happens.
        There is no guaranteed ordering of execution of listeners, they may get called in the order they were added and they may get called out of order, but any listener added through this method is guaranteed to be called once the computation is complete.
        Specified by:
        addListener in interface ListenableFuture<V>
        Parameters:
        listener - the listener to run when the computation is complete.
        exec - the executor to run the listener in.
        Returns:
        this Future
      • getUri

        public Uri getUri()
      • cancelTimeouts

        public void cancelTimeouts()
      • getTargetRequest

        public Request getTargetRequest()
      • setTargetRequest

        public void setTargetRequest​(Request targetRequest)
      • getCurrentRequest

        public Request getCurrentRequest()
      • setCurrentRequest

        public void setCurrentRequest​(Request currentRequest)
      • setNettyRequest

        public void setNettyRequest​(NettyRequest nettyRequest)
      • setAsyncHandler

        public void setAsyncHandler​(AsyncHandler<V> asyncHandler)
      • isKeepAlive

        public boolean isKeepAlive()
      • setKeepAlive

        public void setKeepAlive​(boolean keepAlive)
      • incrementAndGetCurrentRedirectCount

        public int incrementAndGetCurrentRedirectCount()
      • setTimeoutsHolder

        public void setTimeoutsHolder​(TimeoutsHolder timeoutsHolder)
      • isInAuth

        public boolean isInAuth()
      • setInAuth

        public void setInAuth​(boolean inAuth)
      • isAndSetInAuth

        public boolean isAndSetInAuth​(boolean set)
      • isInProxyAuth

        public boolean isInProxyAuth()
      • setInProxyAuth

        public void setInProxyAuth​(boolean inProxyAuth)
      • isAndSetInProxyAuth

        public boolean isAndSetInProxyAuth​(boolean inProxyAuth)
      • setChannelState

        public void setChannelState​(ChannelState channelState)
      • isStreamConsumed

        public boolean isStreamConsumed()
      • setStreamConsumed

        public void setStreamConsumed​(boolean streamConsumed)
      • getLastTouch

        public long getLastTouch()
      • isHeadersAlreadyWrittenOnContinue

        public boolean isHeadersAlreadyWrittenOnContinue()
      • setHeadersAlreadyWrittenOnContinue

        public void setHeadersAlreadyWrittenOnContinue​(boolean headersAlreadyWrittenOnContinue)
      • isDontWriteBodyBecauseExpectContinue

        public boolean isDontWriteBodyBecauseExpectContinue()
      • setDontWriteBodyBecauseExpectContinue

        public void setDontWriteBodyBecauseExpectContinue​(boolean dontWriteBodyBecauseExpectContinue)
      • isConnectAllowed

        public boolean isConnectAllowed()
      • setConnectAllowed

        public void setConnectAllowed​(boolean allowConnect)
      • attachChannel

        public void attachChannel​(io.netty.channel.Channel channel,
                                  boolean reuseChannel)
      • channel

        public io.netty.channel.Channel channel()
      • isReuseChannel

        public boolean isReuseChannel()
      • setReuseChannel

        public void setReuseChannel​(boolean reuseChannel)
      • incrementRetryAndCheck

        public boolean incrementRetryAndCheck()
      • isReplayPossible

        public boolean isReplayPossible()
        Return true if the 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.
        Returns:
        true if that Future cannot be recovered.
      • getStart

        public long getStart()
      • getPartitionKey

        public Object getPartitionKey()
      • acquirePartitionLockLazily

        public void acquirePartitionLockLazily()
                                        throws IOException
        Throws:
        IOException
      • getRealm

        public Realm getRealm()
      • setRealm

        public void setRealm​(Realm realm)
      • getProxyRealm

        public Realm getProxyRealm()
      • setProxyRealm

        public void setProxyRealm​(Realm proxyRealm)