458300f80cabe3a6eb65a9a3370fffef51a8f4fc
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronVpnService.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 import javax.xml.bind.annotation.XmlAccessType;
13 import javax.xml.bind.annotation.XmlAccessorType;
14 import javax.xml.bind.annotation.XmlElement;
15 import javax.xml.bind.annotation.XmlRootElement;
16
17 @XmlRootElement
18 @XmlAccessorType(XmlAccessType.NONE)
19 public final class NeutronVpnService extends NeutronAdminAttributes<NeutronVpnService> implements Serializable {
20     private static final long serialVersionUID = 1L;
21
22     // See OpenStack Network API v2.0 Reference for description of
23     // annotated attributes
24
25     @XmlElement(name = "router_id")
26     String routerUUID;
27
28     @XmlElement(name = "subnet_id")
29     String subnetUUID;
30
31     public NeutronVpnService() {
32     }
33
34     public String getRouterUUID() {
35         return routerUUID;
36     }
37
38     public void setRouterUUID(String routerUUID) {
39         this.routerUUID = routerUUID;
40     }
41
42     public String getSubnetUUID() {
43         return subnetUUID;
44     }
45
46     public void setSubnetUUID(String subnetUUID) {
47         this.subnetUUID = subnetUUID;
48     }
49
50     @Override
51     protected boolean extractField(String field, NeutronVpnService ans) {
52         switch (field) {
53             case "router_id":
54                 ans.setRouterUUID(this.getRouterUUID());
55                 break;
56             case "subnet_id":
57                 ans.setSubnetUUID(this.getSubnetUUID());
58                 break;
59             default:
60                 return super.extractField(field, ans);
61         }
62         return true;
63     }
64 }