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;
17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory;
21 @XmlAccessorType(XmlAccessType.NONE)
22 public final class NeutronVpnIkePolicy extends NeutronBaseAttributes<NeutronVpnIkePolicy> implements Serializable {
23 private static final Logger LOGGER = LoggerFactory.getLogger(NeutronVpnIkePolicy.class);
24 private static final long serialVersionUID = 1L;
26 // See OpenStack Network API v2.0 Reference for description of
27 // annotated attributes
29 @XmlElement(name = "auth_algorithm")
32 @XmlElement(name = "encryption_algorithm")
33 String encryptionAlgorithm;
35 @XmlElement(name = "phase1_negotiation_mode")
36 String phase1NegotiationMode;
38 @XmlElement(name = "pfs")
39 String perfectForwardSecrecy;
41 @XmlElement(name = "ike_version")
44 @XmlElement(name = "lifetime")
45 NeutronVpnLifetime lifetime;
47 public NeutronVpnIkePolicy() {
50 public String getAuthAlgorithm() {
54 public void setAuthAlgorithm(String authAlgorithm) {
55 this.authAlgorithm = authAlgorithm;
58 public String getEncryptionAlgorithm() {
59 return encryptionAlgorithm;
62 public void setEncryptionAlgorithm(String encryptionAlgorithm) {
63 this.encryptionAlgorithm = encryptionAlgorithm;
66 public String getPhase1NegotiationMode() {
67 return phase1NegotiationMode;
70 public void setPhase1NegotiationMode(String phase1NegotiationMode) {
71 this.phase1NegotiationMode = phase1NegotiationMode;
74 public String getPerfectForwardSecrecy() {
75 return perfectForwardSecrecy;
78 public void setPerfectForwardSecrecy(String perfectForwardSecrecy) {
79 this.perfectForwardSecrecy = perfectForwardSecrecy;
82 public String getIkeVersion() {
86 public void setIkeVersion(String ikeVersion) {
87 this.ikeVersion = ikeVersion;
90 public NeutronVpnLifetime getLifetime() {
94 public void setLifetime(NeutronVpnLifetime lifetime) {
95 this.lifetime = lifetime;
99 * This method copies selected fields from the object and returns them
100 * as a new object, suitable for marshaling.
103 * List of attributes to be extracted
104 * @return a NeutronVpnIkePolicy object with only the selected fields
107 public NeutronVpnIkePolicy extractFields(List<String> fields) {
108 NeutronVpnIkePolicy ans = new NeutronVpnIkePolicy();
109 for (String s : fields) {
110 if (extractField(s, ans)) {
114 case "auth_algorithm":
115 ans.setAuthAlgorithm(this.getAuthAlgorithm());
117 case "encryption_algorithm":
118 ans.setEncryptionAlgorithm(this.getEncryptionAlgorithm());
120 case "phase1_negotiation_mode":
121 ans.setPhase1NegotiationMode(this.getPhase1NegotiationMode());
124 ans.setPerfectForwardSecrecy(this.getPerfectForwardSecrecy());
127 ans.setIkeVersion(this.getIkeVersion());
130 LOGGER.warn("{} is not an NeutronVpnIkePolicy suitable field.", s);