org.jasig.springframework.web.client
Interface ExtendedRestOperations

All Superinterfaces:
org.springframework.web.client.RestOperations
All Known Implementing Classes:
ExtendedRestTemplate

public interface ExtendedRestOperations
extends org.springframework.web.client.RestOperations

Adds some utility methods to RestOperations

Author:
Eric Dalquist

Nested Class Summary
static interface ExtendedRestOperations.ProxyResponse
          Response handler for proxying a rest request.
 
Method Summary
<T> T
getForObject(String url, Class<T> responseType, org.springframework.http.HttpHeaders headers, Object... uriVariables)
          Retrieve a representation by doing a GET on the specified URL.
 int proxyRequest(ExtendedRestOperations.ProxyResponse proxyResponse, String url, org.springframework.http.HttpMethod method, org.springframework.http.HttpHeaders headers, Object... uriVariables)
          Proxies the response from a REST request, writing the status, headers and body to the ExtendedRestOperations.ProxyResponse
 
Methods inherited from interface org.springframework.web.client.RestOperations
delete, delete, delete, exchange, exchange, exchange, exchange, exchange, exchange, execute, execute, execute, getForEntity, getForEntity, getForEntity, getForObject, getForObject, getForObject, headForHeaders, headForHeaders, headForHeaders, optionsForAllow, optionsForAllow, optionsForAllow, postForEntity, postForEntity, postForEntity, postForLocation, postForLocation, postForLocation, postForObject, postForObject, postForObject, put, put, put
 

Method Detail

getForObject

<T> T getForObject(String url,
                   Class<T> responseType,
                   org.springframework.http.HttpHeaders headers,
                   Object... uriVariables)
               throws org.springframework.web.client.RestClientException
Retrieve a representation by doing a GET on the specified URL. The response (if any) is converted and returned.

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

Parameters:
url - the URL
headers - headers to set on the request
responseType - the type of the return value
uriVariables - the variables to expand the template
Returns:
the converted object
Throws:
org.springframework.web.client.RestClientException
See Also:
RestOperations.getForObject(String, Class, Object...)

proxyRequest

int proxyRequest(ExtendedRestOperations.ProxyResponse proxyResponse,
                 String url,
                 org.springframework.http.HttpMethod method,
                 org.springframework.http.HttpHeaders headers,
                 Object... uriVariables)
                 throws org.springframework.web.client.RestClientException
Proxies the response from a REST request, writing the status, headers and body to the ExtendedRestOperations.ProxyResponse

Parameters:
proxyResponse - response to write the results of the request to
url - the URL
headers - header to set on the request
uriVariables - the variables to expand the template
Returns:
The number of bytes copied in the body
Throws:
org.springframework.web.client.RestClientException


Copyright © 2013 Jasig. All Rights Reserved.