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 NeutronVpnIpSecPolicy extends NeutronBaseAttributes<NeutronVpnIpSecPolicy> implements Serializable {
23 private static final Logger LOGGER = LoggerFactory.getLogger(NeutronVpnIpSecPolicy.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 = "transform_protocol")
30 String transformProtocol;
32 @XmlElement(name = "encapsulation_mode")
33 String encapsulationMode;
35 @XmlElement(name = "auth_algorithm")
38 @XmlElement(name = "encryption_algorithm")
39 String encryptionAlgorithm;
41 @XmlElement(name = "pfs")
42 String perfectForwardSecrecy;
44 @XmlElement(name = "lifetime")
45 NeutronVpnLifetime lifetime;
47 public NeutronVpnIpSecPolicy() {
50 public String getTransformProtocol() {
51 return transformProtocol;
54 public void setTransformProtocol(String transformProtocol) {
55 this.transformProtocol = transformProtocol;
58 public String getEncapsulationMode() {
59 return encapsulationMode;
62 public void setEncapsulationMode(String encapsulationMode) {
63 this.encapsulationMode = encapsulationMode;
66 public String getAuthAlgorithm() {
70 public void setAuthAlgorithm(String authAlgorithm) {
71 this.authAlgorithm = authAlgorithm;
74 public String getEncryptionAlgorithm() {
75 return encryptionAlgorithm;
78 public void setEncryptionAlgorithm(String encryptionAlgorithm) {
79 this.encryptionAlgorithm = encryptionAlgorithm;
82 public String getPerfectForwardSecrecy() {
83 return perfectForwardSecrecy;
86 public void setPerfectForwardSecrecy(String perfectForwardSecrecy) {
87 this.perfectForwardSecrecy = perfectForwardSecrecy;
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 NeutronVpnIpSecPolicy object with only the selected fields
107 public NeutronVpnIpSecPolicy extractFields(List<String> fields) {
108 NeutronVpnIpSecPolicy ans = new NeutronVpnIpSecPolicy();
109 for (String s : fields) {
110 if (extractField(s, ans)) {
114 case "transform_protocol":
115 ans.setTransformProtocol(this.getTransformProtocol());
117 case "encapsulation_mode":
118 ans.setEncapsulationMode(this.getEncapsulationMode());
120 case "auth_algorithm":
121 ans.setAuthAlgorithm(this.getAuthAlgorithm());
123 case "encryption_algorithm":
124 ans.setEncryptionAlgorithm(this.getEncryptionAlgorithm());
127 ans.setPerfectForwardSecrecy(this.getPerfectForwardSecrecy());
130 LOGGER.warn("{} is not an NeutronVpnIpSecPolicy suitable field.", s);