307aa2459e372c10e009686a195a086b4727d00b
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronVpnIkePolicy.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 NeutronVpnIkePolicy extends NeutronBaseAttributes<NeutronVpnIkePolicy> 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 = "auth_algorithm")
26     String authAlgorithm;
27
28     @XmlElement(name = "encryption_algorithm")
29     String encryptionAlgorithm;
30
31     @XmlElement(name = "phase1_negotiation_mode")
32     String phase1NegotiationMode;
33
34     @XmlElement(name = "pfs")
35     String perfectForwardSecrecy;
36
37     @XmlElement(name = "ike_version")
38     String ikeVersion;
39
40     @XmlElement(name = "lifetime")
41     NeutronVpnLifetime lifetime;
42
43     public NeutronVpnIkePolicy() {
44     }
45
46     public String getAuthAlgorithm() {
47         return authAlgorithm;
48     }
49
50     public void setAuthAlgorithm(String authAlgorithm) {
51         this.authAlgorithm = authAlgorithm;
52     }
53
54     public String getEncryptionAlgorithm() {
55         return encryptionAlgorithm;
56     }
57
58     public void setEncryptionAlgorithm(String encryptionAlgorithm) {
59         this.encryptionAlgorithm = encryptionAlgorithm;
60     }
61
62     public String getPhase1NegotiationMode() {
63         return phase1NegotiationMode;
64     }
65
66     public void setPhase1NegotiationMode(String phase1NegotiationMode) {
67         this.phase1NegotiationMode = phase1NegotiationMode;
68     }
69
70     public String getPerfectForwardSecrecy() {
71         return perfectForwardSecrecy;
72     }
73
74     public void setPerfectForwardSecrecy(String perfectForwardSecrecy) {
75         this.perfectForwardSecrecy = perfectForwardSecrecy;
76     }
77
78     public String getIkeVersion() {
79         return ikeVersion;
80     }
81
82     public void setIkeVersion(String ikeVersion) {
83         this.ikeVersion = ikeVersion;
84     }
85
86     public NeutronVpnLifetime getLifetime() {
87         return lifetime;
88     }
89
90     public void setLifetime(NeutronVpnLifetime lifetime) {
91         this.lifetime = lifetime;
92     }
93
94     @Override
95     protected boolean extractField(String field, NeutronVpnIkePolicy ans) {
96         switch (field) {
97             case "auth_algorithm":
98                 ans.setAuthAlgorithm(this.getAuthAlgorithm());
99                 break;
100             case "encryption_algorithm":
101                 ans.setEncryptionAlgorithm(this.getEncryptionAlgorithm());
102                 break;
103             case "phase1_negotiation_mode":
104                 ans.setPhase1NegotiationMode(this.getPhase1NegotiationMode());
105                 break;
106             case "pfs":
107                 ans.setPerfectForwardSecrecy(this.getPerfectForwardSecrecy());
108                 break;
109             case "ike_version":
110                 ans.setIkeVersion(this.getIkeVersion());
111                 break;
112             default:
113                 return super.extractField(field, ans);
114         }
115         return true;
116     }
117 }