java.lang.Object
software.sava.rpc.json.http.client.JsonHttpClient
- Direct Known Subclasses:
JsonRpcHttpClient
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Predicate<HttpResponse<byte[]>> protected final URIprotected final UnaryOperator<HttpRequest.Builder> protected final HttpClientprotected final Duration -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJsonHttpClient(URI endpoint, HttpClient httpClient, Duration requestTimeout) protectedJsonHttpClient(URI endpoint, HttpClient httpClient, Duration requestTimeout, UnaryOperator<HttpRequest.Builder> extendRequest, Predicate<HttpResponse<byte[]>> applyResponse) -
Method Summary
Modifier and TypeMethodDescriptionprotected static <R> Function<HttpResponse<byte[]>, R> applyResponse(BiFunction<byte[], systems.comodal.jsoniter.JsonIterator, R> adapter) protected static <R> Function<HttpResponse<byte[]>, R> applyResponse(Function<systems.comodal.jsoniter.JsonIterator, R> adapter) final URIendpoint()final HttpClientprotected final HttpRequestnewPostRequest(URI endpoint, Duration requestTimeout, String body) protected final HttpRequest.Builderprotected final HttpRequest.BuildernewRequest(String path) protected final HttpRequest.BuildernewRequest(String path, String method, HttpRequest.BodyPublisher bodyPublisher) protected final HttpRequest.BuildernewRequest(String method, HttpRequest.BodyPublisher bodyPublisher) protected final HttpRequest.BuildernewRequest(String path, Duration requestTimeout) protected final HttpRequest.BuildernewRequest(String path, Duration requestTimeout, String method, HttpRequest.BodyPublisher bodyPublisher) protected final HttpRequest.BuildernewRequest(URI endpoint) protected final HttpRequest.BuildernewRequest(URI endpoint, String method, HttpRequest.BodyPublisher bodyPublisher) protected final HttpRequest.BuildernewRequest(URI endpoint, Duration requestTimeout) protected final HttpRequest.BuildernewRequest(Duration requestTimeout) protected final HttpRequest.BuildernewRequest(Duration requestTimeout, String method, HttpRequest.BodyPublisher bodyPublisher) protected final <R> CompletableFuture<R> sendGetRequest(URI endpoint, Function<HttpResponse<byte[]>, R> parser) protected final <R> CompletableFuture<R> sendGetRequest(Function<HttpResponse<byte[]>, R> parser, String path) protected final <H,R> CompletableFuture <R> sendGetRequestNoWrap(HttpResponse.BodyHandler<H> bodyHandler, Function<HttpResponse<H>, R> parser, String path) protected final <H,R> CompletableFuture <R> sendGetRequestNoWrap(URI endpoint, HttpResponse.BodyHandler<H> bodyHandler, Function<HttpResponse<H>, R> parser) protected final <R> CompletableFuture<R> sendGetRequestNoWrap(URI endpoint, Function<HttpResponse<byte[]>, R> parser) protected final <R> CompletableFuture<R> sendGetRequestNoWrap(Function<HttpResponse<byte[]>, R> parser, String path) protected final <R> CompletableFuture<R> sendPostRequest(URI endpoint, Function<HttpResponse<byte[]>, R> parser, String body) protected final <R> CompletableFuture<R> sendPostRequest(URI endpoint, Function<HttpResponse<byte[]>, R> parser, Duration requestTimeout, String body) protected final <R> CompletableFuture<R> sendPostRequest(Function<HttpResponse<byte[]>, R> parser, String body) protected final <R> CompletableFuture<R> sendPostRequest(Function<HttpResponse<byte[]>, R> parser, Duration requestTimeout, String body) protected final <H,R> CompletableFuture <R> sendPostRequestNoWrap(HttpResponse.BodyHandler<H> bodyHandler, Function<HttpResponse<H>, R> parser, String body) protected final <H,R> CompletableFuture <R> sendPostRequestNoWrap(HttpResponse.BodyHandler<H> bodyHandler, Function<HttpResponse<H>, R> parser, Duration requestTimeout, String body) protected final <H,R> CompletableFuture <R> sendPostRequestNoWrap(URI endpoint, HttpResponse.BodyHandler<H> bodyHandler, Function<HttpResponse<H>, R> parser, String body) protected final <H,R> CompletableFuture <R> sendPostRequestNoWrap(URI endpoint, HttpResponse.BodyHandler<H> bodyHandler, Function<HttpResponse<H>, R> parser, Duration requestTimeout, String body) protected final <R> CompletableFuture<R> sendPostRequestNoWrap(URI endpoint, Function<HttpResponse<byte[]>, R> parser, String body) protected final <R> CompletableFuture<R> sendPostRequestNoWrap(URI endpoint, Function<HttpResponse<byte[]>, R> parser, Duration requestTimeout, String body) protected final <R> CompletableFuture<R> sendPostRequestNoWrap(Function<HttpResponse<byte[]>, R> parser, String body) protected final <R> CompletableFuture<R> sendPostRequestNoWrap(Function<HttpResponse<byte[]>, R> parser, Duration requestTimeout, String body) protected <R> Function<HttpResponse<byte[]>, R> wrapParser(Function<HttpResponse<byte[]>, R> parser)
-
Field Details
-
endpoint
-
httpClient
-
requestTimeout
-
extendRequest
-
applyResponse
-
-
Constructor Details
-
JsonHttpClient
protected JsonHttpClient(URI endpoint, HttpClient httpClient, Duration requestTimeout, UnaryOperator<HttpRequest.Builder> extendRequest, Predicate<HttpResponse<byte[]>> applyResponse) -
JsonHttpClient
-
-
Method Details
-
endpoint
-
httpClient
-
applyResponse
protected static <R> Function<HttpResponse<byte[]>,R> applyResponse(Function<systems.comodal.jsoniter.JsonIterator, R> adapter) -
applyResponse
protected static <R> Function<HttpResponse<byte[]>,R> applyResponse(BiFunction<byte[], systems.comodal.jsoniter.JsonIterator, R> adapter) -
wrapParser
-
newRequest
-
newRequest
-
newRequest
-
newRequest
-
newRequest
-
newRequest
-
newRequest
protected final HttpRequest.Builder newRequest(URI endpoint, String method, HttpRequest.BodyPublisher bodyPublisher) -
newRequest
protected final HttpRequest.Builder newRequest(Duration requestTimeout, String method, HttpRequest.BodyPublisher bodyPublisher) -
newRequest
protected final HttpRequest.Builder newRequest(String method, HttpRequest.BodyPublisher bodyPublisher) -
newRequest
protected final HttpRequest.Builder newRequest(String path, Duration requestTimeout, String method, HttpRequest.BodyPublisher bodyPublisher) -
newRequest
protected final HttpRequest.Builder newRequest(String path, String method, HttpRequest.BodyPublisher bodyPublisher) -
newPostRequest
-
sendPostRequest
protected final <R> CompletableFuture<R> sendPostRequest(URI endpoint, Function<HttpResponse<byte[]>, R> parser, Duration requestTimeout, String body) -
sendPostRequest
protected final <R> CompletableFuture<R> sendPostRequest(Function<HttpResponse<byte[]>, R> parser, Duration requestTimeout, String body) -
sendPostRequest
protected final <R> CompletableFuture<R> sendPostRequest(Function<HttpResponse<byte[]>, R> parser, String body) -
sendPostRequest
protected final <R> CompletableFuture<R> sendPostRequest(URI endpoint, Function<HttpResponse<byte[]>, R> parser, String body) -
sendGetRequest
protected final <R> CompletableFuture<R> sendGetRequest(Function<HttpResponse<byte[]>, R> parser, String path) -
sendGetRequest
protected final <R> CompletableFuture<R> sendGetRequest(URI endpoint, Function<HttpResponse<byte[]>, R> parser) -
sendPostRequestNoWrap
protected final <R> CompletableFuture<R> sendPostRequestNoWrap(URI endpoint, Function<HttpResponse<byte[]>, R> parser, Duration requestTimeout, String body) -
sendPostRequestNoWrap
protected final <R> CompletableFuture<R> sendPostRequestNoWrap(Function<HttpResponse<byte[]>, R> parser, Duration requestTimeout, String body) -
sendPostRequestNoWrap
protected final <R> CompletableFuture<R> sendPostRequestNoWrap(Function<HttpResponse<byte[]>, R> parser, String body) -
sendPostRequestNoWrap
protected final <R> CompletableFuture<R> sendPostRequestNoWrap(URI endpoint, Function<HttpResponse<byte[]>, R> parser, String body) -
sendGetRequestNoWrap
protected final <R> CompletableFuture<R> sendGetRequestNoWrap(Function<HttpResponse<byte[]>, R> parser, String path) -
sendGetRequestNoWrap
protected final <R> CompletableFuture<R> sendGetRequestNoWrap(URI endpoint, Function<HttpResponse<byte[]>, R> parser) -
sendPostRequestNoWrap
protected final <H,R> CompletableFuture<R> sendPostRequestNoWrap(URI endpoint, HttpResponse.BodyHandler<H> bodyHandler, Function<HttpResponse<H>, R> parser, Duration requestTimeout, String body) -
sendPostRequestNoWrap
protected final <H,R> CompletableFuture<R> sendPostRequestNoWrap(HttpResponse.BodyHandler<H> bodyHandler, Function<HttpResponse<H>, R> parser, Duration requestTimeout, String body) -
sendPostRequestNoWrap
protected final <H,R> CompletableFuture<R> sendPostRequestNoWrap(HttpResponse.BodyHandler<H> bodyHandler, Function<HttpResponse<H>, R> parser, String body) -
sendPostRequestNoWrap
protected final <H,R> CompletableFuture<R> sendPostRequestNoWrap(URI endpoint, HttpResponse.BodyHandler<H> bodyHandler, Function<HttpResponse<H>, R> parser, String body) -
sendGetRequestNoWrap
protected final <H,R> CompletableFuture<R> sendGetRequestNoWrap(HttpResponse.BodyHandler<H> bodyHandler, Function<HttpResponse<H>, R> parser, String path) -
sendGetRequestNoWrap
protected final <H,R> CompletableFuture<R> sendGetRequestNoWrap(URI endpoint, HttpResponse.BodyHandler<H> bodyHandler, Function<HttpResponse<H>, R> parser)
-