checkstyle: enable JavadocTagContinuationIndentation
[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 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 NeutronVPNIKEPolicy extends NeutronBaseAttributes<NeutronVPNIKEPolicy> 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 = "auth_algorithm")
27     String authAlgorithm;
28
29     @XmlElement(name = "encryption_algorithm")
30     String encryptionAlgorithm;
31
32     @XmlElement(name = "phase1_negotiation_mode")
33     String phase1NegotiationMode;
34
35     @XmlElement(name = "pfs")
36     String perfectForwardSecrecy;
37
38     @XmlElement(name = "ike_version")
39     String ikeVersion;
40
41     @XmlElement(name = "lifetime")
42     NeutronVPNLifetime lifetime;
43
44     public NeutronVPNIKEPolicy() {
45     }
46
47     public String getAuthAlgorithm() {
48         return authAlgorithm;
49     }
50
51     public void setAuthAlgorithm(String authAlgorithm) {
52         this.authAlgorithm = authAlgorithm;
53     }
54
55     public String getEncryptionAlgorithm() {
56         return encryptionAlgorithm;
57     }
58
59     public void setEncryptionAlgorithm(String encryptionAlgorithm) {
60         this.encryptionAlgorithm = encryptionAlgorithm;
61     }
62
63     public String getPhase1NegotiationMode() {
64         return phase1NegotiationMode;
65     }
66
67     public void setPhase1NegotiationMode(String phase1NegotiationMode) {
68         this.phase1NegotiationMode = phase1NegotiationMode;
69     }
70
71     public String getPerfectForwardSecrecy() {
72         return perfectForwardSecrecy;
73     }
74
75     public void setPerfectForwardSecrecy(String perfectForwardSecrecy) {
76         this.perfectForwardSecrecy = perfectForwardSecrecy;
77     }
78
79     public String getIkeVersion() {
80         return ikeVersion;
81     }
82
83     public void setIkeVersion(String ikeVersion) {
84         this.ikeVersion = ikeVersion;
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 NeutronVPNIKEPolicy object with only the selected fields
102      *             populated
103      */
104     public NeutronVPNIKEPolicy extractFields(List<String> fields) {
105         NeutronVPNIKEPolicy ans = new NeutronVPNIKEPolicy();
106         for (String s : fields) {
107             extractField(s, ans);
108             if (s.equals("auth_algorithm")) {
109                 ans.setAuthAlgorithm(this.getAuthAlgorithm());
110             }
111             if (s.equals("encryption_algorithm")) {
112                 ans.setEncryptionAlgorithm(this.getEncryptionAlgorithm());
113             }
114             if (s.equals("phase1_negotiation_mode")) {
115                 ans.setPhase1NegotiationMode(this.getPhase1NegotiationMode());
116             }
117             if (s.equals("pfs")) {
118                 ans.setPerfectForwardSecrecy(this.getPerfectForwardSecrecy());
119             }
120             if (s.equals("ike_version")) {
121                 ans.setIkeVersion(this.getIkeVersion());
122             }
123         }
124         return ans;
125     }
126 }