0589f7ff3d366553fb9efc647dbcbf6be2fa5aae
[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 import java.util.List;
13 import javax.xml.bind.annotation.XmlAccessType;
14 import javax.xml.bind.annotation.XmlAccessorType;
15 import javax.xml.bind.annotation.XmlElement;
16 import javax.xml.bind.annotation.XmlRootElement;
17
18 @XmlRootElement
19 @XmlAccessorType(XmlAccessType.NONE)
20 public final class NeutronVPNIPSECPolicy extends NeutronBaseAttributes<NeutronVPNIPSECPolicy> implements Serializable {
21     private static final long serialVersionUID = 1L;
22
23     // See OpenStack Network API v2.0 Reference for description of
24     // annotated attributes
25
26     @XmlElement(name = "transform_protocol")
27     String transformProtocol;
28
29     @XmlElement(name = "encapsulation_mode")
30     String encapsulationMode;
31
32     @XmlElement(name = "auth_algorithm")
33     String authAlgorithm;
34
35     @XmlElement(name = "encryption_algorithm")
36     String encryptionAlgorithm;
37
38     @XmlElement(name = "pfs")
39     String perfectForwardSecrecy;
40
41     @XmlElement(name = "lifetime")
42     NeutronVPNLifetime lifetime;
43
44     public NeutronVPNIPSECPolicy() {
45     }
46
47     public String getTransformProtocol() {
48         return transformProtocol;
49     }
50
51     public void setTransformProtocol(String transformProtocol) {
52         this.transformProtocol = transformProtocol;
53     }
54
55     public String getEncapsulationMode() {
56         return encapsulationMode;
57     }
58
59     public void setEncapsulationMode(String encapsulationMode) {
60         this.encapsulationMode = encapsulationMode;
61     }
62
63     public String getAuthAlgorithm() {
64         return authAlgorithm;
65     }
66
67     public void setAuthAlgorithm(String authAlgorithm) {
68         this.authAlgorithm = authAlgorithm;
69     }
70
71     public String getEncryptionAlgorithm() {
72         return encryptionAlgorithm;
73     }
74
75     public void setEncryptionAlgorithm(String encryptionAlgorithm) {
76         this.encryptionAlgorithm = encryptionAlgorithm;
77     }
78
79     public String getPerfectForwardSecrecy() {
80         return perfectForwardSecrecy;
81     }
82
83     public void setPerfectForwardSecrecy(String perfectForwardSecrecy) {
84         this.perfectForwardSecrecy = perfectForwardSecrecy;
85     }
86
87     public NeutronVPNLifetime getLifetime() {
88         return lifetime;
89     }
90
91     public void setLifetime(NeutronVPNLifetime lifetime) {
92         this.lifetime = lifetime;
93     }
94
95     /**
96      * This method copies selected fields from the object and returns them
97      * as a new object, suitable for marshaling.
98      *
99      * @param fields
100      *            List of attributes to be extracted
101      * @return a NeutronVPNIPSECPolicy object with only the selected fields
102      * populated
103      */
104     public NeutronVPNIPSECPolicy extractFields(List<String> fields) {
105         NeutronVPNIPSECPolicy ans = new NeutronVPNIPSECPolicy();
106         for (String s : fields) {
107             extractField(s, ans);
108             if (s.equals("transform_protocol")) {
109                 ans.setTransformProtocol(this.getTransformProtocol());
110             }
111             if (s.equals("encapsulation_mode")) {
112                 ans.setEncapsulationMode(this.getEncapsulationMode());
113             }
114             if (s.equals("auth_algorithm")) {
115                 ans.setAuthAlgorithm(this.getAuthAlgorithm());
116             }
117             if (s.equals("encryption_algorithm")) {
118                 ans.setEncryptionAlgorithm(this.getEncryptionAlgorithm());
119             }
120             if (s.equals("pfs")) {
121                 ans.setPerfectForwardSecrecy(this.getPerfectForwardSecrecy());
122             }
123         }
124         return ans;
125     }
126
127 }