org.elasticsearch.util.http.client.providers
Class NettyResponseFuture<V>
java.lang.Object
org.elasticsearch.util.http.client.providers.NettyResponseFuture<V>
- Type Parameters:
V
-
- All Implemented Interfaces:
- java.util.concurrent.Future<V>, FutureImpl<V>
public final class NettyResponseFuture<V>
- extends java.lang.Object
- implements FutureImpl<V>
A Future
that can be used to track when an asynchronous HTTP request has been fully processed.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NettyResponseFuture
public NettyResponseFuture(Url url,
Request request,
AsyncHandler<V> asyncHandler,
org.jboss.netty.handler.codec.http.HttpRequest nettyRequest,
int responseTimeoutInMs)
getUrl
public Url getUrl()
throws java.net.MalformedURLException
- Throws:
java.net.MalformedURLException
setUrl
public void setUrl(Url url)
isDone
public boolean isDone()
-
- Specified by:
isDone
in interface java.util.concurrent.Future<V>
isCancelled
public boolean isCancelled()
-
- Specified by:
isCancelled
in interface java.util.concurrent.Future<V>
cancel
public boolean cancel(boolean force)
-
- Specified by:
cancel
in interface java.util.concurrent.Future<V>
get
public V get()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
-
- Specified by:
get
in interface java.util.concurrent.Future<V>
- Throws:
java.lang.InterruptedException
java.util.concurrent.ExecutionException
get
public V get(long l,
java.util.concurrent.TimeUnit tu)
throws java.lang.InterruptedException,
java.util.concurrent.TimeoutException,
java.util.concurrent.ExecutionException
-
- Specified by:
get
in interface java.util.concurrent.Future<V>
- Throws:
java.lang.InterruptedException
java.util.concurrent.TimeoutException
java.util.concurrent.ExecutionException
done
public final void done()
- Specified by:
done
in interface FutureImpl<V>
abort
public final void abort(java.lang.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()
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(java.util.concurrent.Future<java.lang.Object> reaperFuture)