Containerization feature of SO
[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  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  * 
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  * 
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.so.adapters.vnfrest;
23
24
25 import java.util.Map;
26
27 import javax.xml.bind.annotation.XmlRootElement;
28
29 import org.onap.so.logger.MsoLogger;
30 import org.onap.so.openstack.beans.VnfStatus;
31
32 import com.fasterxml.jackson.databind.ObjectMapper;
33 import com.fasterxml.jackson.databind.SerializationFeature;
34
35 @XmlRootElement(name = "queryVolumeGroupResponse")
36 public class QueryVolumeGroupResponse {
37         private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, QueryVolumeGroupResponse.class);
38         private String volumeGroupId;
39         private String volumeGroupStackId;
40         private VnfStatus volumeGroupStatus;
41         private Map<String,String> volumeGroupOutputs;
42
43         public QueryVolumeGroupResponse() {
44         }
45
46         public QueryVolumeGroupResponse(
47                         String volumeGroupId,
48                         String volumeGroupStackId,
49                         VnfStatus volumeGroupStatus,
50                         Map<String, String> volumeGroupOutputs)
51         {
52                 super();
53                 this.volumeGroupId = volumeGroupId;
54                 this.volumeGroupStackId = volumeGroupStackId;
55                 this.volumeGroupStatus = volumeGroupStatus;
56                 this.volumeGroupOutputs = volumeGroupOutputs;
57         }
58
59         public String getVolumeGroupId() {
60                 return volumeGroupId;
61         }
62
63         public void setVolumeGroupId(String volumeGroupId) {
64                 this.volumeGroupId = volumeGroupId;
65         }
66
67         public String getVolumeGroupStackId() {
68                 return volumeGroupStackId;
69         }
70
71         public void setVolumeGroupStackId(String volumeGroupStackId) {
72                 this.volumeGroupStackId = volumeGroupStackId;
73         }
74
75         public VnfStatus getVolumeGroupStatus() {
76                 return volumeGroupStatus;
77         }
78
79         public void setVolumeGroupStatus(VnfStatus volumeGroupStatus) {
80                 this.volumeGroupStatus = volumeGroupStatus;
81         }
82
83         public Map<String, String> getVolumeGroupOutputs() {
84                 return volumeGroupOutputs;
85         }
86
87         public void setVolumeGroupOutputs(Map<String, String> volumeGroupOutputs) {
88                 this.volumeGroupOutputs = volumeGroupOutputs;
89         }
90
91         public String toJsonString() {
92                 String jsonString = null;
93                 try {
94                         ObjectMapper mapper = new ObjectMapper();
95                         mapper.enable(SerializationFeature.WRAP_ROOT_VALUE);
96                         jsonString = mapper.writeValueAsString(this);
97                 }
98                 catch (Exception e) {
99                         LOGGER.debug("Exception :",e);
100                 }
101                 return jsonString;
102         }
103 }