2 * Copyright 2016 Huawei Technologies Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.openo.baseservice.roa.util.restclient;
18 import org.openo.baseservice.remoteservice.exception.ServiceException;
21 * ReSTful method interface.<br/>
26 * @version 28-May-2016
28 public interface Restful {
31 * Http GET method.<br/>
33 * @param servicePath: request path.
34 * @param restParametes: query parameters.
36 * @throws ServiceException
39 RestfulResponse get(String servicePath, RestfulParametes restParametes) throws ServiceException;
42 * Http HEAD method.<br/>
44 * @param servicePath: request path.
45 * @param restParametes: request parameters.
46 * @param options: request options.
48 * @throws ServiceException
51 RestfulResponse head(String servicePath, RestfulParametes restParametes, RestfulOptions options)
52 throws ServiceException;
55 * Http HEAD method.<br/>
57 * @param servicePath: request path.
58 * @param restParametes: request parameters.
60 * @throws ServiceException
63 RestfulResponse head(String servicePath, RestfulParametes restParametes) throws ServiceException;
66 * Http GET method.<br/>
68 * @param servicePath: request path.
69 * @param restParametes: request parameters.
70 * @param options: request options.
72 * @throws ServiceException
75 RestfulResponse get(String servicePath, RestfulParametes restParametes, RestfulOptions options)
76 throws ServiceException;
79 * Asynchronouse GET request.<br/>
81 * @param servicePath: request path.
82 * @param restParametes: request parameters.
83 * @param callback: response callback method.
84 * @throws ServiceException
87 void asyncGet(String servicePath, RestfulParametes restParametes, RestfulAsyncCallback callback)
88 throws ServiceException;
91 * Asynchronouse GET request.<br/>
93 * @param servicePath: request path.
94 * @param restParametes: request parameters.
95 * @param options: request options.
96 * @param callback: response callback method.
97 * @throws ServiceException
100 void asyncGet(String servicePath, RestfulParametes restParametes, RestfulOptions options,
101 RestfulAsyncCallback callback) throws ServiceException;
104 * Http PUT method.<br/>
106 * @param servicePath: request path.
107 * @param restParametes: request parameters.
109 * @throws ServiceException
112 RestfulResponse put(String servicePath, RestfulParametes restParametes) throws ServiceException;
115 * Http PUT method.<br/>
117 * @param servicePath: request path.
118 * @param restParametes: request parameters.
119 * @param options: request options.
121 * @throws ServiceException
124 RestfulResponse put(String servicePath, RestfulParametes restParametes, RestfulOptions options)
125 throws ServiceException;
128 * Asynchronouse PUT request.<br/>
130 * @param servicePath: request path.
131 * @param restParametes: request parameters.
132 * @param callback: response callback method.
133 * @throws ServiceException
136 void asyncPut(String servicePath, RestfulParametes restParametes, RestfulAsyncCallback callback)
137 throws ServiceException;
140 * Asynchronouse PUT request.<br/>
142 * @param servicePath: request path.
143 * @param restParametes: request parameters.
144 * @param options: request options.
145 * @param callback: response callback method.
146 * @throws ServiceException
149 void asyncPut(String servicePath, RestfulParametes restParametes, RestfulOptions options,
150 RestfulAsyncCallback callback) throws ServiceException;
153 * Http POST method.<br/>
155 * @param servicePath: request path.
156 * @param restParametes: request parameters.
158 * @throws ServiceException
161 RestfulResponse post(String servicePath, RestfulParametes restParametes) throws ServiceException;
164 * Http POST method.<br/>
166 * @param servicePath: request path.
167 * @param restParametes: request parameters.
168 * @param options: request options.
170 * @throws ServiceException
173 RestfulResponse post(String servicePath, RestfulParametes restParametes, RestfulOptions options)
174 throws ServiceException;
177 * Asynchronouse POST request.<br/>
179 * @param servicePath: request path.
180 * @param restParametes: request parameters.
181 * @param callback: response callback method.
182 * @throws ServiceException
185 void asyncPost(String servicePath, RestfulParametes restParametes, RestfulAsyncCallback callback)
186 throws ServiceException;
189 * Asynchronouse POST request.<br/>
191 * @param servicePath: request path.
192 * @param restParametes: request parameters.
193 * @param options: request options.
194 * @param callback: response callback method.
195 * @throws ServiceException
198 void asyncPost(String servicePath, RestfulParametes restParametes, RestfulOptions options,
199 RestfulAsyncCallback callback) throws ServiceException;
202 * Http DELETE method.<br/>
204 * @param servicePath: request path.
205 * @param restParametes: request parameters.
207 * @throws ServiceException
210 RestfulResponse delete(String servicePath, RestfulParametes restParametes) throws ServiceException;
213 * Http DELETE method.<br/>
215 * @param servicePath: request path.
216 * @param restParametes: request parameters.
217 * @param options: request options.
219 * @throws ServiceException
222 RestfulResponse delete(String servicePath, RestfulParametes restParametes, RestfulOptions options)
223 throws ServiceException;
226 * Asynchronouse DELETE request.<br/>
228 * @param servicePath: request path.
229 * @param restParametes: request parameters.
230 * @param callback: response callback method.
231 * @throws ServiceException
234 void asyncDelete(String servicePath, RestfulParametes restParametes, RestfulAsyncCallback callback)
235 throws ServiceException;
238 * Asynchronouse DELETE request.<br/>
240 * @param servicePath: request path.
241 * @param restParametes: request parameters.
242 * @param options: request options.
243 * @param callback: response callback method.
244 * @throws ServiceException
247 void asyncDelete(String servicePath, RestfulParametes restParametes, RestfulOptions options,
248 RestfulAsyncCallback callback) throws ServiceException;
251 * Http PATCH method.<br/>
253 * @param servicePath: request path.
254 * @param restParametes: request parameters.
256 * @throws ServiceException
259 RestfulResponse patch(String servicePath, RestfulParametes restParametes) throws ServiceException;
262 * Http PATCH method.<br/>
264 * @param servicePath: request path.
265 * @param restParametes: request parameters.
266 * @param options: request options.
268 * @throws ServiceException
271 RestfulResponse patch(String servicePath, RestfulParametes restParametes, RestfulOptions options)
272 throws ServiceException;
275 * Asynchronouse PATCH request.<br/>
277 * @param servicePath: request path.
278 * @param restParametes: request parameters.
279 * @param callback: response callback method.
280 * @throws ServiceException
283 void asyncPatch(String servicePath, RestfulParametes restParametes, RestfulAsyncCallback callback)
284 throws ServiceException;
287 * Asynchronouse PATCH request.<br/>
289 * @param servicePath: request path.
290 * @param restParametes: request parameters.
291 * @param options: request options.
292 * @param callback: response callback method.
293 * @throws ServiceException
296 void asyncPatch(String servicePath, RestfulParametes restParametes, RestfulOptions options,
297 RestfulAsyncCallback callback) throws ServiceException;