2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
7 * Modifications Copyright (c) 2019 Samsung
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
23 package org.onap.so.adapters.vnfrest;
27 import javax.xml.bind.annotation.XmlRootElement;
28 import org.onap.so.openstack.beans.VnfStatus;
29 import com.fasterxml.jackson.databind.ObjectMapper;
30 import com.fasterxml.jackson.databind.SerializationFeature;
31 import org.slf4j.Logger;
32 import org.slf4j.LoggerFactory;
34 @XmlRootElement(name = "queryVolumeGroupResponse")
35 public class QueryVolumeGroupResponse {
36 private static final Logger logger = LoggerFactory.getLogger(QueryVolumeGroupResponse.class);
37 private String volumeGroupId;
38 private String volumeGroupStackId;
39 private VnfStatus volumeGroupStatus;
40 private Map<String, String> volumeGroupOutputs;
42 public QueryVolumeGroupResponse() {}
44 public QueryVolumeGroupResponse(String volumeGroupId, String volumeGroupStackId, VnfStatus volumeGroupStatus,
45 Map<String, String> volumeGroupOutputs) {
47 this.volumeGroupId = volumeGroupId;
48 this.volumeGroupStackId = volumeGroupStackId;
49 this.volumeGroupStatus = volumeGroupStatus;
50 this.volumeGroupOutputs = volumeGroupOutputs;
53 public String getVolumeGroupId() {
57 public void setVolumeGroupId(String volumeGroupId) {
58 this.volumeGroupId = volumeGroupId;
61 public String getVolumeGroupStackId() {
62 return volumeGroupStackId;
65 public void setVolumeGroupStackId(String volumeGroupStackId) {
66 this.volumeGroupStackId = volumeGroupStackId;
69 public VnfStatus getVolumeGroupStatus() {
70 return volumeGroupStatus;
73 public void setVolumeGroupStatus(VnfStatus volumeGroupStatus) {
74 this.volumeGroupStatus = volumeGroupStatus;
77 public Map<String, String> getVolumeGroupOutputs() {
78 return volumeGroupOutputs;
81 public void setVolumeGroupOutputs(Map<String, String> volumeGroupOutputs) {
82 this.volumeGroupOutputs = volumeGroupOutputs;
85 public String toJsonString() {
86 String jsonString = null;
88 ObjectMapper mapper = new ObjectMapper();
89 mapper.enable(SerializationFeature.WRAP_ROOT_VALUE);
90 jsonString = mapper.writeValueAsString(this);
91 } catch (Exception e) {
92 logger.debug("Exception :", e);