e79b463f93ba19732cf70eee5f167406d389b21d
[so.git] / adapters / mso-adapters-rest-interface / src / main / java / org / openecomp / mso / adapters / nwrest / QueryNetworkResponse.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.nwrest;
22
23
24
25 import org.openecomp.mso.openstack.beans.NetworkStatus;
26
27 import java.util.List;
28 import java.util.Map;
29
30 import javax.xml.bind.annotation.XmlRootElement;
31
32 import org.codehaus.jackson.map.ObjectMapper;
33 import org.jboss.resteasy.annotations.providers.NoJackson;
34
35 @XmlRootElement(name = "queryNetworkResponse")
36 @NoJackson
37 public class QueryNetworkResponse {
38         private String networkId;
39         private String neutronNetworkId;
40         private String networkStackId;
41         private Boolean networkExists;
42         private NetworkStatus networkStatus;
43         private List<Integer> vlans;
44         private List<String> routeTargets;
45         private Map<String, String> subnetIdMap;
46         private Map<String, String> networkOutputs;
47         
48         public QueryNetworkResponse() {
49                 super();
50         }
51
52         public QueryNetworkResponse(String networkId, String neutronNetworkId,
53                         String networkStackId, NetworkStatus networkStatus,
54                         Map<String, String> networkOutputs) {
55                 super();
56                 this.networkId = networkId;
57                 this.neutronNetworkId = neutronNetworkId;
58                 this.networkStackId = networkStackId;
59                 this.networkStatus = networkStatus;
60                 this.networkOutputs = networkOutputs;
61         }
62
63         public String getNetworkId() {
64                 return networkId;
65         }
66
67         public void setNetworkId(String networkId) {
68                 this.networkId = networkId;
69         }
70
71         public String getNeutronNetworkId() {
72                 return neutronNetworkId;
73         }
74
75         public void setNeutronNetworkId(String neutronNetworkId) {
76                 this.neutronNetworkId = neutronNetworkId;
77         }
78
79         public String getNetworkStackId() {
80                 return networkStackId;
81         }
82
83         public void setNetworkStackId(String networkStackId) {
84                 this.networkStackId = networkStackId;
85         }
86
87         public NetworkStatus getNetworkStatus() {
88                 return networkStatus;
89         }
90
91         public void setNetworkStatus(NetworkStatus networkStatus) {
92                 this.networkStatus = networkStatus;
93         }
94
95         public Boolean getNetworkExists() {
96                 return networkExists;
97         }
98
99         public void setNetworkExists(Boolean networkExists) {
100                 this.networkExists = networkExists;
101         }
102
103         public List<Integer> getVlans() {
104                 return vlans;
105         }
106
107         public void setVlans(List<Integer> vlans) {
108                 this.vlans = vlans;
109         }
110
111         public List<String> getRouteTargets() {
112                 return routeTargets;
113         }
114
115         public void setRouteTargets(List<String> routeTargets) {
116                 this.routeTargets = routeTargets;
117         }
118
119         public Map<String, String> getSubnetIdMap() {
120                 return subnetIdMap;
121         }
122
123         public void setSubnetIdMap(Map<String, String> subnetIdMap) {
124                 this.subnetIdMap = subnetIdMap;
125         }
126
127         public Map<String, String> getNetworkOutputs() {
128                 return networkOutputs;
129         }
130
131         public void setNetworkOutputs(Map<String, String> networkOutputs) {
132                 this.networkOutputs = networkOutputs;
133         }
134         
135         public String toJsonString() {
136                 String jsonString = null;
137                 try {
138                         ObjectMapper mapper = new ObjectMapper();
139                         jsonString = mapper.writeValueAsString(this);
140                 }
141                 catch (Exception e) {}
142                 return jsonString;
143         }
144 }