public interface AsyncRestOperations
AsyncRestTemplate. Not often used directly, but a useful
option to enhance testability, as it can easily be mocked or stubbed.AsyncRestTemplate,
RestOperations| Modifier and Type | Method and Description |
|---|---|
ListenableFuture<?> |
delete(java.lang.String url,
java.util.Map<java.lang.String,?> uriVariables)
Asynchronously delete the resources at the specified URI.
|
ListenableFuture<?> |
delete(java.lang.String url,
java.lang.Object... uriVariables)
Asynchronously delete the resources at the specified URI.
|
ListenableFuture<?> |
delete(java.net.URI url)
Asynchronously delete the resources at the specified URI.
|
<T> ListenableFuture<ResponseEntity<T>> |
exchange(java.lang.String url,
HttpMethod method,
HttpEntity<?> requestEntity,
java.lang.Class<T> responseType,
java.util.Map<java.lang.String,?> uriVariables)
Asynchronously execute the HTTP method to the given URI template, writing the
given request entity to the request, and returns the response as
ResponseEntity. |
<T> ListenableFuture<ResponseEntity<T>> |
exchange(java.lang.String url,
HttpMethod method,
HttpEntity<?> requestEntity,
java.lang.Class<T> responseType,
java.lang.Object... uriVariables)
Asynchronously execute the HTTP method to the given URI template, writing the
given request entity to the request, and returns the response as
ResponseEntity. |
<T> ListenableFuture<ResponseEntity<T>> |
exchange(java.lang.String url,
HttpMethod method,
HttpEntity<?> requestEntity,
ParameterizedTypeReference<T> responseType,
java.util.Map<java.lang.String,?> uriVariables)
Asynchronously execute the HTTP method to the given URI template, writing the given
request entity to the request, and returns the response as
ResponseEntity. |
<T> ListenableFuture<ResponseEntity<T>> |
exchange(java.lang.String url,
HttpMethod method,
HttpEntity<?> requestEntity,
ParameterizedTypeReference<T> responseType,
java.lang.Object... uriVariables)
Asynchronously execute the HTTP method to the given URI template, writing the given
request entity to the request, and returns the response as
ResponseEntity. |
<T> ListenableFuture<ResponseEntity<T>> |
exchange(java.net.URI url,
HttpMethod method,
HttpEntity<?> requestEntity,
java.lang.Class<T> responseType)
Asynchronously execute the HTTP method to the given URI template, writing the
given request entity to the request, and returns the response as
ResponseEntity. |
<T> ListenableFuture<ResponseEntity<T>> |
exchange(java.net.URI url,
HttpMethod method,
HttpEntity<?> requestEntity,
ParameterizedTypeReference<T> responseType)
Asynchronously execute the HTTP method to the given URI template, writing the given
request entity to the request, and returns the response as
ResponseEntity. |
<T> ListenableFuture<T> |
execute(java.lang.String url,
HttpMethod method,
AsyncRequestCallback requestCallback,
ResponseExtractor<T> responseExtractor,
java.util.Map<java.lang.String,?> uriVariables)
Asynchronously execute the HTTP method to the given URI template, preparing the
request with the
AsyncRequestCallback, and reading the response with a
ResponseExtractor. |
<T> ListenableFuture<T> |
execute(java.lang.String url,
HttpMethod method,
AsyncRequestCallback requestCallback,
ResponseExtractor<T> responseExtractor,
java.lang.Object... uriVariables)
Asynchronously execute the HTTP method to the given URI template, preparing the
request with the
AsyncRequestCallback, and reading the response with a
ResponseExtractor. |
<T> ListenableFuture<T> |
execute(java.net.URI url,
HttpMethod method,
AsyncRequestCallback requestCallback,
ResponseExtractor<T> responseExtractor)
Asynchronously execute the HTTP method to the given URL, preparing the request
with the
AsyncRequestCallback, and reading the response with a
ResponseExtractor. |
<T> ListenableFuture<ResponseEntity<T>> |
getForEntity(java.lang.String url,
java.lang.Class<T> responseType,
java.util.Map<java.lang.String,?> uriVariables)
Asynchronously retrieve a representation by doing a GET on the URI template.
|
<T> ListenableFuture<ResponseEntity<T>> |
getForEntity(java.lang.String url,
java.lang.Class<T> responseType,
java.lang.Object... uriVariables)
Asynchronously retrieve an entity by doing a GET on the specified URL.
|
<T> ListenableFuture<ResponseEntity<T>> |
getForEntity(java.net.URI url,
java.lang.Class<T> responseType)
Asynchronously retrieve a representation by doing a GET on the URL.
|
RestOperations |
getRestOperations()
Expose the synchronous Spring RestTemplate to allow synchronous invocation.
|
ListenableFuture<HttpHeaders> |
headForHeaders(java.lang.String url,
java.util.Map<java.lang.String,?> uriVariables)
Asynchronously retrieve all headers of the resource specified by the URI template.
|
ListenableFuture<HttpHeaders> |
headForHeaders(java.lang.String url,
java.lang.Object... uriVariables)
Asynchronously retrieve all headers of the resource specified by the URI template.
|
ListenableFuture<HttpHeaders> |
headForHeaders(java.net.URI url)
Asynchronously retrieve all headers of the resource specified by the URL.
|
ListenableFuture<java.util.Set<HttpMethod>> |
optionsForAllow(java.lang.String url,
java.util.Map<java.lang.String,?> uriVariables)
Asynchronously return the value of the Allow header for the given URI.
|
ListenableFuture<java.util.Set<HttpMethod>> |
optionsForAllow(java.lang.String url,
java.lang.Object... uriVariables)
Asynchronously return the value of the Allow header for the given URI.
|
ListenableFuture<java.util.Set<HttpMethod>> |
optionsForAllow(java.net.URI url)
Asynchronously return the value of the Allow header for the given URL.
|
<T> ListenableFuture<ResponseEntity<T>> |
postForEntity(java.lang.String url,
HttpEntity<?> request,
java.lang.Class<T> responseType,
java.util.Map<java.lang.String,?> uriVariables)
Create a new resource by POSTing the given object to the URI template,
and asynchronously returns the response as
ResponseEntity. |
<T> ListenableFuture<ResponseEntity<T>> |
postForEntity(java.lang.String url,
HttpEntity<?> request,
java.lang.Class<T> responseType,
java.lang.Object... uriVariables)
Create a new resource by POSTing the given object to the URI template,
and asynchronously returns the response as
ResponseEntity. |
<T> ListenableFuture<ResponseEntity<T>> |
postForEntity(java.net.URI url,
HttpEntity<?> request,
java.lang.Class<T> responseType)
Create a new resource by POSTing the given object to the URL,
and asynchronously returns the response as
ResponseEntity. |
ListenableFuture<java.net.URI> |
postForLocation(java.lang.String url,
HttpEntity<?> request,
java.util.Map<java.lang.String,?> uriVariables)
Create a new resource by POSTing the given object to the URI template, and
asynchronously returns the value of the
Location header. |
ListenableFuture<java.net.URI> |
postForLocation(java.lang.String url,
HttpEntity<?> request,
java.lang.Object... uriVariables)
Create a new resource by POSTing the given object to the URI template, and
asynchronously returns the value of the
Location header. |
ListenableFuture<java.net.URI> |
postForLocation(java.net.URI url,
HttpEntity<?> request)
Create a new resource by POSTing the given object to the URL, and asynchronously
returns the value of the
Location header. |
ListenableFuture<?> |
put(java.lang.String url,
HttpEntity<?> request,
java.util.Map<java.lang.String,?> uriVariables)
Creates a new resource by PUTting the given object to URI template.
|
ListenableFuture<?> |
put(java.lang.String url,
HttpEntity<?> request,
java.lang.Object... uriVariables)
Create or update a resource by PUTting the given object to the URI.
|
ListenableFuture<?> |
put(java.net.URI url,
HttpEntity<?> request)
Creates a new resource by PUTting the given object to URL.
|
RestOperations getRestOperations()
<T> ListenableFuture<ResponseEntity<T>> getForEntity(java.lang.String url, java.lang.Class<T> responseType, java.lang.Object... uriVariables) throws RestClientException
ResponseEntity.
URI Template variables are expanded using the given URI variables, if any.
url - the URLresponseType - the type of the return valueuriVariables - the variables to expand the templateFutureRestClientException<T> ListenableFuture<ResponseEntity<T>> getForEntity(java.lang.String url, java.lang.Class<T> responseType, java.util.Map<java.lang.String,?> uriVariables) throws RestClientException
ResponseEntity.
URI Template variables are expanded using the given map.
url - the URLresponseType - the type of the return valueuriVariables - the map containing variables for the URI templateFutureRestClientException<T> ListenableFuture<ResponseEntity<T>> getForEntity(java.net.URI url, java.lang.Class<T> responseType) throws RestClientException
ResponseEntity.url - the URLresponseType - the type of the return valueFutureRestClientExceptionListenableFuture<HttpHeaders> headForHeaders(java.lang.String url, java.lang.Object... uriVariables) throws RestClientException
URI Template variables are expanded using the given URI variables, if any.
url - the URLuriVariables - the variables to expand the templateFutureRestClientExceptionListenableFuture<HttpHeaders> headForHeaders(java.lang.String url, java.util.Map<java.lang.String,?> uriVariables) throws RestClientException
URI Template variables are expanded using the given map.
url - the URLuriVariables - the map containing variables for the URI templateFutureRestClientExceptionListenableFuture<HttpHeaders> headForHeaders(java.net.URI url) throws RestClientException
url - the URLFutureRestClientExceptionListenableFuture<java.net.URI> postForLocation(java.lang.String url, HttpEntity<?> request, java.lang.Object... uriVariables) throws RestClientException
Location header. This header
typically indicates where the new resource is stored.
URI Template variables are expanded using the given URI variables, if any.
url - the URLrequest - the Object to be POSTed (may be null)uriVariables - the variables to expand the templateLocation header wrapped in a FutureRestClientExceptionHttpEntityListenableFuture<java.net.URI> postForLocation(java.lang.String url, HttpEntity<?> request, java.util.Map<java.lang.String,?> uriVariables) throws RestClientException
Location header. This header
typically indicates where the new resource is stored.
URI Template variables are expanded using the given map.
url - the URLrequest - the Object to be POSTed (may be null)uriVariables - the variables to expand the templateLocation header wrapped in a FutureRestClientExceptionHttpEntityListenableFuture<java.net.URI> postForLocation(java.net.URI url, HttpEntity<?> request) throws RestClientException
Location header. This header typically indicates
where the new resource is stored.url - the URLrequest - the Object to be POSTed (may be null)Location header wrapped in a FutureRestClientExceptionHttpEntity<T> ListenableFuture<ResponseEntity<T>> postForEntity(java.lang.String url, HttpEntity<?> request, java.lang.Class<T> responseType, java.lang.Object... uriVariables) throws RestClientException
ResponseEntity.
URI Template variables are expanded using the given URI variables, if any.
url - the URLrequest - the Object to be POSTed (may be null)uriVariables - the variables to expand the templateFutureRestClientExceptionHttpEntity<T> ListenableFuture<ResponseEntity<T>> postForEntity(java.lang.String url, HttpEntity<?> request, java.lang.Class<T> responseType, java.util.Map<java.lang.String,?> uriVariables) throws RestClientException
ResponseEntity.
URI Template variables are expanded using the given map.
url - the URLrequest - the Object to be POSTed (may be null)uriVariables - the variables to expand the templateFutureRestClientExceptionHttpEntity<T> ListenableFuture<ResponseEntity<T>> postForEntity(java.net.URI url, HttpEntity<?> request, java.lang.Class<T> responseType) throws RestClientException
ResponseEntity.url - the URLrequest - the Object to be POSTed (may be null)FutureRestClientExceptionHttpEntityListenableFuture<?> put(java.lang.String url, HttpEntity<?> request, java.lang.Object... uriVariables) throws RestClientException
URI Template variables are expanded using the given URI variables, if any.
The Future will return a null result upon completion.
url - the URLrequest - the Object to be PUT (may be null)uriVariables - the variables to expand the templateRestClientExceptionHttpEntityListenableFuture<?> put(java.lang.String url, HttpEntity<?> request, java.util.Map<java.lang.String,?> uriVariables) throws RestClientException
URI Template variables are expanded using the given map.
The Future will return a null result upon completion.
url - the URLrequest - the Object to be PUT (may be null)uriVariables - the variables to expand the templateRestClientExceptionHttpEntityListenableFuture<?> put(java.net.URI url, HttpEntity<?> request) throws RestClientException
The Future will return a null result upon completion.
url - the URLrequest - the Object to be PUT (may be null)RestClientExceptionHttpEntityListenableFuture<?> delete(java.lang.String url, java.lang.Object... uriVariables) throws RestClientException
URI Template variables are expanded using the given URI variables, if any.
The Future will return a null result upon completion.
url - the URLuriVariables - the variables to expand in the templateRestClientExceptionListenableFuture<?> delete(java.lang.String url, java.util.Map<java.lang.String,?> uriVariables) throws RestClientException
URI Template variables are expanded using the given URI variables, if any.
The Future will return a null result upon completion.
url - the URLuriVariables - the variables to expand in the templateRestClientExceptionListenableFuture<?> delete(java.net.URI url) throws RestClientException
URI Template variables are expanded using the given URI variables, if any.
The Future will return a null result upon completion.
url - the URLRestClientExceptionListenableFuture<java.util.Set<HttpMethod>> optionsForAllow(java.lang.String url, java.lang.Object... uriVariables) throws RestClientException
URI Template variables are expanded using the given URI variables, if any.
url - the URLuriVariables - the variables to expand in the templateFutureRestClientExceptionListenableFuture<java.util.Set<HttpMethod>> optionsForAllow(java.lang.String url, java.util.Map<java.lang.String,?> uriVariables) throws RestClientException
URI Template variables are expanded using the given map.
url - the URLuriVariables - the variables to expand in the templateFutureRestClientExceptionListenableFuture<java.util.Set<HttpMethod>> optionsForAllow(java.net.URI url) throws RestClientException
url - the URLFutureRestClientException<T> ListenableFuture<ResponseEntity<T>> exchange(java.lang.String url, HttpMethod method, HttpEntity<?> requestEntity, java.lang.Class<T> responseType, java.lang.Object... uriVariables) throws RestClientException
ResponseEntity.
URI Template variables are expanded using the given URI variables, if any.
url - the URLmethod - the HTTP method (GET, POST, etc)requestEntity - the entity (headers and/or body) to write to the request
(may be null)responseType - the type of the return valueuriVariables - the variables to expand in the templateFutureRestClientException<T> ListenableFuture<ResponseEntity<T>> exchange(java.lang.String url, HttpMethod method, HttpEntity<?> requestEntity, java.lang.Class<T> responseType, java.util.Map<java.lang.String,?> uriVariables) throws RestClientException
ResponseEntity.
URI Template variables are expanded using the given URI variables, if any.
url - the URLmethod - the HTTP method (GET, POST, etc)requestEntity - the entity (headers and/or body) to write to the request
(may be null)responseType - the type of the return valueuriVariables - the variables to expand in the templateFutureRestClientException<T> ListenableFuture<ResponseEntity<T>> exchange(java.net.URI url, HttpMethod method, HttpEntity<?> requestEntity, java.lang.Class<T> responseType) throws RestClientException
ResponseEntity.url - the URLmethod - the HTTP method (GET, POST, etc)requestEntity - the entity (headers and/or body) to write to the request
(may be null)responseType - the type of the return valueFutureRestClientException<T> ListenableFuture<ResponseEntity<T>> exchange(java.lang.String url, HttpMethod method, HttpEntity<?> requestEntity, ParameterizedTypeReference<T> responseType, java.lang.Object... uriVariables) throws RestClientException
ResponseEntity.
The given ParameterizedTypeReference is used to pass generic type
information:
ParameterizedTypeReference<List<MyBean>> myBean = new ParameterizedTypeReference<List<MyBean>>() {};
ResponseEntity<List<MyBean>> response = template.exchange("http://example.com",HttpMethod.GET, null, myBean);
url - the URLmethod - the HTTP method (GET, POST, etc)requestEntity - the entity (headers and/or body) to write to the
request (may be null)responseType - the type of the return valueuriVariables - the variables to expand in the templateFutureRestClientException<T> ListenableFuture<ResponseEntity<T>> exchange(java.lang.String url, HttpMethod method, HttpEntity<?> requestEntity, ParameterizedTypeReference<T> responseType, java.util.Map<java.lang.String,?> uriVariables) throws RestClientException
ResponseEntity.
The given ParameterizedTypeReference is used to pass generic type
information:
ParameterizedTypeReference<List<MyBean>> myBean = new ParameterizedTypeReference<List<MyBean>>() {};
ResponseEntity<List<MyBean>> response = template.exchange("http://example.com",HttpMethod.GET, null, myBean);
url - the URLmethod - the HTTP method (GET, POST, etc)requestEntity - the entity (headers and/or body) to write to the request
(may be null)responseType - the type of the return valueuriVariables - the variables to expand in the templateFutureRestClientException<T> ListenableFuture<ResponseEntity<T>> exchange(java.net.URI url, HttpMethod method, HttpEntity<?> requestEntity, ParameterizedTypeReference<T> responseType) throws RestClientException
ResponseEntity.
The given ParameterizedTypeReference is used to pass generic type
information:
ParameterizedTypeReference<List<MyBean>> myBean = new ParameterizedTypeReference<List<MyBean>>() {};
ResponseEntity<List<MyBean>> response = template.exchange("http://example.com",HttpMethod.GET, null, myBean);
url - the URLmethod - the HTTP method (GET, POST, etc)requestEntity - the entity (headers and/or body) to write to the request
(may be null)responseType - the type of the return valueFutureRestClientException<T> ListenableFuture<T> execute(java.lang.String url, HttpMethod method, AsyncRequestCallback requestCallback, ResponseExtractor<T> responseExtractor, java.lang.Object... uriVariables) throws RestClientException
AsyncRequestCallback, and reading the response with a
ResponseExtractor.
URI Template variables are expanded using the given URI variables, if any.
url - the URLmethod - the HTTP method (GET, POST, etc)requestCallback - object that prepares the requestresponseExtractor - object that extracts the return value from the responseuriVariables - the variables to expand in the templateResponseExtractorRestClientException<T> ListenableFuture<T> execute(java.lang.String url, HttpMethod method, AsyncRequestCallback requestCallback, ResponseExtractor<T> responseExtractor, java.util.Map<java.lang.String,?> uriVariables) throws RestClientException
AsyncRequestCallback, and reading the response with a
ResponseExtractor.
URI Template variables are expanded using the given URI variables map.
url - the URLmethod - the HTTP method (GET, POST, etc)requestCallback - object that prepares the requestresponseExtractor - object that extracts the return value from the responseuriVariables - the variables to expand in the templateResponseExtractorRestClientException<T> ListenableFuture<T> execute(java.net.URI url, HttpMethod method, AsyncRequestCallback requestCallback, ResponseExtractor<T> responseExtractor) throws RestClientException
AsyncRequestCallback, and reading the response with a
ResponseExtractor.url - the URLmethod - the HTTP method (GET, POST, etc)requestCallback - object that prepares the requestresponseExtractor - object that extracts the return value from the responseResponseExtractorRestClientException