2 * Copyright (c) 2015 IBM Corporation and others. All rights reserved.
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
9 package org.opendaylight.neutron.spi;
11 import java.io.Serializable;
13 import java.util.Iterator;
14 import java.util.List;
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;
22 @XmlAccessorType(XmlAccessType.NONE)
23 public class NeutronVPNIPSECSiteConnection implements Serializable, INeutronObject {
24 private static final long serialVersionUID = 1L;
26 // See OpenStack Network API v2.0 Reference for description of
27 // annotated attributes
29 @XmlElement (name = "id")
32 @XmlElement (name = "tenant_id")
35 @XmlElement (name = "name")
38 @XmlElement (name = "description")
41 @XmlElement (name = "peer_address")
44 @XmlElement (name = "peer_id")
47 @XmlElement (name = "peer_cidrs")
48 List<String> peerCidrs;
50 @XmlElement (name = "route_mode")
53 @XmlElement (name = "mtu")
56 @XmlElement (name = "auth_mode")
59 @XmlElement (name = "psk")
62 @XmlElement (name = "initiator")
65 @XmlElement (defaultValue = "true", name = "admin_state_up")
68 @XmlElement (name = "status")
71 @XmlElement (name = "ikepolicy_id")
74 @XmlElement (name = "ipsecpolicy_id")
77 @XmlElement (name = "vpnservice_id")
80 @XmlElement (name = "dpd")
81 NeutronVPNDeadPeerDetection deadPeerDetection;
83 public NeutronVPNIPSECSiteConnection() {
86 public String getID() {
90 public void setID(String id) {
94 public String getTenantID() {
98 public void setTenantID(String tenantID) {
99 this.tenantID = tenantID;
102 public String getName() {
106 public void setName(String name) {
110 public String getDescription() {
114 public void setDescription(String description) {
115 this.description = description;
118 public String getPeerAddress() {
122 public void setPeerAddress(String peerAddress) {
123 this.peerAddress = peerAddress;
126 public String getPeerID() {
130 public void setPeerID(String peerID) {
131 this.peerID = peerID;
134 public List<String> getPeerCidrs() {
138 public void setPeerCidrs(List<String> peerCidrs) {
139 this.peerCidrs = peerCidrs;
142 public String getRouteMode() {
146 public void setRouteMode(String routeMode) {
147 this.routeMode = routeMode;
150 public Integer getMtu() {
154 public void setMtu(Integer mtu) {
158 public String getAuthMode() {
162 public void setAuthMode(String authMode) {
163 this.authMode = authMode;
166 public String getPreSharedKey() {
170 public void setPreSharedKey(String preSharedKey) {
171 this.preSharedKey = preSharedKey;
174 public String getInitiator() {
178 public void setInitiator(String initiator) {
179 this.initiator = initiator;
182 public Boolean getAdminStateUp() { return adminStateUp; }
184 public void setAdminStateUp(boolean newValue) {
185 adminStateUp = newValue;
188 public String getStatus() {
192 public void setStatus(String status) {
193 this.status = status;
196 public String getIkePolicyID() {
200 public void setIkePolicyID(String ikePolicyID) {
201 this.ikePolicyID = ikePolicyID;
204 public String getIpsecPolicyID() {
205 return ipsecPolicyID;
208 public void setIpsecPolicyID(String ipsecPolicyID) {
209 this.ipsecPolicyID = ipsecPolicyID;
212 public String getVpnServiceID() {
216 public void setVpnServiceID(String vpnServiceID) {
217 this.vpnServiceID = vpnServiceID;
220 public NeutronVPNDeadPeerDetection getDeadPeerDetection() {
221 return deadPeerDetection;
224 public void setDeadPeerDetection(NeutronVPNDeadPeerDetection deadPeerDetection) {
225 this.deadPeerDetection = deadPeerDetection;
229 * This method copies selected fields from the object and returns them as a
230 * new object, suitable for marshaling.
233 * List of attributes to be extracted
234 * @return a NeutronVPNIPSECSiteConnection object with only the selected
238 public NeutronVPNIPSECSiteConnection extractFields(List<String> fields) {
239 NeutronVPNIPSECSiteConnection ans = new NeutronVPNIPSECSiteConnection();
240 Iterator<String> i = fields.iterator();
241 while (i.hasNext()) {
243 if (s.equals("id")) {
244 ans.setID(this.getID());
246 if (s.equals("tenant_id")) {
247 ans.setTenantID(this.getTenantID());
249 if (s.equals("name")) {
250 ans.setName(this.getName());
252 if (s.equals("description")) {
253 ans.setDescription(this.getDescription());
255 if (s.equals("peer_address")) {
256 ans.setPeerAddress(this.getPeerAddress());
258 if (s.equals("peer_id")) {
259 ans.setPeerID(this.getPeerID());
261 if (s.equals("route_mode")) {
262 ans.setRouteMode(this.getRouteMode());
264 if (s.equals("mtu")) {
265 ans.setMtu(this.getMtu());
267 if (s.equals("auth_mode")) {
268 ans.setAuthMode(this.getAuthMode());
270 if (s.equals("psk")) {
271 ans.setPreSharedKey(this.getPreSharedKey());
273 if (s.equals("initiator")) {
274 ans.setInitiator(this.getInitiator());
276 if (s.equals("admin_state_up")) {
277 ans.setAdminStateUp(this.getAdminStateUp());
279 if (s.equals("status")) {
280 ans.setStatus(this.getStatus());
282 if (s.equals("ikepolicy_id")) {
283 ans.setIkePolicyID(this.getIkePolicyID());
285 if (s.equals("ipsecpolicy_id")) {
286 ans.setIpsecPolicyID(this.getIpsecPolicyID());
288 if (s.equals("vpnservice_id")) {
289 ans.setVpnServiceID(this.getVpnServiceID());
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 + '\'' + '}';