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