|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RestOperations
Interface specifying a basic set of RESTful operations. Implemented by RestTemplate
.
Not often used directly, but a useful option to enhance testability, as it can easily
be mocked or stubbed.
RestTemplate
Method Summary | ||
---|---|---|
void |
delete(String url,
Map<String,?> uriVariables)
Delete the resources at the specified URI. |
|
void |
delete(String url,
Object... uriVariables)
Delete the resources at the specified URI. |
|
void |
delete(URI url)
Delete the resources at the specified URL. |
|
|
execute(String url,
HttpMethod method,
RequestCallback requestCallback,
ResponseExtractor<T> responseExtractor,
Map<String,?> uriVariables)
Execute the HTTP methods to the given URI template, preparing the request with the RequestCallback , and reading the response with a ResponseExtractor . |
|
|
execute(String url,
HttpMethod method,
RequestCallback requestCallback,
ResponseExtractor<T> responseExtractor,
Object... uriVariables)
Execute the HTTP methods to the given URI template, preparing the request with the RequestCallback , and reading the response with aResponseExtractor . |
|
|
execute(URI url,
HttpMethod method,
RequestCallback requestCallback,
ResponseExtractor<T> responseExtractor)
Execute the HTTP methods to the given URL, preparing the request with the RequestCallback , and reading the response with a ResponseExtractor . |
|
|
getForObject(String url,
Class<T> responseType,
Map<String,?> uriVariables)
Retrieve a representation by doing a GET on the URI template. |
|
|
getForObject(String url,
Class<T> responseType,
Object... uriVariables)
Retrieve a representation by doing a GET on the specified URL. |
|
|
getForObject(URI url,
Class<T> responseType)
Retrieve a representation by doing a GET on the URL . |
|
HttpHeaders |
headForHeaders(String url,
Map<String,?> uriVariables)
Retrieve all headers of the resource specified by the URI template. |
|
HttpHeaders |
headForHeaders(String url,
Object... uriVariables)
Retrieve all headers of the resource specified by the URI template. |
|
HttpHeaders |
headForHeaders(URI url)
Retrieve all headers of the resource specified by the URL. |
|
Set<HttpMethod> |
optionsForAllow(String url,
Map<String,?> uriVariables)
Return the value of the Allow header for the given URI. |
|
Set<HttpMethod> |
optionsForAllow(String url,
Object... uriVariables)
Return the value of the Allow header for the given URI. |
|
Set<HttpMethod> |
optionsForAllow(URI url)
Return the value of the Allow header for the given URL. |
|
URI |
postForLocation(String url,
Object request,
Map<String,?> uriVariables)
Create a new resource by POSTing the given object to the URI template, and returns the value of the Location header. |
|
URI |
postForLocation(String url,
Object request,
Object... uriVariables)
Create a new resource by POSTing the given object to the URI template, and returns the value of the Location header. |
|
URI |
postForLocation(URI url,
Object request)
Create a new resource by POSTing the given object to the URL, and returns the value of the Location header. |
|
|
postForObject(String url,
Object request,
Class<T> responseType,
Map<String,?> uriVariables)
Create a new resource by POSTing the given object to the URI template, and returns the representation found in the response. |
|
|
postForObject(String url,
Object request,
Class<T> responseType,
Object... uriVariables)
Create a new resource by POSTing the given object to the URI template, and returns the representation found in the response. |
|
|
postForObject(URI url,
Object request,
Class<T> responseType)
Create a new resource by POSTing the given object to the URL, and returns the representation found in the response. |
|
void |
put(String url,
Object request,
Map<String,?> uriVariables)
Creates a new resource by PUTting the given object to URI template. |
|
void |
put(String url,
Object request,
Object... uriVariables)
Create or update a resource by PUTting the given object to the URI. |
|
void |
put(URI url,
Object request)
Creates a new resource by PUTting the given object to URL. |
Method Detail |
---|
<T> T getForObject(String url, Class<T> responseType, Object... uriVariables) throws RestClientException
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 template
RestClientException
<T> T getForObject(String url, Class<T> responseType, Map<String,?> uriVariables) throws RestClientException
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 template
RestClientException
<T> T getForObject(URI url, Class<T> responseType) throws RestClientException
url
- the URLresponseType
- the type of the return value
RestClientException
HttpHeaders headForHeaders(String url, Object... uriVariables) throws RestClientException
URI Template variables are expanded using the given URI variables, if any.
url
- the URLuriVariables
- the variables to expand the template
RestClientException
HttpHeaders headForHeaders(String url, Map<String,?> uriVariables) throws RestClientException
URI Template variables are expanded using the given map.
url
- the URLuriVariables
- the map containing variables for the URI template
RestClientException
HttpHeaders headForHeaders(URI url) throws RestClientException
url
- the URL
RestClientException
URI postForLocation(String url, Object request, 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 template
Location
header
RestClientException
URI postForLocation(String url, Object request, Map<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 template
Location
header
RestClientException
URI postForLocation(URI url, Object 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
RestClientException
<T> T postForObject(String url, Object request, Class<T> responseType, Object... uriVariables) throws RestClientException
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 template
RestClientException
<T> T postForObject(String url, Object request, Class<T> responseType, Map<String,?> uriVariables) throws RestClientException
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 template
RestClientException
<T> T postForObject(URI url, Object request, Class<T> responseType) throws RestClientException
url
- the URLrequest
- the Object to be POSTed, may be null
RestClientException
void put(String url, Object request, Object... uriVariables) throws RestClientException
URI Template variables are expanded using the given URI variables, if any.
url
- the URLrequest
- the Object to be PUT, may be null
uriVariables
- the variables to expand the template
RestClientException
void put(String url, Object request, Map<String,?> uriVariables) throws RestClientException
URI Template variables are expanded using the given map.
url
- the URLrequest
- the Object to be PUT, may be null
uriVariables
- the variables to expand the template
RestClientException
void put(URI url, Object request) throws RestClientException
url
- the URLrequest
- the Object to be PUT, may be null
RestClientException
void delete(String url, 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 template
RestClientException
void delete(String url, Map<String,?> uriVariables) throws RestClientException
URI Template variables are expanded using the given map.
url
- the URLuriVariables
- the variables to expand the template
RestClientException
void delete(URI url) throws RestClientException
url
- the URL
RestClientException
Set<HttpMethod> optionsForAllow(String url, 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 template
RestClientException
Set<HttpMethod> optionsForAllow(String url, Map<String,?> uriVariables) throws RestClientException
URI Template variables are expanded using the given map.
url
- the URLuriVariables
- the variables to expand in the template
RestClientException
Set<HttpMethod> optionsForAllow(URI url) throws RestClientException
url
- the URL
RestClientException
<T> T execute(String url, HttpMethod method, RequestCallback requestCallback, ResponseExtractor<T> responseExtractor, Object... uriVariables) throws RestClientException
RequestCallback
, and reading the response with aResponseExtractor
.
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 template
ResponseExtractor
RestClientException
<T> T execute(String url, HttpMethod method, RequestCallback requestCallback, ResponseExtractor<T> responseExtractor, Map<String,?> uriVariables) throws RestClientException
RequestCallback
, 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 template
ResponseExtractor
RestClientException
<T> T execute(URI url, HttpMethod method, RequestCallback requestCallback, ResponseExtractor<T> responseExtractor) throws RestClientException
RequestCallback
, 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 response
ResponseExtractor
RestClientException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |