public abstract class StandardHttpClient<C extends HttpClient,F extends HttpClient.Factory,T extends StandardHttpClientBuilder<C,F,?>> extends Object implements HttpClient, Interceptor.RequestTags
HttpClient.Builder, HttpClient.DerivedClientBuilder, HttpClient.Factory| Modifier and Type | Field and Description |
|---|---|
protected StandardHttpClientBuilder<C,F,T> |
builder |
| Modifier | Constructor and Description |
|---|---|
protected |
StandardHttpClient(StandardHttpClientBuilder<C,F,T> builder) |
| Modifier and Type | Method and Description |
|---|---|
abstract CompletableFuture<WebSocketResponse> |
buildWebSocketDirect(StandardWebSocketBuilder standardWebSocketBuilder,
WebSocket.Listener listener) |
CompletableFuture<HttpResponse<AsyncBody>> |
consumeBytes(HttpRequest request,
AsyncBody.Consumer<List<ByteBuffer>> consumer)
Send a request and consume the bytes of the resulting response body
|
abstract CompletableFuture<HttpResponse<AsyncBody>> |
consumeBytesDirect(StandardHttpRequest request,
AsyncBody.Consumer<List<ByteBuffer>> consumer) |
<V> V |
getTag(Class<V> type) |
HttpClient.DerivedClientBuilder |
newBuilder()
Create a builder that starts with the same state as this client.
|
HttpRequest.Builder |
newHttpRequestBuilder() |
WebSocket.Builder |
newWebSocketBuilder() |
<V> CompletableFuture<V> |
orTimeout(CompletableFuture<V> future,
RequestConfig requestConfig) |
protected <V> void |
retryWithExponentialBackoff(CompletableFuture<V> result,
Supplier<CompletableFuture<V>> action,
URI uri,
Function<V,Integer> codeExtractor,
Consumer<V> cancel) |
protected <V> void |
retryWithExponentialBackoff(CompletableFuture<V> result,
Supplier<CompletableFuture<V>> action,
URI uri,
Function<V,Integer> codeExtractor,
Consumer<V> cancel,
ExponentialBackoffIntervalCalculator retryIntervalCalculator,
RequestConfig requestConfig)
Will retry the action if needed based upon the retry settings provided by the ExponentialBackoffIntervalCalculator.
|
<V> CompletableFuture<HttpResponse<V>> |
sendAsync(HttpRequest request,
Class<V> type)
Send an async request
A Reader or InputStream result must be closed by the caller to properly cleanup resources. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcloseprotected StandardHttpClientBuilder<C extends HttpClient,F extends HttpClient.Factory,T extends StandardHttpClientBuilder<C,F,?>> builder
protected StandardHttpClient(StandardHttpClientBuilder<C,F,T> builder)
public abstract CompletableFuture<WebSocketResponse> buildWebSocketDirect(StandardWebSocketBuilder standardWebSocketBuilder, WebSocket.Listener listener)
public abstract CompletableFuture<HttpResponse<AsyncBody>> consumeBytesDirect(StandardHttpRequest request, AsyncBody.Consumer<List<ByteBuffer>> consumer)
public HttpClient.DerivedClientBuilder newBuilder()
HttpClientnewBuilder in interface HttpClientpublic <V> CompletableFuture<HttpResponse<V>> sendAsync(HttpRequest request, Class<V> type)
HttpClientsendAsync in interface HttpClientV - return typerequest - the HttpRequest to send asynchronouslytype - one of InputStream, Reader, String, byte[]public CompletableFuture<HttpResponse<AsyncBody>> consumeBytes(HttpRequest request, AsyncBody.Consumer<List<ByteBuffer>> consumer)
HttpClientHtttpClient implementations will provide ByteBuffers that may be held directly.
consumeBytes in interface HttpClientrequest - the HttpRequest to sendconsumer - the response body consumerpublic <V> CompletableFuture<V> orTimeout(CompletableFuture<V> future, RequestConfig requestConfig)
protected <V> void retryWithExponentialBackoff(CompletableFuture<V> result, Supplier<CompletableFuture<V>> action, URI uri, Function<V,Integer> codeExtractor, Consumer<V> cancel, ExponentialBackoffIntervalCalculator retryIntervalCalculator, RequestConfig requestConfig)
protected <V> void retryWithExponentialBackoff(CompletableFuture<V> result, Supplier<CompletableFuture<V>> action, URI uri, Function<V,Integer> codeExtractor, Consumer<V> cancel)
public WebSocket.Builder newWebSocketBuilder()
newWebSocketBuilder in interface HttpClientpublic HttpRequest.Builder newHttpRequestBuilder()
newHttpRequestBuilder in interface HttpClientpublic <V> V getTag(Class<V> type)
getTag in interface Interceptor.RequestTagsCopyright © 2015–2023 Red Hat. All rights reserved.