From: Wojciech Dec Date: Fri, 6 Feb 2015 10:00:23 +0000 (+0100) Subject: Bug 2684 - Fixing support for Neutron binding extended attributes X-Git-Tag: release/lithium~587^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=d654b9364bad5796d43013e19cdfeda0e70c8bf7 Bug 2684 - Fixing support for Neutron binding extended attributes Change-Id: If2a309af55555253d508428d47b25c1b1d4ea796 Signed-off-by: Wojciech Dec --- diff --git a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNorthboundRSApplication.java b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNorthboundRSApplication.java index 96d72cb926..052d3dc2dd 100644 --- a/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNorthboundRSApplication.java +++ b/opendaylight/networkconfiguration/neutron/northbound/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronNorthboundRSApplication.java @@ -43,6 +43,7 @@ public class NeutronNorthboundRSApplication extends Application { classes.add(NeutronLoadBalancerPoolNorthbound.class); classes.add(NeutronLoadBalancerHealthMonitorNorthbound.class); classes.add(NeutronLoadBalancerPoolMembersNorthbound.class); + classes.add(MOXyJsonProvider.class); return classes; } @@ -56,9 +57,10 @@ public class NeutronNorthboundRSApplication extends Application { moxyJsonProvider.setMarshalEmptyCollections(true); moxyJsonProvider.setValueWrapper("$"); - Map namespacePrefixMapper = new HashMap(1); + Map namespacePrefixMapper = new HashMap(3); namespacePrefixMapper.put("router", "router"); // FIXME: fill in with XSD namespacePrefixMapper.put("provider", "provider"); // FIXME: fill in with XSD + namespacePrefixMapper.put("binding", "binding"); moxyJsonProvider.setNamespacePrefixMapper(namespacePrefixMapper); moxyJsonProvider.setNamespaceSeparator(':'); diff --git a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronPort.java b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronPort.java index a529599a4c..3853988353 100644 --- a/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronPort.java +++ b/opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/NeutronPort.java @@ -8,6 +8,7 @@ package org.opendaylight.controller.networkconfig.neutron; + import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; @@ -62,6 +63,16 @@ public class NeutronPort implements Serializable, INeutronObject { @XmlElement (name="security_groups") List securityGroups; + @XmlElement (namespace= "binding", name="host_id") + String bindinghostID; + + @XmlElement (namespace= "binding", name="vnic_type") + String bindingvnicType; + + @XmlElement (namespace= "binding", name="vif_type") + String bindingvifType; + + /* this attribute stores the floating IP address assigned to * each fixed IP address */ @@ -169,6 +180,30 @@ public class NeutronPort implements Serializable, INeutronObject { this.securityGroups = securityGroups; } + public String getBindinghostID() { + return bindinghostID; + } + + public void setBindinghostID(String bindinghostID) { + this.bindinghostID = bindinghostID; + } + + public String getBindingvnicType() { + return bindingvnicType; + } + + public void setBindingvnicType(String bindingvnicType) { + this.bindingvnicType = bindingvnicType; + } + + public String getBindingvifType() { + return bindingvifType; + } + + public void setBindingvifType(String bindingvifType) { + this.bindingvifType = bindingvifType; + } + public NeutronFloatingIP getFloatingIP(String key) { if (!floatingIPMap.containsKey(key)) { return null; @@ -271,6 +306,8 @@ public class NeutronPort implements Serializable, INeutronObject { return "NeutronPort [portUUID=" + portUUID + ", networkUUID=" + networkUUID + ", name=" + name + ", adminStateUp=" + adminStateUp + ", status=" + status + ", macAddress=" + macAddress + ", fixedIPs=" + fixedIPs + ", deviceID=" + deviceID + ", deviceOwner=" + deviceOwner + ", tenantID=" - + tenantID + ", floatingIPMap=" + floatingIPMap + ", securityGroups=" + securityGroups + "]"; + + tenantID + ", floatingIPMap=" + floatingIPMap + ", securityGroups=" + securityGroups + + ", bindinghostID=" + bindinghostID + ", bindingvnicType=" + bindingvnicType + + ", bindingvnicType=" + bindingvnicType + "]"; } }