Checkstyle formatting issues fix (SPI)
[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.Iterator;
13 import java.util.List;
14 import javax.xml.bind.annotation.XmlAccessType;
15 import javax.xml.bind.annotation.XmlAccessorType;
16 import javax.xml.bind.annotation.XmlElement;
17 import javax.xml.bind.annotation.XmlRootElement;
18
19 @XmlRootElement
20 @XmlAccessorType(XmlAccessType.NONE)
21 public class NeutronVPNIKEPolicy extends NeutronObject implements Serializable, INeutronObject {
22     private static final long serialVersionUID = 1L;
23
24     // See OpenStack Network API v2.0 Reference for description of
25     // annotated attributes
26
27     @XmlElement(name = "name")
28     String name;
29
30     @XmlElement(name = "auth_algorithm")
31     String authAlgorithm;
32
33     @XmlElement(name = "encryption_algorithm")
34     String encryptionAlgorithm;
35
36     @XmlElement(name = "phase1_negotiation_mode")
37     String phase1NegotiationMode;
38
39     @XmlElement(name = "pfs")
40     String perfectForwardSecrecy;
41
42     @XmlElement(name = "ike_version")
43     String ikeVersion;
44
45     @XmlElement(name = "lifetime")
46     NeutronVPNLifetime lifetime;
47
48     public NeutronVPNIKEPolicy() {
49     }
50
51     public String getName() {
52         return name;
53     }
54
55     public void setName(String name) {
56         this.name = name;
57     }
58
59     public String getAuthAlgorithm() {
60         return authAlgorithm;
61     }
62
63     public void setAuthAlgorithm(String authAlgorithm) {
64         this.authAlgorithm = authAlgorithm;
65     }
66
67     public String getEncryptionAlgorithm() {
68         return encryptionAlgorithm;
69     }
70
71     public void setEncryptionAlgorithm(String encryptionAlgorithm) {
72         this.encryptionAlgorithm = encryptionAlgorithm;
73     }
74
75     public String getPhase1NegotiationMode() {
76         return phase1NegotiationMode;
77     }
78
79     public void setPhase1NegotiationMode(String phase1NegotiationMode) {
80         this.phase1NegotiationMode = phase1NegotiationMode;
81     }
82
83     public String getPerfectForwardSecrecy() {
84         return perfectForwardSecrecy;
85     }
86
87     public void setPerfectForwardSecrecy(String perfectForwardSecrecy) {
88         this.perfectForwardSecrecy = perfectForwardSecrecy;
89     }
90
91     public String getIkeVersion() {
92         return ikeVersion;
93     }
94
95     public void setIkeVersion(String ikeVersion) {
96         this.ikeVersion = ikeVersion;
97     }
98
99     public NeutronVPNLifetime getLifetime() {
100         return lifetime;
101     }
102
103     public void setLifetime(NeutronVPNLifetime lifetime) {
104         this.lifetime = lifetime;
105     }
106
107     /**
108      * This method copies selected fields from the object and returns them
109      * as a new object, suitable for marshaling.
110      *
111      * @param fields
112      *            List of attributes to be extracted
113      * @return a NeutronVPNIKEPolicy object with only the selected fields
114      * populated
115      */
116     public NeutronVPNIKEPolicy extractFields(List<String> fields) {
117         NeutronVPNIKEPolicy ans = new NeutronVPNIKEPolicy();
118         Iterator<String> i = fields.iterator();
119         while (i.hasNext()) {
120             String s = i.next();
121             if (s.equals("id")) {
122                 ans.setID(this.getID());
123             }
124             if (s.equals("name")) {
125                 ans.setName(this.getName());
126             }
127             if (s.equals("tenant_id")) {
128                 ans.setTenantID(this.getTenantID());
129             }
130             if (s.equals("auth_algorithm")) {
131                 ans.setAuthAlgorithm(this.getAuthAlgorithm());
132             }
133             if (s.equals("encryption_algorithm")) {
134                 ans.setEncryptionAlgorithm(this.getEncryptionAlgorithm());
135             }
136             if (s.equals("phase1_negotiation_mode")) {
137                 ans.setPhase1NegotiationMode(this.getPhase1NegotiationMode());
138             }
139             if (s.equals("pfs")) {
140                 ans.setPerfectForwardSecrecy(this.getPerfectForwardSecrecy());
141             }
142             if (s.equals("ike_version")) {
143                 ans.setIkeVersion(this.getIkeVersion());
144             }
145         }
146         return ans;
147     }
148 }