org.jasig.springframework.web.client
Class ExtendedRestTemplate

java.lang.Object
  extended by org.springframework.http.client.support.HttpAccessor
      extended by org.springframework.http.client.support.InterceptingHttpAccessor
          extended by org.springframework.web.client.RestTemplate
              extended by org.jasig.springframework.web.client.ExtendedRestTemplate
All Implemented Interfaces:
ExtendedRestOperations, org.springframework.web.client.RestOperations

public class ExtendedRestTemplate
extends org.springframework.web.client.RestTemplate
implements ExtendedRestOperations


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jasig.springframework.web.client.ExtendedRestOperations
ExtendedRestOperations.ProxyResponse
 
Field Summary
 
Fields inherited from class org.springframework.http.client.support.HttpAccessor
logger
 
Constructor Summary
ExtendedRestTemplate()
           
ExtendedRestTemplate(org.springframework.http.client.ClientHttpRequestFactory requestFactory)
           
 
Method Summary
<T> T
getForObject(String url, Class<T> responseType, org.springframework.http.HttpHeaders headers, Object... urlVariables)
          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... urlVariables)
          Proxies the response from a REST request, writing the status, headers and body to the ExtendedRestOperations.ProxyResponse
 void setInterceptors(List<org.springframework.http.client.ClientHttpRequestInterceptor> interceptors)
           
 
Methods inherited from class org.springframework.web.client.RestTemplate
delete, delete, delete, doExecute, exchange, exchange, exchange, exchange, exchange, exchange, execute, execute, execute, getErrorHandler, getForEntity, getForEntity, getForEntity, getForObject, getForObject, getForObject, getMessageConverters, headForHeaders, headForHeaders, headForHeaders, optionsForAllow, optionsForAllow, optionsForAllow, postForEntity, postForEntity, postForEntity, postForLocation, postForLocation, postForLocation, postForObject, postForObject, postForObject, put, put, put, setErrorHandler, setMessageConverters
 
Methods inherited from class org.springframework.http.client.support.InterceptingHttpAccessor
getInterceptors, getRequestFactory
 
Methods inherited from class org.springframework.http.client.support.HttpAccessor
createRequest, setRequestFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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
 

Constructor Detail

ExtendedRestTemplate

public ExtendedRestTemplate()

ExtendedRestTemplate

public ExtendedRestTemplate(org.springframework.http.client.ClientHttpRequestFactory requestFactory)
Method Detail

setInterceptors

public final void setInterceptors(List<org.springframework.http.client.ClientHttpRequestInterceptor> interceptors)
Overrides:
setInterceptors in class org.springframework.http.client.support.InterceptingHttpAccessor

getForObject

public <T> T getForObject(String url,
                          Class<T> responseType,
                          org.springframework.http.HttpHeaders headers,
                          Object... urlVariables)
               throws org.springframework.web.client.RestClientException
Description copied from interface: ExtendedRestOperations
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.

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

proxyRequest

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

Specified by:
proxyRequest in interface ExtendedRestOperations
Parameters:
proxyResponse - response to write the results of the request to
url - the URL
headers - header to set on the request
urlVariables - 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.