2 * Copyright © 2017-2018 AT&T Intellectual Property.
\r
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
\r
5 * in compliance with the License. You may obtain a copy of the License at
\r
7 * http://www.apache.org/licenses/LICENSE-2.0
\r
9 * Unless required by applicable law or agreed to in writing, software distributed under the License
\r
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
\r
11 * or implied. See the License for the specific language governing permissions and limitations under
\r
15 package org.onap.ccsdk.config.rest.adaptor.service;
\r
17 import org.onap.ccsdk.config.rest.adaptor.ConfigRestAdaptorException;
\r
18 import org.onap.ccsdk.config.rest.adaptor.data.RestResponse;
\r
20 public interface ConfigRestAdaptorService {
\r
23 * Retrieve an entity by doing a GET on the specified URL. The response is converted and stored in
\r
24 * defined responseType.
\r
26 * @param selectorName the property selector
\r
27 * @param path the URI path which will append in baseURL mentioned in selector property
\r
28 * @param responseType the type of the return value
\r
30 public <T> T getResource(String selectorName, String path, Class<T> responseType) throws ConfigRestAdaptorException;
\r
33 * Create a new resource by POSTing the given object to the URI template, and returns the response
\r
34 * as defined responseType
\r
36 * @param selectorName the property selector
\r
37 * @param path the URI path which will append in baseURL mentioned in selector property
\r
38 * @param request the Object to be POSTed, may be {@code null}
\r
39 * @param responseType the type of the return value
\r
41 public <T> T postResource(String selectorName, String path, Object request, Class<T> responseType)
\r
42 throws ConfigRestAdaptorException;
\r
45 * Execute the HTTP method to the given URI template, writing the given request entity to the
\r
46 * request, and returns the response as defined responseType
\r
48 * @param selectorName the property selector
\r
49 * @param path the URI path which will append in baseURL mentioned in selector property
\r
50 * @param request the Object to be POSTed, may be {@code null}
\r
51 * @param responseType the type of the return value
\r
52 * @param method the HTTP method (GET, POST, etc)
\r
54 public <T> T exchangeResource(String selectorName, String path, Object request, Class<T> responseType,
\r
55 String method) throws ConfigRestAdaptorException;
\r
58 * Retrieve an entity by doing a GET on the specified URL. The response is converted and stored in
\r
59 * defined responseType.
\r
61 * @param selectorName the property selector
\r
62 * @param path the URI path which will append in baseURL mentioned in selector property
\r
64 public RestResponse getResource(String selectorName, String path) throws ConfigRestAdaptorException;
\r
67 * Create a new resource by POSTing the given object to the URI template, and returns the response
\r
68 * as defined responseType
\r
70 * @param selectorName the property selector
\r
71 * @param path the URI path which will append in baseURL mentioned in selector property
\r
72 * @param request the Object to be POSTed, may be {@code null}
\r
74 public RestResponse postResource(String selectorName, String path, Object request)
\r
75 throws ConfigRestAdaptorException;
\r
78 * Execute the HTTP method to the given URI template, writing the given request entity to the
\r
79 * request, and returns the response as defined responseType
\r
81 * @param selectorName the property selector
\r
82 * @param path the URI path which will append in baseURL mentioned in selector property
\r
83 * @param request the Object to be POSTed, may be {@code null}
\r
84 * @param method the HTTP method (GET, POST, etc)
\r
86 public RestResponse exchangeResource(String selectorName, String path, Object request, String method)
\r
87 throws ConfigRestAdaptorException;
\r