2 * Copyright (c) 2015 IBM Corporation and others. All rights reserved.
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
9 package org.opendaylight.neutron.spi;
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;
20 @XmlAccessorType(XmlAccessType.NONE)
21 public class NeutronVPNIKEPolicy extends NeutronObject implements Serializable, INeutronObject {
22 private static final long serialVersionUID = 1L;
24 // See OpenStack Network API v2.0 Reference for description of
25 // annotated attributes
27 @XmlElement (name = "name")
30 @XmlElement (name = "auth_algorithm")
33 @XmlElement (name = "encryption_algorithm")
34 String encryptionAlgorithm;
36 @XmlElement (name = "phase1_negotiation_mode")
37 String phase1NegotiationMode;
39 @XmlElement (name = "pfs")
40 String perfectForwardSecrecy;
42 @XmlElement (name = "ike_version")
45 @XmlElement (name = "lifetime")
46 NeutronVPNLifetime lifetime;
48 public NeutronVPNIKEPolicy() {
51 public String getName() {
55 public void setName(String name) {
59 public String getAuthAlgorithm() {
63 public void setAuthAlgorithm(String authAlgorithm) {
64 this.authAlgorithm = authAlgorithm;
67 public String getEncryptionAlgorithm() {
68 return encryptionAlgorithm;
71 public void setEncryptionAlgorithm(String encryptionAlgorithm) {
72 this.encryptionAlgorithm = encryptionAlgorithm;
75 public String getPhase1NegotiationMode() {
76 return phase1NegotiationMode;
79 public void setPhase1NegotiationMode(String phase1NegotiationMode) {
80 this.phase1NegotiationMode = phase1NegotiationMode;
83 public String getPerfectForwardSecrecy() {
84 return perfectForwardSecrecy;
87 public void setPerfectForwardSecrecy(String perfectForwardSecrecy) {
88 this.perfectForwardSecrecy = perfectForwardSecrecy;
91 public String getIkeVersion() {
95 public void setIkeVersion(String ikeVersion) {
96 this.ikeVersion = ikeVersion;
99 public NeutronVPNLifetime getLifetime() {
103 public void setLifetime(NeutronVPNLifetime lifetime) {
104 this.lifetime = lifetime;
108 * This method copies selected fields from the object and returns them
109 * as a new object, suitable for marshaling.
112 * List of attributes to be extracted
113 * @return a NeutronVPNIKEPolicy object with only the selected fields
116 public NeutronVPNIKEPolicy extractFields(List<String> fields) {
117 NeutronVPNIKEPolicy ans = new NeutronVPNIKEPolicy();
118 Iterator<String> i = fields.iterator();
119 while (i.hasNext()) {
121 if (s.equals("id")) {
122 ans.setID(this.getID());
124 if (s.equals("name")) {
125 ans.setName(this.getName());
127 if (s.equals("tenant_id")) {
128 ans.setTenantID(this.getTenantID());
130 if (s.equals("auth_algorithm")) {
131 ans.setAuthAlgorithm(this.getAuthAlgorithm());
133 if (s.equals("encryption_algorithm")) {
134 ans.setEncryptionAlgorithm(this.getEncryptionAlgorithm());
136 if (s.equals("phase1_negotiation_mode")) {
137 ans.setPhase1NegotiationMode(this.getPhase1NegotiationMode());
139 if (s.equals("pfs")) {
140 ans.setPerfectForwardSecrecy(this.getPerfectForwardSecrecy());
142 if (s.equals("ike_version")) {
143 ans.setIkeVersion(this.getIkeVersion());