Replaced all tabs with spaces in java and pom.xml
[so.git] / adapters / mso-adapters-rest-interface / src / main / java / org / onap / so / adapters / vnfrest / QueryVolumeGroupResponse.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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
12  * 
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  * 
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=========================================================
21  */
22
23 package org.onap.so.adapters.vnfrest;
24
25
26 import java.util.Map;
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;
33
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;
41
42     public QueryVolumeGroupResponse() {}
43
44     public QueryVolumeGroupResponse(String volumeGroupId, String volumeGroupStackId, VnfStatus volumeGroupStatus,
45             Map<String, String> volumeGroupOutputs) {
46         super();
47         this.volumeGroupId = volumeGroupId;
48         this.volumeGroupStackId = volumeGroupStackId;
49         this.volumeGroupStatus = volumeGroupStatus;
50         this.volumeGroupOutputs = volumeGroupOutputs;
51     }
52
53     public String getVolumeGroupId() {
54         return volumeGroupId;
55     }
56
57     public void setVolumeGroupId(String volumeGroupId) {
58         this.volumeGroupId = volumeGroupId;
59     }
60
61     public String getVolumeGroupStackId() {
62         return volumeGroupStackId;
63     }
64
65     public void setVolumeGroupStackId(String volumeGroupStackId) {
66         this.volumeGroupStackId = volumeGroupStackId;
67     }
68
69     public VnfStatus getVolumeGroupStatus() {
70         return volumeGroupStatus;
71     }
72
73     public void setVolumeGroupStatus(VnfStatus volumeGroupStatus) {
74         this.volumeGroupStatus = volumeGroupStatus;
75     }
76
77     public Map<String, String> getVolumeGroupOutputs() {
78         return volumeGroupOutputs;
79     }
80
81     public void setVolumeGroupOutputs(Map<String, String> volumeGroupOutputs) {
82         this.volumeGroupOutputs = volumeGroupOutputs;
83     }
84
85     public String toJsonString() {
86         String jsonString = null;
87         try {
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);
93         }
94         return jsonString;
95     }
96 }