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;
13 import java.util.Iterator;
14 import java.util.List;
16 import javax.xml.bind.annotation.XmlAccessType;
17 import javax.xml.bind.annotation.XmlAccessorType;
18 import javax.xml.bind.annotation.XmlElement;
19 import javax.xml.bind.annotation.XmlRootElement;
22 @XmlAccessorType(XmlAccessType.NONE)
23 public class NeutronVPNIPSECPolicy extends NeutronObject implements Serializable, INeutronObject {
24 private static final long serialVersionUID = 1L;
26 // See OpenStack Network API v2.0 Reference for description of
27 // annotated attributes
29 @XmlElement (name = "name")
32 @XmlElement (name = "description")
35 @XmlElement (name = "transform_protocol")
36 String transformProtocol;
38 @XmlElement (name = "encapsulation_mode")
39 String encapsulationMode;
41 @XmlElement (name = "auth_algorithm")
44 @XmlElement (name = "encryption_algorithm")
45 String encryptionAlgorithm;
47 @XmlElement (name = "pfs")
48 String perfectForwardSecrecy;
50 @XmlElement (name = "lifetime")
51 NeutronVPNLifetime lifetime;
53 public NeutronVPNIPSECPolicy() {
56 public String getName() {
60 public void setName(String name) {
64 public String getDescription() {
68 public void setDescription(String description) {
69 this.description = description;
72 public String getTransformProtocol() {
73 return transformProtocol;
76 public void setTransformProtocol(String transformProtocol) {
77 this.transformProtocol = transformProtocol;
80 public String getEncapsulationMode() {
81 return encapsulationMode;
84 public void setEncapsulationMode(String encapsulationMode) {
85 this.encapsulationMode = encapsulationMode;
88 public String getAuthAlgorithm() {
92 public void setAuthAlgorithm(String authAlgorithm) {
93 this.authAlgorithm = authAlgorithm;
96 public String getEncryptionAlgorithm() {
97 return encryptionAlgorithm;
100 public void setEncryptionAlgorithm(String encryptionAlgorithm) {
101 this.encryptionAlgorithm = encryptionAlgorithm;
104 public String getPerfectForwardSecrecy() {
105 return perfectForwardSecrecy;
108 public void setPerfectForwardSecrecy(String perfectForwardSecrecy) {
109 this.perfectForwardSecrecy = perfectForwardSecrecy;
112 public NeutronVPNLifetime getLifetime() {
116 public void setLifetime(NeutronVPNLifetime lifetime) {
117 this.lifetime = lifetime;
121 * This method copies selected fields from the object and returns them
122 * as a new object, suitable for marshaling.
125 * List of attributes to be extracted
126 * @return a NeutronVPNIPSECPolicy object with only the selected fields
129 public NeutronVPNIPSECPolicy extractFields(List<String> fields) {
130 NeutronVPNIPSECPolicy ans = new NeutronVPNIPSECPolicy();
131 Iterator<String> i = fields.iterator();
132 while (i.hasNext()) {
134 if (s.equals("id")) {
135 ans.setID(this.getID());
137 if (s.equals("tenant_id")) {
138 ans.setTenantID(this.getTenantID());
140 if (s.equals("name")) {
141 ans.setName(this.getName());
143 if (s.equals("description")) {
144 ans.setDescription(this.getDescription());
146 if (s.equals("transform_protocol")) {
147 ans.setTransformProtocol(this.getTransformProtocol());
149 if (s.equals("encapsulation_mode")) {
150 ans.setEncapsulationMode(this.getEncapsulationMode());
152 if (s.equals("auth_algorithm")) {
153 ans.setAuthAlgorithm(this.getAuthAlgorithm());
155 if (s.equals("encryption_algorithm")) {
156 ans.setEncryptionAlgorithm(this.getEncryptionAlgorithm());
158 if (s.equals("pfs")) {
159 ans.setPerfectForwardSecrecy(this.getPerfectForwardSecrecy());