blob: a7af2064e23d39a5f529e4a4124ac38217f0bb83 [file] [log] [blame]
Aharoni, Pavel (pa0916)ca3cb012018-10-22 15:29:57 +03001/*-
2 * ============LICENSE_START=======================================================
3 * OSAM
4 * ================================================================================
5 * Copyright (C) 2018 AT&T
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
19 */
20
21
22
23package org.onap.osam.client;
24
25import io.joshworks.restclient.http.HttpResponse;
26import io.joshworks.restclient.http.JsonNode;
27
28import java.io.InputStream;
29import java.util.Map;
30
31public interface SyncRestClientInterface {
32 class HEADERS {
33 public static final String CONTENT_TYPE = "Content-Type";
34 public static final String AUTHORIZATION = "Authorization";
35 public static final String X_ECOMP_INSTANCE_ID = "X-ECOMP-InstanceID";
36 }
37
38 HttpResponse<JsonNode> post(String url, Map<String, String> headers, Object body);
39
40 <T> HttpResponse<T> post(String url, Map<String, String> headers, Object body, Class<T> aClass);
41
42 HttpResponse<JsonNode> get(String url, Map<String, String> headers, Map<String, String> routeParams);
43
44 <T> HttpResponse<T> get(String url, Map<String, String> headers, Map<String, String> routeParams, Class<T> aClass);
45
46 HttpResponse<InputStream> getStream(String url, Map<String, String> headers, Map<String, String> routeParams);
47
48 HttpResponse<JsonNode> put(String url, Map<String, String> headers, Object body);
49
50 <T> HttpResponse<T> put(String url, Map<String, String> headers, Object body, Class<T> aClass);
51
52 <T> HttpResponse<T> delete(String url, Map<String, String> headers, Class<T> aClass);
53
54 HttpResponse<JsonNode> delete(String url, Map<String, String> headers);
55
56 void destroy();
57
58}