2 * Copyright 2016 Huawei Technologies Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.common.restclient;
22 * Response for RestFul requests.<br/>
27 * @version 28-May-2016
29 public class RestfulResponse {
31 private String responseContent;
33 private int status = -1;
35 private Map<String, String> respHeaderMap = null;
43 public int getStatus() {
53 public void setStatus(final int status) {
63 public Map<String, String> getRespHeaderMap() {
73 public void setRespHeaderMap(final Map<String, String> header) {
74 this.respHeaderMap = header;
78 * Get response header value as integer.<br/>
80 * @param key header param name.
81 * @return header param value as integer. (-1 if error)
84 public int getRespHeaderInt(final String key) {
85 if(respHeaderMap != null) {
86 final String result = respHeaderMap.get(key);
88 return Integer.parseInt(result);
95 * Get response header value as long.<br/>
97 * @param key header param name.
98 * @return value as long. -1 if no value.
101 public long getRespHeaderLong(final String key) {
102 if(respHeaderMap != null) {
103 final String result = respHeaderMap.get(key);
105 return Long.parseLong(result);
112 * Get http header as string.<br/>
114 * @param key header name.
115 * @return header value.
118 public String getRespHeaderStr(final String key) {
119 if(respHeaderMap != null) {
120 return respHeaderMap.get(key);
131 public String getResponseContent() {
132 return responseContent;
138 * @param responseString
141 public void setResponseJson(final String responseString) {
142 this.responseContent = responseString;