Align BGPVPN code with merged changes 18/28218/1
authorRyan Moats <rmoats@us.ibm.com>
Fri, 9 Oct 2015 16:35:03 +0000 (11:35 -0500)
committerRyan Moats <rmoats@us.ibm.com>
Fri, 9 Oct 2015 16:35:03 +0000 (11:35 -0500)
Change-Id: I508a718ed2a9063d83ddff276dc8cb2848d583cd
Signed-off-by: Ryan Moats <rmoats@us.ibm.com>
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronBgpvpnsNorthbound.java
transcriber/src/main/java/org/opendaylight/neutron/transcriber/NeutronBgpvpnInterface.java

index 417c1fa0950bcd4e6377e8c438a1aa9b33d73a56..ec551fa3cae38bb456c86e32a213af68d65096d3 100644 (file)
@@ -54,7 +54,7 @@ import org.opendaylight.neutron.spi.NeutronBgpvpn;
  */
 
 @Path("/bgpvpns")
-public class NeutronBgpvpnsNorthbound extends AbstractNeutronNorthbound {
+public class NeutronBgpvpnsNorthbound {
 
     @Context
     UriInfo uriInfo;
@@ -67,7 +67,7 @@ public class NeutronBgpvpnsNorthbound extends AbstractNeutronNorthbound {
     private NeutronCRUDInterfaces getNeutronInterfaces() {
         NeutronCRUDInterfaces answer = new NeutronCRUDInterfaces().fetchINeutronBgpvpnCRUD(this);
         if (answer.getBgpvpnInterface() == null) {
-            throw new ServiceUnavailableException(serviceUnavailable(RESOURCE_NAME));
+            throw new ServiceUnavailableException("Service is unavailable");
         }
         return answer;
     }
@@ -160,7 +160,7 @@ public class NeutronBgpvpnsNorthbound extends AbstractNeutronNorthbound {
             ) {
         INeutronBgpvpnCRUD bgpvpnInterface = getNeutronInterfaces().getBgpvpnInterface();
         if (!bgpvpnInterface.bgpvpnExists(bgpvpnUUID)) {
-            throw new ResourceNotFoundException(uuidNoExist(RESOURCE_NAME));
+            throw new ResourceNotFoundException("UUID does not exist");
         }
         if (fields.size() > 0) {
             NeutronBgpvpn ans = bgpvpnInterface.getBgpvpn(bgpvpnUUID);
index 5f54fc7120d00b48d8e03ce4e2bbbf5b4b797f64..1fca51b1e388e0d06c352019335d24dd047dc362 100644 (file)
@@ -25,15 +25,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.bgpvpns.rev150903.B
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.bgpvpns.rev150903.bgpvpns.attributes.Bgpvpns;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.bgpvpns.rev150903.bgpvpns.attributes.bgpvpns.Bgpvpn;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.bgpvpns.rev150903.bgpvpns.attributes.bgpvpns.BgpvpnBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev141002.NetworkTypeBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150325.Neutron;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.NetworkTypeBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class NeutronBgpvpnInterface extends AbstractNeutronInterface<Bgpvpn,NeutronBgpvpn> implements INeutronBgpvpnCRUD {
+public class NeutronBgpvpnInterface extends AbstractNeutronInterface<Bgpvpn, Bgpvpns, NeutronBgpvpn> implements INeutronBgpvpnCRUD {
     private static final Logger LOGGER = LoggerFactory.getLogger(NeutronBgpvpnInterface.class);
 
     private static final ImmutableBiMap<Class<? extends BgpvpnTypeBase>,String> BGPVPN_TYPE_MAP
@@ -57,18 +57,8 @@ public class NeutronBgpvpnInterface extends AbstractNeutronInterface<Bgpvpn,Neut
     }
 
     @Override
-    public List<NeutronBgpvpn> getAll() {
-        Set<NeutronBgpvpn> allBgpvpns = new HashSet<NeutronBgpvpn>();
-        Bgpvpns bgpvpns = readMd(createInstanceIdentifier());
-        if (bgpvpns != null) {
-            for (Bgpvpn bgpvpn: bgpvpns.getBgpvpn()) {
-                allBgpvpns.add(fromMd(bgpvpn));
-            }
-        }
-        LOGGER.debug("Exiting getAllBgpvpns, Found {} OpenStackBgpvpns", allBgpvpns.size());
-        List<NeutronBgpvpn> ans = new ArrayList<NeutronBgpvpn>();
-        ans.addAll(allBgpvpns);
-        return ans;
+    protected List<Bgpvpn> getDataObjectList(Bgpvpns bgpvpns) {
+        return bgpvpns.getBgpvpn();
     }
 
     @Override