public class GrizzlyHttpClient extends Object implements HttpClient
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
GrizzlyHttpClient.RequestConfigurer |
| Modifier and Type | Field and Description |
|---|---|
static String |
CUSTOM_MAX_HTTP_PACKET_HEADER_SIZE |
PHASE_NAMEPHASE_NAME| Constructor and Description |
|---|
GrizzlyHttpClient(HttpClientConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
protected com.ning.http.client.ProxyServer |
buildProxy(ProxyConfig proxyConfig) |
protected com.ning.http.client.RequestBuilder |
createRequestBuilder(HttpRequest request,
GrizzlyHttpClient.RequestConfigurer requestConfigurer) |
protected void |
doConfigureProxy(com.ning.http.client.AsyncHttpClientConfig.Builder builder,
ProxyConfig proxyConfig) |
protected ProxyConfig |
getProxyConfig() |
protected void |
populateHeaders(HttpRequest request,
com.ning.http.client.RequestBuilder builder) |
HttpResponse |
send(HttpRequest request,
int responseTimeout,
boolean followRedirects,
HttpRequestAuthentication authentication)
Sends a HttpRequest blocking the current thread until a response is available for the request times out.
|
void |
send(HttpRequest request,
int responseTimeout,
boolean followRedirects,
HttpRequestAuthentication authentication,
CompletionHandler<HttpResponse,Exception> completionHandler,
WorkManager workManager)
Sends a HttpRequest without blocking the current thread.
|
HttpResponse |
sendAndDefer(HttpRequest request,
int responseTimeout,
boolean followRedirects,
HttpRequestAuthentication authentication)
Blocking send which uses a
PipedOutputStream to populate the HTTP response as it arrives and propagates a
PipedInputStream as soon as the response headers are parsed. |
InputStream |
sendAndReceiveInputStream(HttpRequest request,
int responseTimeout,
boolean followRedirects,
HttpRequestAuthentication authentication)
Sends a HttpRequest blocking the current thread until a response is available for the request times out.
|
HttpResponse |
sendAndWait(HttpRequest request,
int responseTimeout,
boolean followRedirects,
HttpRequestAuthentication authentication)
Blocking send which waits to load the whole response to memory before propagating it.
|
void |
start() |
void |
stop() |
public static final String CUSTOM_MAX_HTTP_PACKET_HEADER_SIZE
public GrizzlyHttpClient(HttpClientConfiguration config)
public void start()
throws MuleException
start in interface StartableMuleExceptionprotected void doConfigureProxy(com.ning.http.client.AsyncHttpClientConfig.Builder builder,
ProxyConfig proxyConfig)
protected final com.ning.http.client.ProxyServer buildProxy(ProxyConfig proxyConfig)
public HttpResponse send(HttpRequest request, int responseTimeout, boolean followRedirects, HttpRequestAuthentication authentication) throws IOException, TimeoutException
HttpClientsend in interface HttpClientIOExceptionTimeoutExceptionpublic HttpResponse sendAndDefer(HttpRequest request, int responseTimeout, boolean followRedirects, HttpRequestAuthentication authentication) throws IOException, TimeoutException
PipedOutputStream to populate the HTTP response as it arrives and propagates a
PipedInputStream as soon as the response headers are parsed.
Because of the internal buffer used to hold the arriving chunks, the response MUST be eventually read or the worker threads
will block waiting to allocate them. Likewise, read/write speed differences could cause issues. The buffer size can be
customized for these reason.IOExceptionTimeoutExceptionpublic HttpResponse sendAndWait(HttpRequest request, int responseTimeout, boolean followRedirects, HttpRequestAuthentication authentication) throws IOException, TimeoutException
IOExceptionTimeoutExceptionpublic void send(HttpRequest request, int responseTimeout, boolean followRedirects, HttpRequestAuthentication authentication, CompletionHandler<HttpResponse,Exception> completionHandler, WorkManager workManager)
HttpClientsend in interface HttpClientprotected com.ning.http.client.RequestBuilder createRequestBuilder(HttpRequest request, GrizzlyHttpClient.RequestConfigurer requestConfigurer) throws IOException
IOExceptionprotected void populateHeaders(HttpRequest request, com.ning.http.client.RequestBuilder builder)
protected ProxyConfig getProxyConfig()
public InputStream sendAndReceiveInputStream(HttpRequest request, int responseTimeout, boolean followRedirects, HttpRequestAuthentication authentication) throws IOException, TimeoutException
HttpClientsendAndReceiveInputStream in interface HttpClientIOExceptionTimeoutExceptionCopyright © 2003–2018 MuleSoft, Inc.. All rights reserved.