com.ning.http.client.providers.netty
Class NettyResponseFuture<V>

java.lang.Object
  extended by com.ning.http.client.providers.netty.NettyResponseFuture<V>
Type Parameters:
V -
All Implemented Interfaces:
FutureImpl<V>, Future<V>

public final class NettyResponseFuture<V>
extends Object
implements FutureImpl<V>

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


Constructor Summary
NettyResponseFuture(URI uri, Request request, AsyncHandler<V> asyncHandler, org.jboss.netty.handler.codec.http.HttpRequest nettyRequest, int responseTimeoutInMs, NettyAsyncHttpProvider asyncHttpProvider)
           
 
Method Summary
 void abort(Throwable t)
           
 boolean cancel(boolean force)
          
 void done()
           
 V get()
          
 V get(long l, TimeUnit tu)
          
 boolean getAndSetAuth(boolean inDigestAuth)
           
 boolean getAndSetStatusReceived(boolean sr)
           
 AsyncHandler<V> getAsyncHandler()
           
 org.jboss.netty.handler.codec.http.HttpResponse getHttpResponse()
           
 boolean getKeepAlive()
           
 org.jboss.netty.handler.codec.http.HttpRequest getNettyRequest()
           
 Request getRequest()
           
 com.ning.http.client.providers.netty.NettyResponseFuture.STATE getState()
           
 URI getURI()
           
 boolean hasExpired()
          Is the Future still valid
 int incrementAndGetCurrentRedirectCount()
           
 boolean isCancelled()
          
 boolean isDone()
          
 boolean isInAuth()
           
protected  NettyAsyncHttpProvider provider()
           
 void setHttpResponse(org.jboss.netty.handler.codec.http.HttpResponse httpResponse)
           
 void setKeepAlive(boolean keepAlive)
           
protected  void setNettyRequest(org.jboss.netty.handler.codec.http.HttpRequest nettyRequest)
           
 void setReaperFuture(Future<?> reaperFuture)
           
 void setState(com.ning.http.client.providers.netty.NettyResponseFuture.STATE state)
           
 void setURI(URI uri)
           
 String toString()
           
protected  void touch()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NettyResponseFuture

public NettyResponseFuture(URI uri,
                           Request request,
                           AsyncHandler<V> asyncHandler,
                           org.jboss.netty.handler.codec.http.HttpRequest nettyRequest,
                           int responseTimeoutInMs,
                           NettyAsyncHttpProvider asyncHttpProvider)
Method Detail

getURI

public URI getURI()
           throws MalformedURLException
Throws:
MalformedURLException

setURI

public void setURI(URI uri)

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>

hasExpired

public boolean hasExpired()
Is the Future still valid

Returns:
true iff response has expired and should be terminated.

get

public V get()
      throws InterruptedException,
             ExecutionException

Specified by:
get in interface Future<V>
Throws:
InterruptedException
ExecutionException

get

public V get(long l,
             TimeUnit tu)
      throws InterruptedException,
             TimeoutException,
             ExecutionException

Specified by:
get in interface Future<V>
Throws:
InterruptedException
TimeoutException
ExecutionException

done

public final void done()
Specified by:
done in interface FutureImpl<V>

abort

public final void abort(Throwable t)
Specified by:
abort in interface FutureImpl<V>

getRequest

public final Request getRequest()

getNettyRequest

public final org.jboss.netty.handler.codec.http.HttpRequest getNettyRequest()

setNettyRequest

protected final void setNettyRequest(org.jboss.netty.handler.codec.http.HttpRequest nettyRequest)

getAsyncHandler

public final AsyncHandler<V> getAsyncHandler()

getKeepAlive

public final boolean getKeepAlive()

setKeepAlive

public final void setKeepAlive(boolean keepAlive)

getHttpResponse

public final org.jboss.netty.handler.codec.http.HttpResponse getHttpResponse()

setHttpResponse

public final void setHttpResponse(org.jboss.netty.handler.codec.http.HttpResponse httpResponse)

incrementAndGetCurrentRedirectCount

public int incrementAndGetCurrentRedirectCount()

setReaperFuture

public void setReaperFuture(Future<?> reaperFuture)

isInAuth

public boolean isInAuth()

getAndSetAuth

public boolean getAndSetAuth(boolean inDigestAuth)

getState

public com.ning.http.client.providers.netty.NettyResponseFuture.STATE getState()

setState

public void setState(com.ning.http.client.providers.netty.NettyResponseFuture.STATE state)

getAndSetStatusReceived

public boolean getAndSetStatusReceived(boolean sr)

touch

protected void touch()

provider

protected NettyAsyncHttpProvider provider()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010. All Rights Reserved.