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.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;
19 @XmlAccessorType(XmlAccessType.NONE)
20 public final class NeutronVPNIKEPolicy extends NeutronBaseAttributes<NeutronVPNIKEPolicy> implements Serializable {
21 private static final long serialVersionUID = 1L;
23 // See OpenStack Network API v2.0 Reference for description of
24 // annotated attributes
26 @XmlElement(name = "auth_algorithm")
29 @XmlElement(name = "encryption_algorithm")
30 String encryptionAlgorithm;
32 @XmlElement(name = "phase1_negotiation_mode")
33 String phase1NegotiationMode;
35 @XmlElement(name = "pfs")
36 String perfectForwardSecrecy;
38 @XmlElement(name = "ike_version")
41 @XmlElement(name = "lifetime")
42 NeutronVPNLifetime lifetime;
44 public NeutronVPNIKEPolicy() {
47 public String getAuthAlgorithm() {
51 public void setAuthAlgorithm(String authAlgorithm) {
52 this.authAlgorithm = authAlgorithm;
55 public String getEncryptionAlgorithm() {
56 return encryptionAlgorithm;
59 public void setEncryptionAlgorithm(String encryptionAlgorithm) {
60 this.encryptionAlgorithm = encryptionAlgorithm;
63 public String getPhase1NegotiationMode() {
64 return phase1NegotiationMode;
67 public void setPhase1NegotiationMode(String phase1NegotiationMode) {
68 this.phase1NegotiationMode = phase1NegotiationMode;
71 public String getPerfectForwardSecrecy() {
72 return perfectForwardSecrecy;
75 public void setPerfectForwardSecrecy(String perfectForwardSecrecy) {
76 this.perfectForwardSecrecy = perfectForwardSecrecy;
79 public String getIkeVersion() {
83 public void setIkeVersion(String ikeVersion) {
84 this.ikeVersion = ikeVersion;
87 public NeutronVPNLifetime getLifetime() {
91 public void setLifetime(NeutronVPNLifetime lifetime) {
92 this.lifetime = lifetime;
96 * This method copies selected fields from the object and returns them
97 * as a new object, suitable for marshaling.
100 * List of attributes to be extracted
101 * @return a NeutronVPNIKEPolicy object with only the selected fields
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());
111 if (s.equals("encryption_algorithm")) {
112 ans.setEncryptionAlgorithm(this.getEncryptionAlgorithm());
114 if (s.equals("phase1_negotiation_mode")) {
115 ans.setPhase1NegotiationMode(this.getPhase1NegotiationMode());
117 if (s.equals("pfs")) {
118 ans.setPerfectForwardSecrecy(this.getPerfectForwardSecrecy());
120 if (s.equals("ike_version")) {
121 ans.setIkeVersion(this.getIkeVersion());