L2gateway: Added yang, APIs,Transcriber for L2gateway.
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronVPNIPSECPolicy.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 NeutronVPNIPSECPolicy extends NeutronObject 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 = "name")
30     String name;
31
32     @XmlElement (name = "description")
33     String description;
34
35     @XmlElement (name = "transform_protocol")
36     String transformProtocol;
37
38     @XmlElement (name = "encapsulation_mode")
39     String encapsulationMode;
40
41     @XmlElement (name = "auth_algorithm")
42     String authAlgorithm;
43
44     @XmlElement (name = "encryption_algorithm")
45     String encryptionAlgorithm;
46
47     @XmlElement (name = "pfs")
48     String perfectForwardSecrecy;
49
50     @XmlElement (name = "lifetime")
51     NeutronVPNLifetime lifetime;
52
53     public NeutronVPNIPSECPolicy() {
54     }
55
56     public String getName() {
57         return name;
58     }
59
60     public void setName(String name) {
61         this.name = name;
62     }
63
64     public String getDescription() {
65         return description;
66     }
67
68     public void setDescription(String description) {
69         this.description = description;
70     }
71
72     public String getTransformProtocol() {
73         return transformProtocol;
74     }
75
76     public void setTransformProtocol(String transformProtocol) {
77         this.transformProtocol = transformProtocol;
78     }
79
80     public String getEncapsulationMode() {
81         return encapsulationMode;
82     }
83
84     public void setEncapsulationMode(String encapsulationMode) {
85         this.encapsulationMode = encapsulationMode;
86     }
87
88     public String getAuthAlgorithm() {
89         return authAlgorithm;
90     }
91
92     public void setAuthAlgorithm(String authAlgorithm) {
93         this.authAlgorithm = authAlgorithm;
94     }
95
96     public String getEncryptionAlgorithm() {
97         return encryptionAlgorithm;
98     }
99
100     public void setEncryptionAlgorithm(String encryptionAlgorithm) {
101         this.encryptionAlgorithm = encryptionAlgorithm;
102     }
103
104     public String getPerfectForwardSecrecy() {
105         return perfectForwardSecrecy;
106     }
107
108     public void setPerfectForwardSecrecy(String perfectForwardSecrecy) {
109         this.perfectForwardSecrecy = perfectForwardSecrecy;
110     }
111
112     public NeutronVPNLifetime getLifetime() {
113         return lifetime;
114     }
115
116     public void setLifetime(NeutronVPNLifetime lifetime) {
117         this.lifetime = lifetime;
118     }
119
120     /**
121      * This method copies selected fields from the object and returns them
122      * as a new object, suitable for marshaling.
123      *
124      * @param fields
125      *            List of attributes to be extracted
126      * @return a NeutronVPNIPSECPolicy object with only the selected fields
127      * populated
128      */
129     public NeutronVPNIPSECPolicy extractFields(List<String> fields) {
130         NeutronVPNIPSECPolicy ans = new NeutronVPNIPSECPolicy();
131         Iterator<String> i = fields.iterator();
132         while (i.hasNext()) {
133             String s = i.next();
134             if (s.equals("id")) {
135                 ans.setID(this.getID());
136             }
137             if (s.equals("tenant_id")) {
138                 ans.setTenantID(this.getTenantID());
139             }
140             if (s.equals("name")) {
141                 ans.setName(this.getName());
142             }
143             if (s.equals("description")) {
144                 ans.setDescription(this.getDescription());
145             }
146             if (s.equals("transform_protocol")) {
147                 ans.setTransformProtocol(this.getTransformProtocol());
148             }
149             if (s.equals("encapsulation_mode")) {
150                 ans.setEncapsulationMode(this.getEncapsulationMode());
151             }
152             if (s.equals("auth_algorithm")) {
153                 ans.setAuthAlgorithm(this.getAuthAlgorithm());
154             }
155             if (s.equals("encryption_algorithm")) {
156                 ans.setEncryptionAlgorithm(this.getEncryptionAlgorithm());
157             }
158             if (s.equals("pfs")) {
159                 ans.setPerfectForwardSecrecy(this.getPerfectForwardSecrecy());
160             }
161         }
162         return ans;
163     }
164
165 }