public final class

NettyResponseFuture

extends AbstractListenableFuture<V>
java.lang.Object
   ↳ com.ning.http.client.listenable.AbstractListenableFuture<V>
     ↳ com.ning.http.client.providers.netty.NettyResponseFuture<V>

Class Overview

A Future that can be used to track when an asynchronous HTTP request has been fully processed.

Summary

Constants
String MAX_RETRY
Public Constructors
NettyResponseFuture(URI uri, Request request, AsyncHandler<V> asyncHandler, HttpRequest nettyRequest, int responseTimeoutInMs, int idleConnectionTimeoutInMs, NettyAsyncHttpProvider asyncHttpProvider)
Public Methods
final void abort(Throwable t)
boolean cancel(boolean force)
boolean cannotBeReplay()
Return true if the Future cannot be recovered.
void content(V v)
final void done(Callable callable)
V get()
V get(long l, TimeUnit tu)
boolean getAndSetStatusReceived(boolean sr)
boolean getAndSetWriteBody(boolean writeBody)
boolean getAndSetWriteHeaders(boolean writeHeaders)
final HttpRequest getNettyRequest()
boolean hasExpired()
Is the Future still valid
boolean isCancelled()
boolean isConnectAllowed()
boolean isDone()
void setConnectAllowed(boolean allowConnect)
void setRequest(Request request)
void setReuseChannel(boolean reuseChannel)
String toString()
void touch()
Protected Methods
void attachChannel(Channel channel)
void attachChannel(Channel channel, boolean reuseChannel)
boolean canRetry()
Channel channel()
boolean getAndSetAuth(boolean inDigestAuth)
final AsyncHandler<V> getAsyncHandler()
final HttpResponse getHttpResponse()
final boolean getKeepAlive()
final Request getRequest()
NettyResponseFuture.STATE getState()
URI getURI()
int incrementAndGetCurrentRedirectCount()
boolean isInAuth()
NettyAsyncHttpProvider provider()
boolean reuseChannel()
final void setHttpResponse(HttpResponse httpResponse)
final void setKeepAlive(boolean keepAlive)
final void setNettyRequest(HttpRequest nettyRequest)
void setReaperFuture(Future<?> reaperFuture)
void setState(NettyResponseFuture.STATE state)
void setURI(URI uri)
[Expand]
Inherited Methods
From class com.ning.http.client.listenable.AbstractListenableFuture
From class java.lang.Object
From interface com.ning.http.client.ListenableFuture
From interface java.util.concurrent.Future

Constants

public static final String MAX_RETRY

Constant Value: "com.ning.http.client.providers.netty.maxRetry"

Public Constructors

public NettyResponseFuture (URI uri, Request request, AsyncHandler<V> asyncHandler, HttpRequest nettyRequest, int responseTimeoutInMs, int idleConnectionTimeoutInMs, NettyAsyncHttpProvider asyncHttpProvider)

Public Methods

public final void abort (Throwable t)

public boolean cancel (boolean force)

public boolean cannotBeReplay ()

Return true if the Future cannot 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.

public void content (V v)

public final void done (Callable callable)

public V get ()

Throws
InterruptedException
ExecutionException

public V get (long l, TimeUnit tu)

Throws
InterruptedException
TimeoutException
ExecutionException

public boolean getAndSetStatusReceived (boolean sr)

public boolean getAndSetWriteBody (boolean writeBody)

public boolean getAndSetWriteHeaders (boolean writeHeaders)

public final HttpRequest getNettyRequest ()

public boolean hasExpired ()

Is the Future still valid

Returns
  • true if response has expired and should be terminated.

public boolean isCancelled ()

public boolean isConnectAllowed ()

public boolean isDone ()

public void setConnectAllowed (boolean allowConnect)

public void setRequest (Request request)

public void setReuseChannel (boolean reuseChannel)

public String toString ()

public void touch ()

Protected Methods

protected void attachChannel (Channel channel)

protected void attachChannel (Channel channel, boolean reuseChannel)

protected boolean canRetry ()

protected Channel channel ()

protected boolean getAndSetAuth (boolean inDigestAuth)

protected final AsyncHandler<V> getAsyncHandler ()

protected final HttpResponse getHttpResponse ()

protected final boolean getKeepAlive ()

protected final Request getRequest ()

protected NettyResponseFuture.STATE getState ()

protected URI getURI ()

Throws
MalformedURLException

protected int incrementAndGetCurrentRedirectCount ()

protected boolean isInAuth ()

protected NettyAsyncHttpProvider provider ()

protected boolean reuseChannel ()

protected final void setHttpResponse (HttpResponse httpResponse)

protected final void setKeepAlive (boolean keepAlive)

protected final void setNettyRequest (HttpRequest nettyRequest)

protected void setReaperFuture (Future<?> reaperFuture)

protected void setState (NettyResponseFuture.STATE state)

protected void setURI (URI uri)