2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 - 2019 Nokia. All rights reserved.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.vid.client;
23 import io.joshworks.restclient.http.HttpResponse;
24 import io.joshworks.restclient.http.JsonNode;
26 import java.io.InputStream;
29 public interface SyncRestClientInterface {
31 public static final String CONTENT_TYPE = "Content-Type";
32 public static final String AUTHORIZATION = "Authorization";
33 public static final String X_ECOMP_INSTANCE_ID = "X-ECOMP-InstanceID";
36 HttpResponse<JsonNode> post(String url, Map<String, String> headers, Object body);
38 <T> HttpResponse<T> post(String url, Map<String, String> headers, Object body, Class<T> aClass);
40 HttpResponse<JsonNode> get(String url, Map<String, String> headers, Map<String, String> routeParams);
42 <T> HttpResponse<T> get(String url, Map<String, String> headers, Map<String, String> routeParams, Class<T> aClass);
44 HttpResponse<InputStream> getStream(String url, Map<String, String> headers, Map<String, String> routeParams);
46 HttpResponse<JsonNode> put(String url, Map<String, String> headers, Object body);
48 <T> HttpResponse<T> put(String url, Map<String, String> headers, Object body, Class<T> aClass);
50 <T> HttpResponse<T> delete(String url, Map<String, String> headers, Object body, Class<T> aClass);
52 <T> HttpResponse<T> delete(String url, Map<String, String> headers, Class<T> aClass);
54 HttpResponse<JsonNode> delete(String url, Map<String, String> headers);