2 * Copyright © 2017-2018 AT&T Intellectual Property.
\r
3 * Modifications Copyright © 2018 IBM.
\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
9 * http://www.apache.org/licenses/LICENSE-2.0
\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
18 package org.onap.ccsdk.config.rest.adaptor.service;
\r
20 import org.onap.ccsdk.config.rest.adaptor.ConfigRestAdaptorException;
\r
21 import org.onap.ccsdk.config.rest.adaptor.data.RestResponse;
\r
23 public interface ConfigRestAdaptorService {
\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
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
33 public <T> T getResource(String selectorName, String path, Class<T> responseType) throws ConfigRestAdaptorException;
\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
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
44 public <T> T postResource(String selectorName, String path, Object request, Class<T> responseType)
\r
45 throws ConfigRestAdaptorException;
\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
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
57 public <T> T exchangeResource(String selectorName, String path, Object request, Class<T> responseType,
\r
58 String method) throws ConfigRestAdaptorException;
\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
64 * @param selectorName the property selector
\r
65 * @param path the URI path which will append in baseURL mentioned in selector property
\r
67 public RestResponse getResource(String selectorName, String path) throws ConfigRestAdaptorException;
\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
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
77 public RestResponse postResource(String selectorName, String path, Object request)
\r
78 throws ConfigRestAdaptorException;
\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
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
89 public RestResponse exchangeResource(String selectorName, String path, Object request, String method)
\r
90 throws ConfigRestAdaptorException;
\r