2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
20 package org.openecomp.mso.adapters.vfc.model;
\r
22 import java.util.Map;
\r
25 * The Unified Restful Reponse Class
\r
31 * @version ONAP Amsterdam Release 2017-09-06
\r
33 public class RestfulResponse {
\r
35 // the response content
\r
36 private String responseContent;
\r
38 //the response status
\r
41 //the response header
\r
42 private Map<String, String> respHeaderMap;
\r
44 public RestfulResponse() {
\r
47 this.respHeaderMap = null;
\r
50 public int getStatus() {
\r
54 public void setStatus(int status) {
\r
55 this.status = status;
\r
58 public Map<String, String> getRespHeaderMap() {
\r
59 return this.respHeaderMap;
\r
62 public void setRespHeaderMap(Map<String, String> header) {
\r
63 this.respHeaderMap = header;
\r
66 public int getRespHeaderInt(String key) {
\r
67 if(this.respHeaderMap != null) {
\r
68 String result = this.respHeaderMap.get(key);
\r
69 if(result != null) {
\r
70 return Integer.parseInt(result);
\r
76 public long getRespHeaderLong(String key) {
\r
77 if(this.respHeaderMap != null) {
\r
78 String result = this.respHeaderMap.get(key);
\r
79 if(result != null) {
\r
80 return Long.parseLong(result);
\r
86 public String getRespHeaderStr(String key) {
\r
87 if(this.respHeaderMap != null) {
\r
88 return this.respHeaderMap.get(key);
\r
93 public String getResponseContent() {
\r
94 return this.responseContent;
\r
97 public void setResponseContent(String responseString) {
\r
98 this.responseContent = responseString;
\r