5e0d8bbe90aad4dd19a015a6c4fcad993346355b
[so.git] / adapters / mso-adapters-rest-interface / src / main / java / org / openecomp / mso / adapters / vnfrest / QueryVolumeGroupResponse.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * OPENECOMP - MSO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.mso.adapters.vnfrest;
22
23
24 import java.util.Map;
25
26 import javax.xml.bind.annotation.XmlRootElement;
27
28 import org.codehaus.jackson.map.ObjectMapper;
29 import org.codehaus.jackson.map.SerializationConfig;
30 import org.jboss.resteasy.annotations.providers.NoJackson;
31
32 import org.openecomp.mso.openstack.beans.VnfStatus;
33
34 @XmlRootElement(name = "queryVolumeGroupResponse")
35 @NoJackson
36 public class QueryVolumeGroupResponse {
37         private String volumeGroupId;
38         private String volumeGroupStackId;
39         private VnfStatus volumeGroupStatus;
40         private Map<String,String> volumeGroupOutputs;
41
42         public QueryVolumeGroupResponse() {
43         }
44
45         public QueryVolumeGroupResponse(
46                         String volumeGroupId,
47                         String volumeGroupStackId,
48                         VnfStatus volumeGroupStatus,
49                         Map<String, String> volumeGroupOutputs)
50         {
51                 super();
52                 this.volumeGroupId = volumeGroupId;
53                 this.volumeGroupStackId = volumeGroupStackId;
54                 this.volumeGroupStatus = volumeGroupStatus;
55                 this.volumeGroupOutputs = volumeGroupOutputs;
56         }
57
58         public String getVolumeGroupId() {
59                 return volumeGroupId;
60         }
61
62         public void setVolumeGroupId(String volumeGroupId) {
63                 this.volumeGroupId = volumeGroupId;
64         }
65
66         public String getVolumeGroupStackId() {
67                 return volumeGroupStackId;
68         }
69
70         public void setVolumeGroupStackId(String volumeGroupStackId) {
71                 this.volumeGroupStackId = volumeGroupStackId;
72         }
73
74         public VnfStatus getVolumeGroupStatus() {
75                 return volumeGroupStatus;
76         }
77
78         public void setVolumeGroupStatus(VnfStatus volumeGroupStatus) {
79                 this.volumeGroupStatus = volumeGroupStatus;
80         }
81
82         public Map<String, String> getVolumeGroupOutputs() {
83                 return volumeGroupOutputs;
84         }
85
86         public void setVolumeGroupOutputs(Map<String, String> volumeGroupOutputs) {
87                 this.volumeGroupOutputs = volumeGroupOutputs;
88         }
89
90         public String toJsonString() {
91                 String jsonString = null;
92                 try {
93                         ObjectMapper mapper = new ObjectMapper();
94                         mapper.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE);
95                         jsonString = mapper.writeValueAsString(this);
96                 }
97                 catch (Exception e) {}
98                 return jsonString;
99         }
100 }