e70b9ddc71a57b3bd231e9d1c0b6d86a9aec5a97
[so.git] / adapters / mso-adapters-rest-interface / src / main / java / org / openecomp / mso / 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.openecomp.mso.adapters.vnfrest;
23
24
25 import java.util.Map;
26
27 import javax.xml.bind.annotation.XmlRootElement;
28
29 import org.codehaus.jackson.map.ObjectMapper;
30 import org.codehaus.jackson.map.SerializationConfig;
31 import org.jboss.resteasy.annotations.providers.NoJackson;
32
33 import org.openecomp.mso.logger.MsoLogger;
34
35 import org.openecomp.mso.openstack.beans.VnfStatus;
36
37 @XmlRootElement(name = "queryVolumeGroupResponse")
38 @NoJackson
39 public class QueryVolumeGroupResponse {
40         private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
41         private String volumeGroupId;
42         private String volumeGroupStackId;
43         private VnfStatus volumeGroupStatus;
44         private Map<String,String> volumeGroupOutputs;
45
46         public QueryVolumeGroupResponse() {
47         }
48
49         public QueryVolumeGroupResponse(
50                         String volumeGroupId,
51                         String volumeGroupStackId,
52                         VnfStatus volumeGroupStatus,
53                         Map<String, String> volumeGroupOutputs)
54         {
55                 super();
56                 this.volumeGroupId = volumeGroupId;
57                 this.volumeGroupStackId = volumeGroupStackId;
58                 this.volumeGroupStatus = volumeGroupStatus;
59                 this.volumeGroupOutputs = volumeGroupOutputs;
60         }
61
62         public String getVolumeGroupId() {
63                 return volumeGroupId;
64         }
65
66         public void setVolumeGroupId(String volumeGroupId) {
67                 this.volumeGroupId = volumeGroupId;
68         }
69
70         public String getVolumeGroupStackId() {
71                 return volumeGroupStackId;
72         }
73
74         public void setVolumeGroupStackId(String volumeGroupStackId) {
75                 this.volumeGroupStackId = volumeGroupStackId;
76         }
77
78         public VnfStatus getVolumeGroupStatus() {
79                 return volumeGroupStatus;
80         }
81
82         public void setVolumeGroupStatus(VnfStatus volumeGroupStatus) {
83                 this.volumeGroupStatus = volumeGroupStatus;
84         }
85
86         public Map<String, String> getVolumeGroupOutputs() {
87                 return volumeGroupOutputs;
88         }
89
90         public void setVolumeGroupOutputs(Map<String, String> volumeGroupOutputs) {
91                 this.volumeGroupOutputs = volumeGroupOutputs;
92         }
93
94         public String toJsonString() {
95                 String jsonString = null;
96                 try {
97                         ObjectMapper mapper = new ObjectMapper();
98                         mapper.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE);
99                         jsonString = mapper.writeValueAsString(this);
100                 }
101                 catch (Exception e) {
102                         LOGGER.debug("Exception :",e);
103                 }
104                 return jsonString;
105         }
106 }