org.springframework.web.client

Interface AsyncRestOperations

  • All Known Implementing Classes:
    AsyncRestTemplate

    Deprecated. 
    as of Spring 5.0, in favor of WebClient

    @Deprecated
    public interface AsyncRestOperations
    Interface specifying a basic set of asynchronous RESTful operations. Implemented by AsyncRestTemplate. Not often used directly, but a useful option to enhance testability, as it can easily be mocked or stubbed.
    Since:
    4.0
    Author:
    Arjen Poutsma
    See Also:
    AsyncRestTemplate, RestOperations
    • Method Detail

      • getRestOperations

        RestOperations getRestOperations()
        Deprecated. 
        Expose the synchronous Spring RestTemplate to allow synchronous invocation.
      • getForEntity

        <T> ListenableFuture<ResponseEntity<T>> getForEntity(java.lang.String url,
                                                             java.lang.Class<T> responseType,
                                                             java.lang.Object... uriVariables)
                                                      throws RestClientException
        Deprecated. 
        Asynchronously retrieve an entity by doing a GET on the specified URL. The response is converted and stored in an ResponseEntity.

        URI Template variables are expanded using the given URI variables, if any.

        Parameters:
        url - the URL
        responseType - the type of the return value
        uriVariables - the variables to expand the template
        Returns:
        the entity wrapped in a Future
        Throws:
        RestClientException
      • getForEntity

        <T> ListenableFuture<ResponseEntity<T>> getForEntity(java.lang.String url,
                                                             java.lang.Class<T> responseType,
                                                             java.util.Map<java.lang.String,?> uriVariables)
                                                      throws RestClientException
        Deprecated. 
        Asynchronously retrieve a representation by doing a GET on the URI template. The response is converted and stored in an ResponseEntity.

        URI Template variables are expanded using the given map.

        Parameters:
        url - the URL
        responseType - the type of the return value
        uriVariables - the map containing variables for the URI template
        Returns:
        the entity wrapped in a Future
        Throws:
        RestClientException
      • getForEntity

        <T> ListenableFuture<ResponseEntity<T>> getForEntity(java.net.URI url,
                                                             java.lang.Class<T> responseType)
                                                      throws RestClientException
        Deprecated. 
        Asynchronously retrieve a representation by doing a GET on the URL. The response is converted and stored in an ResponseEntity.
        Parameters:
        url - the URL
        responseType - the type of the return value
        Returns:
        the entity wrapped in a Future
        Throws:
        RestClientException
      • headForHeaders

        ListenableFuture<HttpHeaders> headForHeaders(java.lang.String url,
                                                     java.lang.Object... uriVariables)
                                              throws RestClientException
        Deprecated. 
        Asynchronously retrieve all headers of the resource specified by the URI template.

        URI Template variables are expanded using the given URI variables, if any.

        Parameters:
        url - the URL
        uriVariables - the variables to expand the template
        Returns:
        all HTTP headers of that resource wrapped in a Future
        Throws:
        RestClientException
      • headForHeaders

        ListenableFuture<HttpHeaders> headForHeaders(java.lang.String url,
                                                     java.util.Map<java.lang.String,?> uriVariables)
                                              throws RestClientException
        Deprecated. 
        Asynchronously retrieve all headers of the resource specified by the URI template.

        URI Template variables are expanded using the given map.

        Parameters:
        url - the URL
        uriVariables - the map containing variables for the URI template
        Returns:
        all HTTP headers of that resource wrapped in a Future
        Throws:
        RestClientException
      • postForLocation

        ListenableFuture<java.net.URI> postForLocation(java.lang.String url,
                                                       @Nullable
                                                       HttpEntity<?> request,
                                                       java.lang.Object... uriVariables)
                                                throws RestClientException
        Deprecated. 
        Create a new resource by POSTing the given object to the URI template, and asynchronously returns the value of the Location header. This header typically indicates where the new resource is stored.

        URI Template variables are expanded using the given URI variables, if any.

        Parameters:
        url - the URL
        request - the Object to be POSTed (may be null)
        uriVariables - the variables to expand the template
        Returns:
        the value for the Location header wrapped in a Future
        Throws:
        RestClientException
        See Also:
        HttpEntity
      • postForLocation

        ListenableFuture<java.net.URI> postForLocation(java.lang.String url,
                                                       @Nullable
                                                       HttpEntity<?> request,
                                                       java.util.Map<java.lang.String,?> uriVariables)
                                                throws RestClientException
        Deprecated. 
        Create a new resource by POSTing the given object to the URI template, and asynchronously returns the value of the Location header. This header typically indicates where the new resource is stored.

        URI Template variables are expanded using the given map.

        Parameters:
        url - the URL
        request - the Object to be POSTed (may be null)
        uriVariables - the variables to expand the template
        Returns:
        the value for the Location header wrapped in a Future
        Throws:
        RestClientException
        See Also:
        HttpEntity
      • postForLocation

        ListenableFuture<java.net.URI> postForLocation(java.net.URI url,
                                                       @Nullable
                                                       HttpEntity<?> request)
                                                throws RestClientException
        Deprecated. 
        Create a new resource by POSTing the given object to the URL, and asynchronously returns the value of the Location header. This header typically indicates where the new resource is stored.
        Parameters:
        url - the URL
        request - the Object to be POSTed (may be null)
        Returns:
        the value for the Location header wrapped in a Future
        Throws:
        RestClientException
        See Also:
        HttpEntity
      • postForEntity

        <T> ListenableFuture<ResponseEntity<T>> postForEntity(java.lang.String url,
                                                              @Nullable
                                                              HttpEntity<?> request,
                                                              java.lang.Class<T> responseType,
                                                              java.lang.Object... uriVariables)
                                                       throws RestClientException
        Deprecated. 
        Create a new resource by POSTing the given object to the URI template, and asynchronously returns the response as ResponseEntity.

        URI Template variables are expanded using the given URI variables, if any.

        Parameters:
        url - the URL
        request - the Object to be POSTed (may be null)
        uriVariables - the variables to expand the template
        Returns:
        the entity wrapped in a Future
        Throws:
        RestClientException
        See Also:
        HttpEntity
      • postForEntity

        <T> ListenableFuture<ResponseEntity<T>> postForEntity(java.lang.String url,
                                                              @Nullable
                                                              HttpEntity<?> request,
                                                              java.lang.Class<T> responseType,
                                                              java.util.Map<java.lang.String,?> uriVariables)
                                                       throws RestClientException
        Deprecated. 
        Create a new resource by POSTing the given object to the URI template, and asynchronously returns the response as ResponseEntity.

        URI Template variables are expanded using the given map.

        Parameters:
        url - the URL
        request - the Object to be POSTed (may be null)
        uriVariables - the variables to expand the template
        Returns:
        the entity wrapped in a Future
        Throws:
        RestClientException
        See Also:
        HttpEntity
      • put

        ListenableFuture<?> put(java.lang.String url,
                                @Nullable
                                HttpEntity<?> request,
                                java.lang.Object... uriVariables)
                         throws RestClientException
        Deprecated. 
        Create or update a resource by PUTting the given object to the URI.

        URI Template variables are expanded using the given URI variables, if any.

        The Future will return a null result upon completion.

        Parameters:
        url - the URL
        request - the Object to be PUT (may be null)
        uriVariables - the variables to expand the template
        Throws:
        RestClientException
        See Also:
        HttpEntity
      • put

        ListenableFuture<?> put(java.lang.String url,
                                @Nullable
                                HttpEntity<?> request,
                                java.util.Map<java.lang.String,?> uriVariables)
                         throws RestClientException
        Deprecated. 
        Creates a new resource by PUTting the given object to URI template.

        URI Template variables are expanded using the given map.

        The Future will return a null result upon completion.

        Parameters:
        url - the URL
        request - the Object to be PUT (may be null)
        uriVariables - the variables to expand the template
        Throws:
        RestClientException
        See Also:
        HttpEntity
      • delete

        ListenableFuture<?> delete(java.lang.String url,
                                   java.lang.Object... uriVariables)
                            throws RestClientException
        Deprecated. 
        Asynchronously delete the resources at the specified URI.

        URI Template variables are expanded using the given URI variables, if any.

        The Future will return a null result upon completion.

        Parameters:
        url - the URL
        uriVariables - the variables to expand in the template
        Throws:
        RestClientException
      • delete

        ListenableFuture<?> delete(java.lang.String url,
                                   java.util.Map<java.lang.String,?> uriVariables)
                            throws RestClientException
        Deprecated. 
        Asynchronously delete the resources at the specified URI.

        URI Template variables are expanded using the given URI variables, if any.

        The Future will return a null result upon completion.

        Parameters:
        url - the URL
        uriVariables - the variables to expand in the template
        Throws:
        RestClientException
      • delete

        ListenableFuture<?> delete(java.net.URI url)
                            throws RestClientException
        Deprecated. 
        Asynchronously delete the resources at the specified URI.

        URI Template variables are expanded using the given URI variables, if any.

        The Future will return a null result upon completion.

        Parameters:
        url - the URL
        Throws:
        RestClientException
      • optionsForAllow

        ListenableFuture<java.util.Set<HttpMethod>> optionsForAllow(java.lang.String url,
                                                                    java.lang.Object... uriVariables)
                                                             throws RestClientException
        Deprecated. 
        Asynchronously return the value of the Allow header for the given URI.

        URI Template variables are expanded using the given URI variables, if any.

        Parameters:
        url - the URL
        uriVariables - the variables to expand in the template
        Returns:
        the value of the allow header wrapped in a Future
        Throws:
        RestClientException
      • optionsForAllow

        ListenableFuture<java.util.Set<HttpMethod>> optionsForAllow(java.lang.String url,
                                                                    java.util.Map<java.lang.String,?> uriVariables)
                                                             throws RestClientException
        Deprecated. 
        Asynchronously return the value of the Allow header for the given URI.

        URI Template variables are expanded using the given map.

        Parameters:
        url - the URL
        uriVariables - the variables to expand in the template
        Returns:
        the value of the allow header wrapped in a Future
        Throws:
        RestClientException
      • optionsForAllow

        ListenableFuture<java.util.Set<HttpMethod>> optionsForAllow(java.net.URI url)
                                                             throws RestClientException
        Deprecated. 
        Asynchronously return the value of the Allow header for the given URL.
        Parameters:
        url - the URL
        Returns:
        the value of the allow header wrapped in a Future
        Throws:
        RestClientException
      • exchange

        <T> ListenableFuture<ResponseEntity<T>> exchange(java.lang.String url,
                                                         HttpMethod method,
                                                         @Nullable
                                                         HttpEntity<?> requestEntity,
                                                         java.lang.Class<T> responseType,
                                                         java.lang.Object... uriVariables)
                                                  throws RestClientException
        Deprecated. 
        Asynchronously execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.

        URI Template variables are expanded using the given URI variables, if any.

        Parameters:
        url - the URL
        method - 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 value
        uriVariables - the variables to expand in the template
        Returns:
        the response as entity wrapped in a Future
        Throws:
        RestClientException
      • exchange

        <T> ListenableFuture<ResponseEntity<T>> exchange(java.lang.String url,
                                                         HttpMethod method,
                                                         @Nullable
                                                         HttpEntity<?> requestEntity,
                                                         java.lang.Class<T> responseType,
                                                         java.util.Map<java.lang.String,?> uriVariables)
                                                  throws RestClientException
        Deprecated. 
        Asynchronously execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.

        URI Template variables are expanded using the given URI variables, if any.

        Parameters:
        url - the URL
        method - 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 value
        uriVariables - the variables to expand in the template
        Returns:
        the response as entity wrapped in a Future
        Throws:
        RestClientException
      • exchange

        <T> ListenableFuture<ResponseEntity<T>> exchange(java.net.URI url,
                                                         HttpMethod method,
                                                         @Nullable
                                                         HttpEntity<?> requestEntity,
                                                         java.lang.Class<T> responseType)
                                                  throws RestClientException
        Deprecated. 
        Asynchronously execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.
        Parameters:
        url - the URL
        method - 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 value
        Returns:
        the response as entity wrapped in a Future
        Throws:
        RestClientException
      • exchange

        <T> ListenableFuture<ResponseEntity<T>> exchange(java.lang.String url,
                                                         HttpMethod method,
                                                         @Nullable
                                                         HttpEntity<?> requestEntity,
                                                         ParameterizedTypeReference<T> responseType,
                                                         java.lang.Object... uriVariables)
                                                  throws RestClientException
        Deprecated. 
        Asynchronously execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as 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);
         
        Parameters:
        url - the URL
        method - 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 value
        uriVariables - the variables to expand in the template
        Returns:
        the response as entity wrapped in a Future
        Throws:
        RestClientException
      • exchange

        <T> ListenableFuture<ResponseEntity<T>> exchange(java.lang.String url,
                                                         HttpMethod method,
                                                         @Nullable
                                                         HttpEntity<?> requestEntity,
                                                         ParameterizedTypeReference<T> responseType,
                                                         java.util.Map<java.lang.String,?> uriVariables)
                                                  throws RestClientException
        Deprecated. 
        Asynchronously execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as 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);
         
        Parameters:
        url - the URL
        method - 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 value
        uriVariables - the variables to expand in the template
        Returns:
        the response as entity wrapped in a Future
        Throws:
        RestClientException
      • exchange

        <T> ListenableFuture<ResponseEntity<T>> exchange(java.net.URI url,
                                                         HttpMethod method,
                                                         @Nullable
                                                         HttpEntity<?> requestEntity,
                                                         ParameterizedTypeReference<T> responseType)
                                                  throws RestClientException
        Deprecated. 
        Asynchronously execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as 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);
         
        Parameters:
        url - the URL
        method - 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 value
        Returns:
        the response as entity wrapped in a Future
        Throws:
        RestClientException