/*
- * Copyright IBM Corporation, 2015. All rights reserved.
+ * Copyright (c) 2015 IBM Corporation and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
package org.opendaylight.neutron.spi;
import java.io.Serializable;
-
+import java.util.Iterator;
+import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-public class NeutronVPNIKEPolicy implements Serializable, INeutronObject {
+public class NeutronVPNIKEPolicy extends NeutronObject<NeutronVPNIKEPolicy>
+ implements Serializable, INeutronObject<NeutronVPNIKEPolicy> {
private static final long serialVersionUID = 1L;
// See OpenStack Network API v2.0 Reference for description of
// annotated attributes
- @XmlElement (name = "id")
- String id;
-
- @XmlElement (name = "tenant_id")
- String tenantID;
-
- @XmlElement (name = "name")
+ @XmlElement(name = "name")
String name;
- @XmlElement (name = "description")
- String description;
-
- @XmlElement (name = "auth_algorithm")
+ @XmlElement(name = "auth_algorithm")
String authAlgorithm;
- @XmlElement (name = "encryption_algorithm")
+ @XmlElement(name = "encryption_algorithm")
String encryptionAlgorithm;
- @XmlElement (name = "phase1_negotiation_mode")
+ @XmlElement(name = "phase1_negotiation_mode")
String phase1NegotiationMode;
- @XmlElement (name = "pfs")
+ @XmlElement(name = "pfs")
String perfectForwardSecrecy;
- @XmlElement (name = "ike_version")
+ @XmlElement(name = "ike_version")
String ikeVersion;
- @XmlElement (name = "lifetime")
+ @XmlElement(name = "lifetime")
NeutronVPNLifetime lifetime;
public NeutronVPNIKEPolicy() {
}
- public String getID() {
- return id;
- }
-
- public void setID(String id) {
- this.id = id;
- }
-
- public String getTenantID() {
- return tenantID;
- }
-
- public void setTenantID(String tenantID) {
- this.tenantID = tenantID;
- }
-
public String getName() {
return name;
}
this.name = name;
}
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
public String getAuthAlgorithm() {
return authAlgorithm;
}
this.lifetime = lifetime;
}
+ /**
+ * This method copies selected fields from the object and returns them
+ * as a new object, suitable for marshaling.
+ *
+ * @param fields
+ * List of attributes to be extracted
+ * @return a NeutronVPNIKEPolicy object with only the selected fields
+ * populated
+ */
+ public NeutronVPNIKEPolicy extractFields(List<String> fields) {
+ NeutronVPNIKEPolicy ans = new NeutronVPNIKEPolicy();
+ Iterator<String> i = fields.iterator();
+ while (i.hasNext()) {
+ String s = i.next();
+ if (s.equals("id")) {
+ ans.setID(this.getID());
+ }
+ if (s.equals("name")) {
+ ans.setName(this.getName());
+ }
+ if (s.equals("tenant_id")) {
+ ans.setTenantID(this.getTenantID());
+ }
+ if (s.equals("auth_algorithm")) {
+ ans.setAuthAlgorithm(this.getAuthAlgorithm());
+ }
+ if (s.equals("encryption_algorithm")) {
+ ans.setEncryptionAlgorithm(this.getEncryptionAlgorithm());
+ }
+ if (s.equals("phase1_negotiation_mode")) {
+ ans.setPhase1NegotiationMode(this.getPhase1NegotiationMode());
+ }
+ if (s.equals("pfs")) {
+ ans.setPerfectForwardSecrecy(this.getPerfectForwardSecrecy());
+ }
+ if (s.equals("ike_version")) {
+ ans.setIkeVersion(this.getIkeVersion());
+ }
+ }
+ return ans;
+ }
}