f3f252d96e43ced8526f2adbef4d030953c4b615
[so.git] /
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 import org.openecomp.mso.logger.MsoLogger;
25
26
27 import java.util.Map;
28
29 import javax.xml.bind.annotation.XmlRootElement;
30
31 import org.codehaus.jackson.map.ObjectMapper;
32 import org.jboss.resteasy.annotations.providers.NoJackson;
33 import org.openecomp.mso.logger.MsoLogger;
34 import org.openecomp.mso.openstack.beans.VnfStatus;
35
36 @XmlRootElement(name = "queryVfModuleResponse")
37 @NoJackson
38 public class QueryVfModuleResponse {
39         private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
40         private String vnfId;
41         private String vfModuleId;
42         private String vfModuleStackId;
43         private VnfStatus vnfStatus;
44         private Map<String,String> vfModuleOutputs;
45
46         public QueryVfModuleResponse() {
47                 super();
48         }
49
50         public QueryVfModuleResponse(String vnfId, String vfModuleId,
51                         String vfModuleStackId, VnfStatus vnfStatus,
52                         Map<String, String> vfModuleOutputs) {
53                 super();
54                 this.vnfId = vnfId;
55                 this.vfModuleId = vfModuleId;
56                 this.vfModuleStackId = vfModuleStackId;
57                 this.vnfStatus = vnfStatus;
58                 this.vfModuleOutputs = vfModuleOutputs;
59         }
60
61         public String getVnfId() {
62                 return vnfId;
63         }
64
65         public void setVnfId(String vnfId) {
66                 this.vnfId = vnfId;
67         }
68
69         public String getVfModuleId() {
70                 return vfModuleId;
71         }
72
73         public void setVfModuleId(String vfModuleId) {
74                 this.vfModuleId = vfModuleId;
75         }
76
77         public String getVfModuleStackId() {
78                 return vfModuleStackId;
79         }
80
81         public void setVfModuleStackId(String vfModuleStackId) {
82                 this.vfModuleStackId = vfModuleStackId;
83         }
84
85         public VnfStatus getVnfStatus() {
86                 return vnfStatus;
87         }
88
89         public void setVnfStatus(VnfStatus vnfStatus) {
90                 this.vnfStatus = vnfStatus;
91         }
92
93         public Map<String, String> getVfModuleOutputs() {
94                 return vfModuleOutputs;
95         }
96
97         public void setVfModuleOutputs(Map<String, String> vfModuleOutputs) {
98                 this.vfModuleOutputs = vfModuleOutputs;
99         }
100
101         public String toJsonString() {
102                 String jsonString = null;
103                 try {
104                         ObjectMapper mapper = new ObjectMapper();
105                         jsonString = mapper.writeValueAsString(this);
106                 }
107                 catch (Exception e) {
108                         LOGGER.debug("Exception :",e);
109                 }
110                 return jsonString;
111         }
112 }