Fix OSGi wiring issues
[ccsdk/features.git] / blueprints-processor / adaptors / rest-adaptor-provider / src / main / java / org / onap / ccsdk / config / rest / adaptor / service / ConfigRestAdaptorService.java
1 /*\r
2  * Copyright © 2017-2018 AT&T Intellectual Property.\r
3  * Modifications Copyright © 2018 IBM.\r
4  * \r
5  * Licensed under the Apache License, Version 2.0 (the "License");\r
6  * you may not use this file except in compliance with the License.\r
7  * You may obtain a copy of the License at\r
8  * \r
9  * http://www.apache.org/licenses/LICENSE-2.0\r
10  * \r
11  * Unless required by applicable law or agreed to in writing, software\r
12  * distributed under the License is distributed on an "AS IS" BASIS,\r
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14  * See the License for the specific language governing permissions and\r
15  * limitations under the License.\r
16  */\r
17 \r
18 package org.onap.ccsdk.config.rest.adaptor.service;\r
19 \r
20 import org.onap.ccsdk.config.rest.adaptor.ConfigRestAdaptorException;\r
21 import org.onap.ccsdk.config.rest.adaptor.data.RestResponse;\r
22 \r
23 public interface ConfigRestAdaptorService {\r
24 \r
25     /**\r
26      * Retrieve an entity by doing a GET on the specified URL. The response is converted and stored in\r
27      * defined responseType.\r
28      * \r
29      * @param selectorName the property selector\r
30      * @param path the URI path which will append in baseURL mentioned in selector property\r
31      * @param responseType the type of the return value\r
32      */\r
33     public <T> T getResource(String selectorName, String path, Class<T> responseType) throws ConfigRestAdaptorException;\r
34 \r
35     /**\r
36      * Create a new resource by POSTing the given object to the URI template, and returns the response\r
37      * as defined responseType\r
38      * \r
39      * @param selectorName the property selector\r
40      * @param path the URI path which will append in baseURL mentioned in selector property\r
41      * @param request the Object to be POSTed, may be {@code null}\r
42      * @param responseType the type of the return value\r
43      */\r
44     public <T> T postResource(String selectorName, String path, Object request, Class<T> responseType)\r
45             throws ConfigRestAdaptorException;\r
46 \r
47     /**\r
48      * Execute the HTTP method to the given URI template, writing the given request entity to the\r
49      * request, and returns the response as defined responseType\r
50      * \r
51      * @param selectorName the property selector\r
52      * @param path the URI path which will append in baseURL mentioned in selector property\r
53      * @param request the Object to be POSTed, may be {@code null}\r
54      * @param responseType the type of the return value\r
55      * @param method the HTTP method (GET, POST, etc)\r
56      */\r
57     public <T> T exchangeResource(String selectorName, String path, Object request, Class<T> responseType,\r
58             String method) throws ConfigRestAdaptorException;\r
59 \r
60     /**\r
61      * Retrieve an entity by doing a GET on the specified URL. The response is converted and stored in\r
62      * defined responseType.\r
63      * \r
64      * @param selectorName the property selector\r
65      * @param path the URI path which will append in baseURL mentioned in selector property\r
66      */\r
67     public RestResponse getResource(String selectorName, String path) throws ConfigRestAdaptorException;\r
68 \r
69     /**\r
70      * Create a new resource by POSTing the given object to the URI template, and returns the response\r
71      * as defined responseType\r
72      * \r
73      * @param selectorName the property selector\r
74      * @param path the URI path which will append in baseURL mentioned in selector property\r
75      * @param request the Object to be POSTed, may be {@code null}\r
76      */\r
77     public RestResponse postResource(String selectorName, String path, Object request)\r
78             throws ConfigRestAdaptorException;\r
79 \r
80     /**\r
81      * Execute the HTTP method to the given URI template, writing the given request entity to the\r
82      * request, and returns the response as defined responseType\r
83      * \r
84      * @param selectorName the property selector\r
85      * @param path the URI path which will append in baseURL mentioned in selector property\r
86      * @param request the Object to be POSTed, may be {@code null}\r
87      * @param method the HTTP method (GET, POST, etc)\r
88      */\r
89     public RestResponse exchangeResource(String selectorName, String path, Object request, String method)\r
90             throws ConfigRestAdaptorException;\r
91 \r
92 }\r