Fix license header violations in neutron-spi
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronVPNIPSECSiteConnection.java
1 /*
2  * Copyright (c) 2015 IBM Corporation and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.neutron.spi;
10
11 import java.io.Serializable;
12
13 import java.util.Iterator;
14 import java.util.List;
15
16 import javax.xml.bind.annotation.XmlAccessType;
17 import javax.xml.bind.annotation.XmlAccessorType;
18 import javax.xml.bind.annotation.XmlElement;
19 import javax.xml.bind.annotation.XmlRootElement;
20
21 @XmlRootElement
22 @XmlAccessorType(XmlAccessType.NONE)
23 public class NeutronVPNIPSECSiteConnection implements Serializable, INeutronObject {
24     private static final long serialVersionUID = 1L;
25
26     // See OpenStack Network API v2.0 Reference for description of
27     // annotated attributes
28
29     @XmlElement (name = "id")
30     String id;
31
32     @XmlElement (name = "tenant_id")
33     String tenantID;
34
35     @XmlElement (name = "name")
36     String name;
37
38     @XmlElement (name = "description")
39     String description;
40
41     @XmlElement (name = "peer_address")
42     String peerAddress;
43
44     @XmlElement (name = "peer_id")
45     String peerID;
46
47     @XmlElement (name = "peer_cidrs")
48     List<String> peerCidrs;
49
50     @XmlElement (name = "route_mode")
51     String routeMode;
52
53     @XmlElement (name = "mtu")
54     Integer mtu;
55
56     @XmlElement (name = "auth_mode")
57     String authMode;
58
59     @XmlElement (name = "psk")
60     String preSharedKey;
61
62     @XmlElement (name = "initiator")
63     String initiator;
64
65     @XmlElement (defaultValue = "true", name = "admin_state_up")
66     Boolean adminStateUp;
67
68     @XmlElement (name = "status")
69     String status;
70
71     @XmlElement (name = "ikepolicy_id")
72     String ikePolicyID;
73
74     @XmlElement (name = "ipsecpolicy_id")
75     String ipsecPolicyID;
76
77     @XmlElement (name = "vpnservice_id")
78     String vpnServiceID;
79
80     @XmlElement (name = "dpd")
81     NeutronVPNDeadPeerDetection deadPeerDetection;
82
83     public NeutronVPNIPSECSiteConnection() {
84     }
85
86     public String getID() {
87         return id;
88     }
89
90     public void setID(String id) {
91         this.id = id;
92     }
93
94     public String getTenantID() {
95         return tenantID;
96     }
97
98     public void setTenantID(String tenantID) {
99         this.tenantID = tenantID;
100     }
101
102     public String getName() {
103         return name;
104     }
105
106     public void setName(String name) {
107         this.name = name;
108     }
109
110     public String getDescription() {
111         return description;
112     }
113
114     public void setDescription(String description) {
115         this.description = description;
116     }
117
118     public String getPeerAddress() {
119         return peerAddress;
120     }
121
122     public void setPeerAddress(String peerAddress) {
123         this.peerAddress = peerAddress;
124     }
125
126     public String getPeerID() {
127         return peerID;
128     }
129
130     public void setPeerID(String peerID) {
131         this.peerID = peerID;
132     }
133
134     public List<String> getPeerCidrs() {
135         return peerCidrs;
136     }
137
138     public void setPeerCidrs(List<String> peerCidrs) {
139         this.peerCidrs = peerCidrs;
140     }
141
142     public String getRouteMode() {
143         return routeMode;
144     }
145
146     public void setRouteMode(String routeMode) {
147         this.routeMode = routeMode;
148     }
149
150     public Integer getMtu() {
151         return mtu;
152     }
153
154     public void setMtu(Integer mtu) {
155         this.mtu = mtu;
156     }
157
158     public String getAuthMode() {
159         return authMode;
160     }
161
162     public void setAuthMode(String authMode) {
163         this.authMode = authMode;
164     }
165
166     public String getPreSharedKey() {
167         return preSharedKey;
168     }
169
170     public void setPreSharedKey(String preSharedKey) {
171         this.preSharedKey = preSharedKey;
172     }
173
174     public String getInitiator() {
175         return initiator;
176     }
177
178     public void setInitiator(String initiator) {
179         this.initiator = initiator;
180     }
181
182     public Boolean getAdminStateUp() { return adminStateUp; }
183
184     public void setAdminStateUp(boolean newValue) {
185         adminStateUp = newValue;
186     }
187
188     public String getStatus() {
189         return status;
190     }
191
192     public void setStatus(String status) {
193         this.status = status;
194     }
195
196     public String getIkePolicyID() {
197         return ikePolicyID;
198     }
199
200     public void setIkePolicyID(String ikePolicyID) {
201         this.ikePolicyID = ikePolicyID;
202     }
203
204     public String getIpsecPolicyID() {
205         return ipsecPolicyID;
206     }
207
208     public void setIpsecPolicyID(String ipsecPolicyID) {
209         this.ipsecPolicyID = ipsecPolicyID;
210     }
211
212     public String getVpnServiceID() {
213         return vpnServiceID;
214     }
215
216     public void setVpnServiceID(String vpnServiceID) {
217         this.vpnServiceID = vpnServiceID;
218     }
219
220     public NeutronVPNDeadPeerDetection getDeadPeerDetection() {
221         return deadPeerDetection;
222     }
223
224     public void setDeadPeerDetection(NeutronVPNDeadPeerDetection deadPeerDetection) {
225         this.deadPeerDetection = deadPeerDetection;
226     }
227
228     /**
229      * This method copies selected fields from the object and returns them as a
230      * new object, suitable for marshaling.
231      *
232      * @param fields
233      *            List of attributes to be extracted
234      * @return a NeutronVPNIPSECSiteConnection object with only the selected
235      *         fields populated
236      */
237
238     public NeutronVPNIPSECSiteConnection extractFields(List<String> fields) {
239         NeutronVPNIPSECSiteConnection ans = new NeutronVPNIPSECSiteConnection();
240         Iterator<String> i = fields.iterator();
241         while (i.hasNext()) {
242             String s = i.next();
243             if (s.equals("id")) {
244                 ans.setID(this.getID());
245             }
246             if (s.equals("tenant_id")) {
247                 ans.setTenantID(this.getTenantID());
248             }
249             if (s.equals("name")) {
250                 ans.setName(this.getName());
251             }
252             if (s.equals("description")) {
253                 ans.setDescription(this.getDescription());
254             }
255             if (s.equals("peer_address")) {
256                 ans.setPeerAddress(this.getPeerAddress());
257             }
258             if (s.equals("peer_id")) {
259                 ans.setPeerID(this.getPeerID());
260             }
261             if (s.equals("route_mode")) {
262                 ans.setRouteMode(this.getRouteMode());
263             }
264             if (s.equals("mtu")) {
265                 ans.setMtu(this.getMtu());
266             }
267             if (s.equals("auth_mode")) {
268                 ans.setAuthMode(this.getAuthMode());
269             }
270             if (s.equals("psk")) {
271                 ans.setPreSharedKey(this.getPreSharedKey());
272             }
273             if (s.equals("initiator")) {
274                 ans.setInitiator(this.getInitiator());
275             }
276             if (s.equals("admin_state_up")) {
277                 ans.setAdminStateUp(this.getAdminStateUp());
278             }
279             if (s.equals("status")) {
280                 ans.setStatus(this.getStatus());
281             }
282             if (s.equals("ikepolicy_id")) {
283                 ans.setIkePolicyID(this.getIkePolicyID());
284             }
285             if (s.equals("ipsecpolicy_id")) {
286                 ans.setIpsecPolicyID(this.getIpsecPolicyID());
287             }
288             if (s.equals("vpnservice_id")) {
289                 ans.setVpnServiceID(this.getVpnServiceID());
290             }
291         }
292         return ans;
293     }
294
295     @Override
296     public String toString() {
297         return "NeutronVPNIPSECSiteConnection{" + "id='" + id + '\'' + ", tenantID='" + tenantID + '\'' + ", name='"
298                 + name + '\'' + ", description=" + description + ", peerAddress=" + peerAddress + ", peerID='" + peerID
299                 + '\'' + ", routeMode='" + routeMode + '\'' + ", mtu=" + mtu + ", authMode='" + authMode + '\''
300                 + ", preSharedKey='" + preSharedKey + '\'' + ", initiator='" + initiator + '\'' + ", adminStateUp="
301                 + adminStateUp + ", status='" + status + '\'' + ", ikePolicyID='" + ikePolicyID + '\''
302                 + ", ipsecPolicyID='" + ipsecPolicyID + '\'' + ", vpnServiceID='" + vpnServiceID + '\'' + '}';
303     }
304 }