17
17
package org .springframework .web .client ;
18
18
19
19
import java .net .URI ;
20
- import java .util .EnumSet ;
21
20
import java .util .Map ;
22
21
import java .util .Set ;
23
22
@@ -40,32 +39,30 @@ public interface RestOperations {
40
39
/**
41
40
* Retrieve a representation by doing a GET on the specified URL.
42
41
* <p>URI Template variables are expanded using the given URI variables, if any.
43
- * @param uri the URI
42
+ * @param uri the URI
44
43
* @param responseType the type of the return value
45
44
* @param uriVariables the variables to expand the template
46
45
* @return the converted object
47
46
*/
48
- <T > T getForObject (String uri , Class <T > responseType , String ... uriVariables )
49
- throws RestClientException ;
47
+ <T > T getForObject (String uri , Class <T > responseType , String ... uriVariables ) throws RestClientException ;
50
48
51
49
/**
52
50
* Retrieve a representation by doing a GET on the URI template.
53
51
* <p>URI Template variables are expanded using the given map.
54
- * @param uri the URI
52
+ * @param uri the URI
55
53
* @param responseType the type of the return value
56
54
* @param uriVariables the map containing variables for the URI template
57
55
* @return the converted object
58
56
*/
59
- <T > T getForObject (String uri , Class <T > responseType , Map <String , String > uriVariables )
60
- throws RestClientException ;
57
+ <T > T getForObject (String uri , Class <T > responseType , Map <String , String > uriVariables ) throws RestClientException ;
61
58
62
59
63
60
// HEAD
64
61
65
62
/**
66
63
* Retrieve all headers of the resource specified by the URI template.
67
64
* <p>URI Template variables are expanded using the given URI variables, if any.
68
- * @param uri the URI
65
+ * @param uri the URI
69
66
* @param uriVariables the variables to expand the template
70
67
* @return all HTTP headers of that resource
71
68
*/
@@ -74,7 +71,7 @@ <T> T getForObject(String uri, Class<T> responseType, Map<String, String> uriVar
74
71
/**
75
72
* Retrieve all headers of the resource specified by the URI template.
76
73
* <p>URI Template variables are expanded using the given map.
77
- * @param uri the URI
74
+ * @param uri the URI
78
75
* @param uriVariables the map containing variables for the URI template
79
76
* @return all HTTP headers of that resource
80
77
*/
@@ -84,45 +81,43 @@ <T> T getForObject(String uri, Class<T> responseType, Map<String, String> uriVar
84
81
// POST
85
82
86
83
/**
87
- * Create a new resource by POSTing the given object to the URI template. The value of the <code>Location</code>,
88
- * indicating where the new resource is stored, is returned.
84
+ * Create a new resource by POSTing the given object to the URI template. The value of the <code>Location</code>
85
+ * header, indicating where the new resource is stored, is returned.
89
86
* <p>URI Template variables are expanded using the given URI variables, if any.
90
- * @param uri the URI
91
- * @param request the Object to be POSTED
87
+ * @param uri the URI
88
+ * @param request the Object to be POSTed, may be <code>null</code>
92
89
* @return the value for the <code>Location</code> header
93
90
*/
94
- URI postForLocation (String uri , Object request , String ... uriVariables )
95
- throws RestClientException ;
91
+ URI postForLocation (String uri , Object request , String ... uriVariables ) throws RestClientException ;
96
92
97
93
/**
98
- * Create a new resource by POSTing the given object to URI template. The value of the <code>Location</code>,
94
+ * Create a new resource by POSTing the given object to URI template. The value of the <code>Location</code> header ,
99
95
* indicating where the new resource is stored, is returned.
100
96
* <p>URI Template variables are expanded using the given map.
101
- * @param uri the URI
102
- * @param request the Object to be POSTed
97
+ * @param uri the URI
98
+ * @param request the Object to be POSTed, may be <code>null</code>
103
99
* @param uriVariables the variables to expand the template
104
100
* @return the value for the <code>Location</code> header
105
101
*/
106
- URI postForLocation (String uri , Object request , Map <String , String > uriVariables )
107
- throws RestClientException ;
102
+ URI postForLocation (String uri , Object request , Map <String , String > uriVariables ) throws RestClientException ;
108
103
109
104
110
105
// PUT
111
106
112
107
/**
113
108
* Create or update a resource by PUTting the given object to the URI.
114
109
* <p>URI Template variables are expanded using the given URI variables, if any.
115
- * @param uri the URI
116
- * @param request the Object to be POSTed
110
+ * @param uri the URI
111
+ * @param request the Object to be PUT, may be <code>null</code>
117
112
* @param uriVariables the variables to expand the template
118
113
*/
119
114
void put (String uri , Object request , String ... uriVariables ) throws RestClientException ;
120
115
121
116
/**
122
117
* Creates a new resource by PUTting the given object to URI template.
123
118
* <p>URI Template variables are expanded using the given map.
124
- * @param uri the URI
125
- * @param request the Object to be POSTed
119
+ * @param uri the URI
120
+ * @param request the Object to be PUT, may be <code>null</code>
126
121
* @param uriVariables the variables to expand the template
127
122
*/
128
123
void put (String uri , Object request , Map <String , String > uriVariables ) throws RestClientException ;
@@ -133,15 +128,15 @@ URI postForLocation(String uri, Object request, Map<String, String> uriVariables
133
128
/**
134
129
* Delete the resources at the specified URI.
135
130
* <p>URI Template variables are expanded using the given URI variables, if any.
136
- * @param uri the URI
131
+ * @param uri the URI
137
132
* @param uriVariables the variables to expand in the template
138
133
*/
139
134
void delete (String uri , String ... uriVariables ) throws RestClientException ;
140
135
141
136
/**
142
137
* Delete the resources at the specified URI.
143
138
* <p>URI Template variables are expanded using the given map.
144
- * @param uri the URI
139
+ * @param uri the URI
145
140
* @param uriVariables the variables to expand the template
146
141
*/
147
142
void delete (String uri , Map <String , String > uriVariables ) throws RestClientException ;
@@ -152,22 +147,20 @@ URI postForLocation(String uri, Object request, Map<String, String> uriVariables
152
147
/**
153
148
* Return the value of the Allow header for the given URI.
154
149
* <p>URI Template variables are expanded using the given URI variables, if any.
155
- * @param uri the URI
150
+ * @param uri the URI
156
151
* @param uriVariables the variables to expand in the template
157
152
* @return the value of the allow header
158
153
*/
159
- Set <HttpMethod > optionsForAllow (String uri , String ... uriVariables )
160
- throws RestClientException ;
154
+ Set <HttpMethod > optionsForAllow (String uri , String ... uriVariables ) throws RestClientException ;
161
155
162
156
/**
163
157
* Return the value of the Allow header for the given URI.
164
158
* <p>URI Template variables are expanded using the given map.
165
- * @param uri the URI
159
+ * @param uri the URI
166
160
* @param uriVariables the variables to expand in the template
167
161
* @return the value of the allow header
168
162
*/
169
- Set <HttpMethod > optionsForAllow (String uri , Map <String , String > uriVariables )
170
- throws RestClientException ;
163
+ Set <HttpMethod > optionsForAllow (String uri , Map <String , String > uriVariables ) throws RestClientException ;
171
164
172
165
173
166
// general execution
@@ -176,30 +169,34 @@ Set<HttpMethod> optionsForAllow(String uri, Map<String, String> uriVariables)
176
169
* Execute the HTTP methods to the given URI, preparing the request with the {@link RequestCallback},
177
170
* and reading the response with a {@link ResponseExtractor}.
178
171
* <p>URI Template variables are expanded using the given URI variables, if any.
179
- * @param uri the URI
180
- * @param method the HTTP method (GET, POST, etc)
181
- * @param requestCallback object that prepares the request
172
+ * @param uri the URI
173
+ * @param method the HTTP method (GET, POST, etc)
174
+ * @param requestCallback object that prepares the request
182
175
* @param responseExtractor object that extracts the return value from the response
183
- * @param uriVariables the variables to expand in the template
176
+ * @param uriVariables the variables to expand in the template
184
177
* @return an arbitrary object, as returned by the {@link ResponseExtractor}
185
178
*/
186
- <T > T execute (String uri , HttpMethod method , RequestCallback requestCallback ,
187
- ResponseExtractor <T > responseExtractor , String ... uriVariables )
188
- throws RestClientException ;
179
+ <T > T execute (String uri ,
180
+ HttpMethod method ,
181
+ RequestCallback requestCallback ,
182
+ ResponseExtractor <T > responseExtractor ,
183
+ String ... uriVariables ) throws RestClientException ;
189
184
190
185
/**
191
186
* Execute the HTTP methods to the given URI, preparing the request with the {@link RequestCallback},
192
187
* and reading the response with a {@link ResponseExtractor}.
193
188
* <p>URI Template variables are expanded using the given URI variables map.
194
- * @param uri the URI
195
- * @param method the HTTP method (GET, POST, etc)
196
- * @param requestCallback object that prepares the request
189
+ * @param uri the URI
190
+ * @param method the HTTP method (GET, POST, etc)
191
+ * @param requestCallback object that prepares the request
197
192
* @param responseExtractor object that extracts the return value from the response
198
- * @param uriVariablesthe variables to expand in the template
193
+ * @param uriVariables the variables to expand in the template
199
194
* @return an arbitrary object, as returned by the {@link ResponseExtractor}
200
195
*/
201
- <T > T execute (String uri , HttpMethod method , RequestCallback requestCallback ,
202
- ResponseExtractor <T > responseExtractor , Map <String , String > uriVariables )
203
- throws RestClientException ;
196
+ <T > T execute (String uri ,
197
+ HttpMethod method ,
198
+ RequestCallback requestCallback ,
199
+ ResponseExtractor <T > responseExtractor ,
200
+ Map <String , String > uriVariables ) throws RestClientException ;
204
201
205
202
}
0 commit comments