CommonLibrary(util/rest-client) code upload.
[vfc/nfvo/wfengine.git] / rest-client / src / main / java / org / openo / baseservice / roa / util / restclient / Restful.java
1 /*
2  * Copyright (c) 2016, Huawei Technologies Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 package org.openo.baseservice.roa.util.restclient;
17
18 import org.openo.baseservice.remoteservice.exception.ServiceException;
19
20 /**
21  * ReSTful method interface.<br/>
22  * <p>
23  * </p>
24  * 
25  * @author
26  * @version SDNO 0.5 28-May-2016
27  */
28 public interface Restful {
29
30     /**
31      * Http GET method.<br/>
32      * 
33      * @param servicePath: request path.
34      * @param restParametes: query parameters.
35      * @return response.
36      * @throws ServiceException
37      * @since SDNO 0.5
38      */
39     RestfulResponse get(String servicePath, RestfulParametes restParametes) throws ServiceException;
40
41     /**
42      * Http HEAD method.<br/>
43      * 
44      * @param servicePath: request path.
45      * @param restParametes: request parameters.
46      * @param options: request options.
47      * @return response.
48      * @throws ServiceException
49      * @since SDNO 0.5
50      */
51     RestfulResponse head(String servicePath, RestfulParametes restParametes, RestfulOptions options)
52             throws ServiceException;
53
54     /**
55      * Http HEAD method.<br/>
56      * 
57      * @param servicePath: request path.
58      * @param restParametes: request parameters.
59      * @return response.
60      * @throws ServiceException
61      * @since SDNO 0.5
62      */
63     RestfulResponse head(String servicePath, RestfulParametes restParametes) throws ServiceException;
64
65     /**
66      * Http GET method.<br/>
67      * 
68      * @param servicePath: request path.
69      * @param restParametes: request parameters.
70      * @param options: request options.
71      * @return response.
72      * @throws ServiceException
73      * @since SDNO 0.5
74      */
75     RestfulResponse get(String servicePath, RestfulParametes restParametes, RestfulOptions options)
76             throws ServiceException;
77
78     /**
79      * Asynchronouse GET request.<br/>
80      * 
81      * @param servicePath: request path.
82      * @param restParametes: request parameters.
83      * @param callback: response callback method.
84      * @throws ServiceException
85      * @since SDNO 0.5
86      */
87     void asyncGet(String servicePath, RestfulParametes restParametes, RestfulAsyncCallback callback)
88             throws ServiceException;
89
90     /**
91      * Asynchronouse GET request.<br/>
92      * 
93      * @param servicePath: request path.
94      * @param restParametes: request parameters.
95      * @param options: request options.
96      * @param callback: response callback method.
97      * @throws ServiceException
98      * @since SDNO 0.5
99      */
100     void asyncGet(String servicePath, RestfulParametes restParametes, RestfulOptions options,
101             RestfulAsyncCallback callback) throws ServiceException;
102
103     /**
104      * Http PUT method.<br/>
105      * 
106      * @param servicePath: request path.
107      * @param restParametes: request parameters.
108      * @return response.
109      * @throws ServiceException
110      * @since SDNO 0.5
111      */
112     RestfulResponse put(String servicePath, RestfulParametes restParametes) throws ServiceException;
113
114     /**
115      * Http PUT method.<br/>
116      * 
117      * @param servicePath: request path.
118      * @param restParametes: request parameters.
119      * @param options: request options.
120      * @return response.
121      * @throws ServiceException
122      * @since SDNO 0.5
123      */
124     RestfulResponse put(String servicePath, RestfulParametes restParametes, RestfulOptions options)
125             throws ServiceException;
126
127     /**
128      * Asynchronouse PUT request.<br/>
129      * 
130      * @param servicePath: request path.
131      * @param restParametes: request parameters.
132      * @param callback: response callback method.
133      * @throws ServiceException
134      * @since SDNO 0.5
135      */
136     void asyncPut(String servicePath, RestfulParametes restParametes, RestfulAsyncCallback callback)
137             throws ServiceException;
138
139     /**
140      * Asynchronouse PUT request.<br/>
141      * 
142      * @param servicePath: request path.
143      * @param restParametes: request parameters.
144      * @param options: request options.
145      * @param callback: response callback method.
146      * @throws ServiceException
147      * @since SDNO 0.5
148      */
149     void asyncPut(String servicePath, RestfulParametes restParametes, RestfulOptions options,
150             RestfulAsyncCallback callback) throws ServiceException;
151
152     /**
153      * Http POST method.<br/>
154      * 
155      * @param servicePath: request path.
156      * @param restParametes: request parameters.
157      * @return response.
158      * @throws ServiceException
159      * @since SDNO 0.5
160      */
161     RestfulResponse post(String servicePath, RestfulParametes restParametes) throws ServiceException;
162
163     /**
164      * Http POST method.<br/>
165      * 
166      * @param servicePath: request path.
167      * @param restParametes: request parameters.
168      * @param options: request options.
169      * @return response.
170      * @throws ServiceException
171      * @since SDNO 0.5
172      */
173     RestfulResponse post(String servicePath, RestfulParametes restParametes, RestfulOptions options)
174             throws ServiceException;
175
176     /**
177      * Asynchronouse POST request.<br/>
178      * 
179      * @param servicePath: request path.
180      * @param restParametes: request parameters.
181      * @param callback: response callback method.
182      * @throws ServiceException
183      * @since SDNO 0.5
184      */
185     void asyncPost(String servicePath, RestfulParametes restParametes, RestfulAsyncCallback callback)
186             throws ServiceException;
187
188     /**
189      * Asynchronouse POST request.<br/>
190      * 
191      * @param servicePath: request path.
192      * @param restParametes: request parameters.
193      * @param options: request options.
194      * @param callback: response callback method.
195      * @throws ServiceException
196      * @since SDNO 0.5
197      */
198     void asyncPost(String servicePath, RestfulParametes restParametes, RestfulOptions options,
199             RestfulAsyncCallback callback) throws ServiceException;
200
201     /**
202      * Http DELETE method.<br/>
203      * 
204      * @param servicePath: request path.
205      * @param restParametes: request parameters.
206      * @return response.
207      * @throws ServiceException
208      * @since SDNO 0.5
209      */
210     RestfulResponse delete(String servicePath, RestfulParametes restParametes) throws ServiceException;
211
212     /**
213      * Http DELETE method.<br/>
214      * 
215      * @param servicePath: request path.
216      * @param restParametes: request parameters.
217      * @param options: request options.
218      * @return response.
219      * @throws ServiceException
220      * @since SDNO 0.5
221      */
222     RestfulResponse delete(String servicePath, RestfulParametes restParametes, RestfulOptions options)
223             throws ServiceException;
224
225     /**
226      * Asynchronouse DELETE request.<br/>
227      * 
228      * @param servicePath: request path.
229      * @param restParametes: request parameters.
230      * @param callback: response callback method.
231      * @throws ServiceException
232      * @since SDNO 0.5
233      */
234     void asyncDelete(String servicePath, RestfulParametes restParametes, RestfulAsyncCallback callback)
235             throws ServiceException;
236
237     /**
238      * Asynchronouse DELETE request.<br/>
239      * 
240      * @param servicePath: request path.
241      * @param restParametes: request parameters.
242      * @param options: request options.
243      * @param callback: response callback method.
244      * @throws ServiceException
245      * @since SDNO 0.5
246      */
247     void asyncDelete(String servicePath, RestfulParametes restParametes, RestfulOptions options,
248             RestfulAsyncCallback callback) throws ServiceException;
249
250     /**
251      * Http PATCH method.<br/>
252      * 
253      * @param servicePath: request path.
254      * @param restParametes: request parameters.
255      * @return response.
256      * @throws ServiceException
257      * @since SDNO 0.5
258      */
259     RestfulResponse patch(String servicePath, RestfulParametes restParametes) throws ServiceException;
260
261     /**
262      * Http PATCH method.<br/>
263      * 
264      * @param servicePath: request path.
265      * @param restParametes: request parameters.
266      * @param options: request options.
267      * @return response.
268      * @throws ServiceException
269      * @since SDNO 0.5
270      */
271     RestfulResponse patch(String servicePath, RestfulParametes restParametes, RestfulOptions options)
272             throws ServiceException;
273
274     /**
275      * Asynchronouse PATCH request.<br/>
276      * 
277      * @param servicePath: request path.
278      * @param restParametes: request parameters.
279      * @param callback: response callback method.
280      * @throws ServiceException
281      * @since SDNO 0.5
282      */
283     void asyncPatch(String servicePath, RestfulParametes restParametes, RestfulAsyncCallback callback)
284             throws ServiceException;
285
286     /**
287      * Asynchronouse PATCH request.<br/>
288      * 
289      * @param servicePath: request path.
290      * @param restParametes: request parameters.
291      * @param options: request options.
292      * @param callback: response callback method.
293      * @throws ServiceException
294      * @since SDNO 0.5
295      */
296     void asyncPatch(String servicePath, RestfulParametes restParametes, RestfulOptions options,
297             RestfulAsyncCallback callback) throws ServiceException;
298 }