Package org.apache.http.impl.nio.client
Class CloseableHttpPipeliningClient
- java.lang.Object
-
- org.apache.http.impl.nio.client.CloseableHttpAsyncClient
-
- org.apache.http.impl.nio.client.CloseableHttpPipeliningClient
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,HttpAsyncClient
,HttpPipeliningClient
- Direct Known Subclasses:
CloseableHttpAsyncClientBase
@Contract(threading=SAFE) public abstract class CloseableHttpPipeliningClient extends CloseableHttpAsyncClient implements HttpPipeliningClient
Base implementation ofHttpPipeliningClient
that also implementsCloseable
.- Since:
- 4.1
-
-
Constructor Summary
Constructors Constructor Description CloseableHttpPipeliningClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> java.util.concurrent.Future<java.util.List<T>>
execute(org.apache.http.HttpHost target, java.util.List<? extends org.apache.http.nio.protocol.HttpAsyncRequestProducer> requestProducers, java.util.List<? extends org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>> responseConsumers, org.apache.http.concurrent.FutureCallback<java.util.List<T>> callback)
Initiates pipelined execution of a sequence of requests.java.util.concurrent.Future<java.util.List<org.apache.http.HttpResponse>>
execute(org.apache.http.HttpHost target, java.util.List<org.apache.http.HttpRequest> requests, org.apache.http.concurrent.FutureCallback<java.util.List<org.apache.http.HttpResponse>> callback)
Initiates pipelined execution of a sequence of requests against the given target.java.util.concurrent.Future<java.util.List<org.apache.http.HttpResponse>>
execute(org.apache.http.HttpHost target, java.util.List<org.apache.http.HttpRequest> requests, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<java.util.List<org.apache.http.HttpResponse>> callback)
Initiates pipelined execution of a sequence of requests against the given target using the given context.-
Methods inherited from class org.apache.http.impl.nio.client.CloseableHttpAsyncClient
execute, execute, execute, execute, execute, isRunning, start
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.http.nio.client.HttpAsyncClient
execute, execute, execute, execute, execute, execute
-
Methods inherited from interface org.apache.http.nio.client.HttpPipeliningClient
execute
-
-
-
-
Method Detail
-
execute
public <T> java.util.concurrent.Future<java.util.List<T>> execute(org.apache.http.HttpHost target, java.util.List<? extends org.apache.http.nio.protocol.HttpAsyncRequestProducer> requestProducers, java.util.List<? extends org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T>> responseConsumers, org.apache.http.concurrent.FutureCallback<java.util.List<T>> callback)
Description copied from interface:HttpPipeliningClient
Initiates pipelined execution of a sequence of requests.The request producers passed to this method will be used to generate a request message and stream out its content without buffering it in memory. The response consumers passed to this method will be used to process a response message without buffering its content in memory.
- Specified by:
execute
in interfaceHttpPipeliningClient
- Type Parameters:
T
- the result type of request execution.- Parameters:
target
- the target host for the request.requestProducers
- list of request producers.responseConsumers
- list of response consumers.callback
- future callback.- Returns:
- future representing pending completion of the operation.
-
execute
public java.util.concurrent.Future<java.util.List<org.apache.http.HttpResponse>> execute(org.apache.http.HttpHost target, java.util.List<org.apache.http.HttpRequest> requests, org.apache.http.concurrent.FutureCallback<java.util.List<org.apache.http.HttpResponse>> callback)
Description copied from interface:HttpPipeliningClient
Initiates pipelined execution of a sequence of requests against the given target.- Specified by:
execute
in interfaceHttpPipeliningClient
- Parameters:
target
- the target host for the requests. Implementations may acceptnull
if they can still determine a route, for example to a default target or by inspecting the request.requests
- the requests to executecallback
- future callback.- Returns:
- future representing pending completion of the operation.
-
execute
public java.util.concurrent.Future<java.util.List<org.apache.http.HttpResponse>> execute(org.apache.http.HttpHost target, java.util.List<org.apache.http.HttpRequest> requests, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<java.util.List<org.apache.http.HttpResponse>> callback)
Description copied from interface:HttpPipeliningClient
Initiates pipelined execution of a sequence of requests against the given target using the given context.Please note it may be unsafe to interact with the context instance while the request is still being executed.
- Specified by:
execute
in interfaceHttpPipeliningClient
- Parameters:
target
- the target host for the requests. Implementations may acceptnull
if they can still determine a route, for example to a default target or by inspecting the request.requests
- the requests to executecontext
- the context to use for the execution, ornull
to use the default contextcallback
- future callback.- Returns:
- future representing pending completion of the operation.
-
-