public class DefaultAsyncRequestDefinition extends com.holonplatform.http.internal.rest.AbstractRequestDefinition<AsyncRestClient.AsyncRequestDefinition> implements AsyncRestClient.AsyncRequestDefinition
AsyncRestClient.AsyncRequestDefinition implementation.| Constructor and Description |
|---|
DefaultAsyncRequestDefinition(AsyncInvoker invoker)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
<T,R> CompletionStage<ResponseEntity<T>> |
invoke(HttpMethod method,
RequestEntity<R> requestEntity,
ResponseType<T> responseType)
Invoke the request and asynchronously receive a response back.
|
<T,R> CompletionStage<Optional<T>> |
invokeForEntity(HttpMethod method,
RequestEntity<R> requestEntity,
ResponseType<T> responseType)
Invoke the request and asynchronously receive back the response content entity.
|
<T,R> CompletionStage<ResponseEntity<T>> |
invokeForSuccess(HttpMethod method,
RequestEntity<R> requestEntity,
ResponseType<T> responseType)
Invoke the request and asynchronously receive a response back only if the response has a success
(
2xx) status code. |
accept, accept, acceptCharset, acceptCharset, acceptEncoding, acceptLanguage, acceptLanguage, authorizationBasic, authorizationBearer, cacheControl, getBaseRequestURI, getHeaders, getPropertySet, getQueryParameters, getRequestPath, getRequestURI, getTemplateParameters, header, path, propertySet, propertySet, queryParameter, resolve, resolve, target, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitaccept, accept, acceptCharset, acceptCharset, acceptEncoding, acceptLanguage, acceptLanguage, authorizationBasic, authorizationBearer, cacheControl, getBaseRequestURI, getHeaders, getPropertySet, getQueryParameters, getRequestPath, getRequestURI, getTemplateParameters, header, path, propertySet, propertySet, queryParameter, resolve, resolve, target, targetdelete, delete, delete, deleteForEntity, deleteForEntity, deleteOrFail, get, get, getAsList, getForEntity, getForEntity, getForStream, head, options, options, options, optionsForEntity, optionsForEntity, patch, patch, patch, patchForEntity, patchForEntity, post, post, post, postForEntity, postForEntity, postForLocation, put, put, put, putForEntity, putForEntity, trace, trace, trace, traceForEntity, traceForEntitypublic DefaultAsyncRequestDefinition(AsyncInvoker invoker)
invoker - Invoker to use to invoke for responsepublic <T,R> CompletionStage<ResponseEntity<T>> invoke(HttpMethod method, RequestEntity<R> requestEntity, ResponseType<T> responseType)
AsyncRestClient.AsyncInvocationThe response payload is processed and possibly converted by concrete client implementation.
invoke in interface AsyncRestClient.AsyncInvocationinvoke in interface RestClientOperations.InvocationOperations<CompletionStage<?>,CompletionStage<?>,CompletionStage<InputStream>,CompletionStage<?>,CompletionStage<Optional<URI>>>T - Response typeR - Request entity typemethod - Request methodrequestEntity - Request entityresponseType - Expected response payload typeCompletionStage to handle the ResponseEntity object as the result of the request
invocationpublic <T,R> CompletionStage<ResponseEntity<T>> invokeForSuccess(HttpMethod method, RequestEntity<R> requestEntity, ResponseType<T> responseType)
AsyncRestClient.AsyncInvocation2xx) status code.invokeForSuccess in interface AsyncRestClient.AsyncInvocationinvokeForSuccess in interface RestClientOperations.InvocationOperations<CompletionStage<?>,CompletionStage<?>,CompletionStage<InputStream>,CompletionStage<?>,CompletionStage<Optional<URI>>>T - Response typeR - Request entity typemethod - Request methodrequestEntity - Request entityresponseType - Expected response payload typeCompletionStage to handle the ResponseEntity object as a result of the request
invocationpublic <T,R> CompletionStage<Optional<T>> invokeForEntity(HttpMethod method, RequestEntity<R> requestEntity, ResponseType<T> responseType)
AsyncRestClient.AsyncInvocationinvokeForEntity in interface AsyncRestClient.AsyncInvocationinvokeForEntity in interface RestClientOperations.InvocationOperations<CompletionStage<?>,CompletionStage<?>,CompletionStage<InputStream>,CompletionStage<?>,CompletionStage<Optional<URI>>>T - Response typeR - Request entity typemethod - Request methodrequestEntity - Request entityresponseType - Expected response payload typeCompletionStage to handle the response payload of expected type as the result of the
request invocation, or an empty Optional if not present (empty response entity)Copyright © 2019 The Holon Platform. All rights reserved.