Refactor the alto-core and alto-basic 48/63748/4
authorjensenzhang <hack@jensen-zhang.site>
Wed, 27 Sep 2017 03:56:56 +0000 (11:56 +0800)
committerjensenzhang <hack@jensen-zhang.site>
Sat, 3 Feb 2018 12:43:01 +0000 (20:43 +0800)
Cleanup the codestyle and project structure.

Change-Id: I6a54daff68a43dda7d31edfddac20657c6651510
Signed-off-by: jensenzhang <hack@jensen-zhang.site>
19 files changed:
.gitignore
alto-basic/auto-maps/impl/src/main/java/org/opendaylight/alto/basic/impl/AltoAutoMapsProvider.java
alto-basic/auto-maps/impl/src/main/java/org/opendaylight/alto/basic/impl/AltoAutoMapsUpdateListener.java
alto-basic/manual-maps/api/src/main/java/org/opendaylight/alto/basic/manual/maps/ManualMapsUtils.java
alto-basic/manual-maps/impl/src/main/java/org/opendaylight/alto/basic/impl/AltoManualMapsProvider.java
alto-basic/manual-maps/impl/src/main/java/org/opendaylight/alto/basic/impl/ManualMapsListener.java
alto-basic/simple-ecs/impl/src/main/java/org/opendaylight/alto/basic/endpointcostservice/impl/BasicECSImplementation.java
alto-basic/simple-ecs/impl/src/main/java/org/opendaylight/alto/basic/endpointcostservice/impl/EndpointcostserviceProvider.java
alto-basic/simple-ecs/impl/src/main/java/org/opendaylight/alto/basic/endpointcostservice/impl/base/BaseECSImplementation.java
alto-basic/simple-ecs/impl/src/main/java/org/opendaylight/alto/basic/endpointcostservice/supportservice/impl/NetworkFlowCapableNodeImpl.java
alto-basic/simple-ecs/impl/src/main/java/org/opendaylight/alto/basic/endpointcostservice/supportservice/impl/RoutingServiceImpl.java
alto-basic/simple-ird/impl/src/main/java/org/opendaylight/alto/basic/impl/AltoSimpleIrdProvider.java
alto-basic/simple-ird/impl/src/main/java/org/opendaylight/alto/basic/impl/SimpleIrdEntryListener.java
alto-basic/simple-ird/impl/src/main/java/org/opendaylight/alto/basic/impl/SimpleIrdListener.java
alto-basic/simple-ird/impl/src/main/java/org/opendaylight/alto/basic/impl/SimpleIrdRoute.java
alto-core/northbound/api/src/main/java/org/opendaylight/alto/core/northbound/api/utils/rfc7285/RFC7285VersionTag.java
alto-core/standard-northbound-routes/TODO [new file with mode: 0644]
alto-core/standard-northbound-routes/costmap/impl/src/main/java/org/opendaylight/alto/core/northbound/route/costmap/impl/AltoNorthboundRouteCostmap.java
alto-core/standard-northbound-routes/costmap/impl/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml

index 42378d2c22076690c280540b631048c2b9e483f2..f37dd542dc7873c144d622e95ed3f6ab2938013e 100644 (file)
@@ -40,3 +40,4 @@ yang-gen-code
 yang-gen-config
 yang-gen-sal
 .ensime
+.vscode
index 42156aea690e04b87adfb632c1e51bbe4046bb6a..3fed8413dcf7dd4c9157659c31751405f77ffc2c 100644 (file)
@@ -15,12 +15,10 @@ public class AltoAutoMapsProvider {
 
     private static final Logger LOG = LoggerFactory.getLogger(AltoAutoMapsProvider.class);
 
-    private final DataBroker dataBroker;
-    private AltoAutoMapsUpdateListener m_listener;
+    private AltoAutoMapsUpdateListener listener;
 
     public AltoAutoMapsProvider(final DataBroker dataBroker) {
-        this.dataBroker = dataBroker;
-        this.m_listener = new AltoAutoMapsUpdateListener(dataBroker);
+        this.listener = new AltoAutoMapsUpdateListener(dataBroker);
     }
 
     /**
@@ -33,7 +31,14 @@ public class AltoAutoMapsProvider {
     /**
      * Method called when the blueprint container is destroyed.
      */
-    public void close() {
+    public void close() throws Exception {
+        closeListener();
         LOG.info("AltoAutoMapsProvider Closed");
     }
+
+    private void closeListener() throws Exception {
+        if (listener != null) {
+            this.listener.close();
+        }
+    }
 }
index 20887079c5380d4d3ad4915237afd77f1cc8221e..1781736340adf51db69a59ab049ee83b2abf998e 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.alto.basic.impl;
 import java.util.Collection;
 import java.util.LinkedList;
 import java.util.List;
+
 import org.opendaylight.alto.basic.manual.maps.ManualMapsUtils;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
@@ -45,8 +46,8 @@ public class AltoAutoMapsUpdateListener implements DataTreeChangeListener<Topolo
 
     private static final String TOPOLOGY_NAME = "flow:1";
     private static final String DEFAULT_AUTO_NETWORKMAP = "default-auto-networkmap";
-    private static final String DEFAULT_AUTO_COSTMAP = "default-auto-costmap";
-    private static final String DEFAULT_PID = "PID0";
+    // private static final String DEFAULT_AUTO_COSTMAP = "default-auto-costmap";
+    // private static final String DEFAULT_PID = "PID0";
 
     public AltoAutoMapsUpdateListener(final DataBroker dataBroker) {
         this.dataBroker = dataBroker;
@@ -62,28 +63,14 @@ public class AltoAutoMapsUpdateListener implements DataTreeChangeListener<Topolo
     @Override
     public void onDataTreeChanged(Collection<DataTreeModification<Topology>> changes) {
         WriteTransaction writeTx = null;
-        for (DataTreeModification<Topology> change: changes) {
+        for (DataTreeModification<Topology> change : changes) {
             final DataObjectModification<Topology> rootNode = change.getRootNode();
             switch (rootNode.getModificationType()) {
                 case WRITE:
-                    if (writeTx == null) {
-                        writeTx = dataBroker.newWriteOnlyTransaction();
-                    }
-
-                    if (rootNode.getDataBefore() == null) {
-                        createDefaultAutoNetworkMap(rootNode.getDataAfter(), writeTx);
-                        LOG.info("Create default auto networkmap");
-                    } else {
-                        updateDefaultAutoNetworkMap(rootNode.getDataAfter(), writeTx);
-                        LOG.info("Update default auto networkmap");
-                    }
+                    writeTx = handleDataWrite(rootNode, writeTx);
                     break;
                 case DELETE:
-                    if (writeTx == null) {
-                        writeTx = dataBroker.newWriteOnlyTransaction();
-                    }
-
-                    emptyDefaultAutoNetworkMap(writeTx);
+                    writeTx = handleDataDelete(writeTx);
                     LOG.info("Empty default auto networkmap");
                     break;
                 default:
@@ -96,6 +83,30 @@ public class AltoAutoMapsUpdateListener implements DataTreeChangeListener<Topolo
         }
     }
 
+    private WriteTransaction handleDataWrite(DataObjectModification<Topology> rootNode, WriteTransaction writeTx) {
+        if (writeTx == null) {
+            writeTx = dataBroker.newWriteOnlyTransaction();
+        }
+
+        if (rootNode.getDataBefore() == null) {
+            createDefaultAutoNetworkMap(rootNode.getDataAfter(), writeTx);
+            LOG.info("Create default auto networkmap");
+        } else {
+            updateDefaultAutoNetworkMap(rootNode.getDataAfter(), writeTx);
+            LOG.info("Update default auto networkmap");
+        }
+        return writeTx;
+    }
+
+    private WriteTransaction handleDataDelete(WriteTransaction writeTx) {
+        if (writeTx == null) {
+            writeTx = dataBroker.newWriteOnlyTransaction();
+        }
+
+        emptyDefaultAutoNetworkMap(writeTx);
+        return writeTx;
+    }
+
     private void createDefaultAutoNetworkMap(Topology topology, final WriteTransaction wx) {
         for (Node node : topology.getNode()) {
             HostNode hostNode = node.getAugmentation(HostNode.class);
@@ -156,7 +167,13 @@ public class AltoAutoMapsUpdateListener implements DataTreeChangeListener<Topolo
 
     @Override
     public void close() throws Exception {
-        registration.close();
+        closeRegistration();
         LOG.info("AltoAutoMapsUpdateListener Closed");
     }
+
+    private void closeRegistration() {
+        if (registration != null) {
+            registration.close();
+        }
+    }
 }
index ee55a1b18d4566137fe5f31dc6bf719e276f8172..e0cb478a2b34fc69b81a0ac388ca3ebffc945ffe 100644 (file)
@@ -42,13 +42,11 @@ public class ManualMapsUtils {
     }
 
     public static InstanceIdentifier<ConfigContext> getContextIID(String cid) {
-        Uuid _cid = new Uuid(cid);
-        return getContextIID(_cid);
+        return getContextIID(new Uuid(cid));
     }
 
     public static InstanceIdentifier<ConfigContext> getContextIID(Uuid cid) {
-        ConfigContextKey key = new ConfigContextKey(cid);
-        return getContextIID(key);
+        return getContextIID(new ConfigContextKey(cid));
     }
 
     public static InstanceIdentifier<ConfigContext> getContextIID(ConfigContextKey key) {
@@ -64,15 +62,12 @@ public class ManualMapsUtils {
     }
 
     public static InstanceIdentifier<ResourceNetworkMap> getResourceNetworkMapIID(String cid, String rid) {
-        Uuid _cid = new Uuid(cid);
-        ResourceId _rid = new ResourceId(rid);
-        return getResourceNetworkMapIID(_cid, _rid);
+        return getResourceNetworkMapIID(new Uuid(cid), new ResourceId(rid));
     }
 
     public static InstanceIdentifier<ResourceNetworkMap> getResourceNetworkMapIID(Uuid cid, ResourceId rid) {
-        ConfigContextKey ckey = new ConfigContextKey(cid);
-        ResourceNetworkMapKey rkey = new ResourceNetworkMapKey(rid);
-        return getResourceIID(ckey, rkey, ResourceNetworkMap.class);
+        return getResourceIID(new ConfigContextKey(cid), new ResourceNetworkMapKey(rid),
+            ResourceNetworkMap.class);
     }
 
     public static InstanceIdentifier<ResourceCostMap> getResourceCostMapIID(String rid) {
@@ -80,15 +75,14 @@ public class ManualMapsUtils {
     }
 
     public static InstanceIdentifier<ResourceCostMap> getResourceCostMapIID(String cid, String rid) {
-        Uuid _cid = new Uuid(cid);
-        ResourceId _rid = new ResourceId(rid);
-        return getResourceCostMapIID(_cid, _rid);
+        return getResourceCostMapIID(new Uuid(cid), new ResourceId(rid));
     }
 
     public static InstanceIdentifier<ResourceCostMap> getResourceCostMapIID(Uuid cid, ResourceId rid) {
         ConfigContextKey ckey = new ConfigContextKey(cid);
         ResourceCostMapKey rkey = new ResourceCostMapKey(rid);
-        return getResourceIID(ckey, rkey, ResourceCostMap.class);
+        return getResourceIID(new ConfigContextKey(cid), new ResourceCostMapKey(rid),
+            ResourceCostMap.class);
     }
 
     public static <T extends Identifiable<K> & ChildOf<? super ConfigContext>, K extends Identifier<T>>
@@ -108,8 +102,8 @@ public class ManualMapsUtils {
     public static Uuid createContext(Uuid cid, final WriteTransaction wx) {
         ConfigContextBuilder builder = new ConfigContextBuilder();
         builder.setContextId(cid);
-        builder.setResourceNetworkMap(new LinkedList<ResourceNetworkMap>());
-        builder.setResourceCostMap(new LinkedList<ResourceCostMap>());
+        builder.setResourceNetworkMap(new LinkedList<>());
+        builder.setResourceCostMap(new LinkedList<>());
 
         wx.put(LogicalDatastoreType.CONFIGURATION, getContextIID(cid), builder.build());
         return cid;
@@ -119,10 +113,12 @@ public class ManualMapsUtils {
             List<Map> networkMap,
             WriteTransaction wx) {
         InstanceIdentifier<ResourceNetworkMap> iid = getResourceNetworkMapIID(rid);
-        ResourceNetworkMapBuilder builder = new ResourceNetworkMapBuilder();
-        builder.setTag(new Tag(UUID.nameUUIDFromBytes(rid.getBytes()).toString().replaceAll("-", "")));
-        builder.setResourceId(new ResourceId(rid));
-        builder.setMap(networkMap);
+        ResourceNetworkMapBuilder builder = new ResourceNetworkMapBuilder()
+            .setTag(new Tag(UUID.nameUUIDFromBytes(rid.getBytes())
+                .toString()
+                .replaceAll("-", "")))
+            .setResourceId(new ResourceId(rid))
+            .setMap(networkMap);
         wx.put(LogicalDatastoreType.CONFIGURATION, iid, builder.build());
         return iid;
     }
@@ -132,11 +128,13 @@ public class ManualMapsUtils {
             List<org.opendaylight.yang.gen.v1.urn.alto.manual.maps.costmap.rev151021.cost.map.Map> costMap,
             WriteTransaction wx) {
         InstanceIdentifier<ResourceCostMap> iid = getResourceCostMapIID(rid);
-        ResourceCostMapBuilder builder = new ResourceCostMapBuilder();
-        builder.setTag(new Tag(UUID.nameUUIDFromBytes(rid.getBytes()).toString().replaceAll("-", "")));
-        builder.setResourceId(new ResourceId(rid));
-        builder.setMap(costMap);
-        builder.setMeta(meta);
+        ResourceCostMapBuilder builder = new ResourceCostMapBuilder()
+            .setTag(new Tag(UUID.nameUUIDFromBytes(rid.getBytes())
+                .toString()
+                .replaceAll("-", "")))
+            .setResourceId(new ResourceId(rid))
+            .setMap(costMap)
+            .setMeta(meta);
         wx.put(LogicalDatastoreType.CONFIGURATION, iid, builder.build());
         return iid;
     }
@@ -158,7 +156,8 @@ public class ManualMapsUtils {
         deleteResourceNetworkMap(new Uuid(cid), new ResourceId(cid), wx);
     }
 
-    public static void deleteResourceNetworkMap(Uuid cid, ResourceId rid, final WriteTransaction wx) {
+    public static void deleteResourceNetworkMap(Uuid cid, ResourceId rid,
+            final WriteTransaction wx) {
         wx.delete(LogicalDatastoreType.CONFIGURATION, getResourceNetworkMapIID(cid, rid));
     }
 
index 13e2c35d1e8aa1bdd6b067564aaeb4671bfad344..5de33f776abb085f383ab440ae462ff04f1fb766 100644 (file)
@@ -9,6 +9,8 @@ package org.opendaylight.alto.basic.impl;
 
 import java.util.LinkedList;
 import java.util.List;
+import java.util.concurrent.ExecutionException;
+
 import org.opendaylight.alto.basic.manual.maps.ManualMapsUtils;
 import org.opendaylight.alto.core.northbound.api.AltoNorthboundRoute;
 import org.opendaylight.alto.core.northbound.api.AltoNorthboundRouter;
@@ -34,8 +36,7 @@ public class AltoManualMapsProvider implements AutoCloseable {
     private final BindingAwareBroker.RoutedRpcRegistration<AltoModelNetworkmapService> altoModelNetworkmapService;
     private final BindingAwareBroker.RoutedRpcRegistration<AltoModelCostmapService> altoModelCostmapService;
 
-    private AltoNorthboundRouter m_router = null;
-    private List<Uuid> m_contexts = null;
+    private List<Uuid> contextList = null;
 
     public AltoManualMapsProvider(DataBroker dataBroker,
             AltoNorthboundRouter router,
@@ -57,16 +58,16 @@ public class AltoManualMapsProvider implements AutoCloseable {
         manualMapsListener.close();
     }
 
-    protected void initializeConfigContext() throws Exception {
-        m_contexts = new LinkedList<>();
+    protected void initializeConfigContext() throws ExecutionException, InterruptedException {
+        contextList = new LinkedList<>();
         WriteTransaction wx = dataBroker.newWriteOnlyTransaction();
-        m_contexts.add(ManualMapsUtils.createContext(wx));
+        contextList.add(ManualMapsUtils.createContext(wx));
         wx.submit().get();
     }
 
-    protected void clearConfigContext() throws Exception {
+    protected void clearConfigContext() throws ExecutionException, InterruptedException {
         WriteTransaction wx = dataBroker.newWriteOnlyTransaction();
-        for (Uuid context : m_contexts) {
+        for (Uuid context : contextList) {
             ManualMapsUtils.deleteContext(context, wx);
         }
         wx.submit().get();
@@ -88,13 +89,13 @@ public class AltoManualMapsProvider implements AutoCloseable {
     @Override
     public void close() throws Exception {
         try {
-            if (m_router != null) {
-                m_router.removeRoute(RESOURCE_CONFIG_ROUTE_NAME);
+            if (router != null) {
+                router.removeRoute(RESOURCE_CONFIG_ROUTE_NAME);
             }
             clearConfigContext();
             closeListener();
         } catch (Exception e) {
-            LOG.error("Failed to remove route");
+            LOG.error("Failed to remove route", e);
         }
 
         LOG.info("AltoManualMapsProvider Closed");
@@ -102,16 +103,10 @@ public class AltoManualMapsProvider implements AutoCloseable {
 
     private void setupRoute() {
         AltoNorthboundRoute route = new ManualMapsRoute(this);
-        String base_url = router.addRoute(RESOURCE_CONFIG_ROUTE_NAME, route);
-        if (base_url == null) {
+        String baseUrl = router.addRoute(RESOURCE_CONFIG_ROUTE_NAME, route);
+        if (baseUrl == null) {
             LOG.error("Failed to register route for AltoManualMaps");
             return;
         }
-
-        try {
-            m_router = router;
-        } catch (Exception e) {
-            LOG.error("Failed to reigster route");
-        }
     }
 }
index 5b1e6f60061dfbdc78fd95193c77c8f40127dca8..7f2cf21526b7806a0050ca9209899fe629d56a27 100644 (file)
@@ -12,6 +12,7 @@ import java.util.Collection;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
+
 import org.opendaylight.alto.basic.manual.maps.ManualMapsUtils;
 import org.opendaylight.alto.basic.simpleird.SimpleIrdUtils;
 import org.opendaylight.alto.core.northbound.route.costmap.AltoNbrCostmapUtils;
@@ -47,50 +48,47 @@ public class ManualMapsListener implements AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(ManualMapsListener.class);
 
-    private DataBroker m_dataBroker = null;
-    private final List<ListenerRegistration<?>> m_regs = new ArrayList<>();;
-    private BindingAwareBroker.RoutedRpcRegistration<AltoModelNetworkmapService> m_networkmapServiceReg = null;
-    private BindingAwareBroker.RoutedRpcRegistration<AltoModelCostmapService> m_costmapServiceReg = null;
-
-    public ManualMapsListener() {
-    }
+    private DataBroker dataBroker = null;
+    private final List<ListenerRegistration<?>> listenerRegs = new ArrayList<>();
+    private BindingAwareBroker.RoutedRpcRegistration<AltoModelNetworkmapService> networkmapServiceReg = null;
+    private BindingAwareBroker.RoutedRpcRegistration<AltoModelCostmapService> costmapServiceReg = null;
 
     public void register(DataBroker dataBroker) {
-        m_dataBroker = dataBroker;
+        this.dataBroker = dataBroker;
 
         final InstanceIdentifier<ConfigContext> contextListIID = ManualMapsUtils.getContextListIID();
 
-        m_regs.add(m_dataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(
+        listenerRegs.add(dataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(
                 LogicalDatastoreType.CONFIGURATION, contextListIID), changes -> onConfigContextChanged(changes)));
 
-        m_regs.add(m_dataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(
-            LogicalDatastoreType.CONFIGURATION, contextListIID.child(ResourceNetworkMap.class)),
-            changes -> onNetworkMapChanged(changes)));
+        listenerRegs.add(dataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(
+                        LogicalDatastoreType.CONFIGURATION, contextListIID.child(ResourceNetworkMap.class)),
+                changes -> onNetworkMapChanged(changes)));
 
-        m_regs.add(m_dataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(
-            LogicalDatastoreType.CONFIGURATION, contextListIID.child(ResourceCostMap.class)),
-            changes -> onCostMapChanged(changes)));
+        listenerRegs.add(dataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(
+                        LogicalDatastoreType.CONFIGURATION, contextListIID.child(ResourceCostMap.class)),
+                changes -> onCostMapChanged(changes)));
     }
 
     public void setNetworkmapServiceReg(BindingAwareBroker.RoutedRpcRegistration<AltoModelNetworkmapService> reg) {
-        this.m_networkmapServiceReg = reg;
+        this.networkmapServiceReg = reg;
     }
 
     public void setCostmapServiceReg(BindingAwareBroker.RoutedRpcRegistration<AltoModelCostmapService> reg) {
-        this.m_costmapServiceReg = reg;
+        this.costmapServiceReg = reg;
     }
 
     @Override
     public void close() throws Exception {
-        for (ListenerRegistration<?> reg: m_regs) {
+        for (ListenerRegistration<?> reg : listenerRegs) {
             reg.close();
         }
     }
 
     private void onConfigContextChanged(Collection<DataTreeModification<ConfigContext>> changes) {
-        final ReadWriteTransaction rwx = m_dataBroker.newReadWriteTransaction();
+        final ReadWriteTransaction rwx = dataBroker.newReadWriteTransaction();
 
-        for (DataTreeModification<ConfigContext> change: changes) {
+        for (DataTreeModification<ConfigContext> change : changes) {
             final DataObjectModification<ConfigContext> rootNode = change.getRootNode();
             final InstanceIdentifier<ConfigContext> identifier = change.getRootPath().getRootIdentifier();
             switch (rootNode.getModificationType()) {
@@ -113,9 +111,9 @@ public class ManualMapsListener implements AutoCloseable {
     }
 
     private void onCostMapChanged(Collection<DataTreeModification<ResourceCostMap>> changes) {
-        final ReadWriteTransaction rwx = m_dataBroker.newReadWriteTransaction();
+        final ReadWriteTransaction rwx = dataBroker.newReadWriteTransaction();
 
-        for (DataTreeModification<ResourceCostMap> change: changes) {
+        for (DataTreeModification<ResourceCostMap> change : changes) {
             final DataObjectModification<ResourceCostMap> rootNode = change.getRootNode();
             final InstanceIdentifier<ResourceCostMap> identifier = change.getRootPath().getRootIdentifier();
             switch (rootNode.getModificationType()) {
@@ -123,13 +121,7 @@ public class ManualMapsListener implements AutoCloseable {
                 case SUBTREE_MODIFIED:
                     final ResourceCostMap original = rootNode.getDataBefore();
                     final ResourceCostMap updated = rootNode.getDataAfter();
-                    if (original == null) {
-                        createCostMap(updated, identifier, rwx);
-                        LOG.info("Create new CostMap data into OPERATIONAL");
-                    } else {
-                        updateCostMap(original, updated, identifier, rwx);
-                        LOG.info("Update CostMap data from OPERATIONAL");
-                    }
+                    handleCostMapModified(identifier, original, updated, rwx);
                     break;
                 case DELETE:
                     removeCostMap(identifier, rootNode.getDataBefore(), rwx);
@@ -143,10 +135,20 @@ public class ManualMapsListener implements AutoCloseable {
         rwx.submit();
     }
 
+    private void handleCostMapModified(InstanceIdentifier<ResourceCostMap> identifier, ResourceCostMap original, ResourceCostMap updated, ReadWriteTransaction rwx) {
+        if (original == null) {
+            createCostMap(updated, identifier, rwx);
+            LOG.info("Create new CostMap data into OPERATIONAL");
+        } else {
+            updateCostMap(original, updated, identifier, rwx);
+            LOG.info("Update CostMap data from OPERATIONAL");
+        }
+    }
+
     private void onNetworkMapChanged(Collection<DataTreeModification<ResourceNetworkMap>> changes) {
-        final ReadWriteTransaction rwx = m_dataBroker.newReadWriteTransaction();
+        final ReadWriteTransaction rwx = dataBroker.newReadWriteTransaction();
 
-        for (DataTreeModification<ResourceNetworkMap> change: changes) {
+        for (DataTreeModification<ResourceNetworkMap> change : changes) {
             final DataObjectModification<ResourceNetworkMap> rootNode = change.getRootNode();
             final InstanceIdentifier<ResourceNetworkMap> identifier = change.getRootPath().getRootIdentifier();
             switch (rootNode.getModificationType()) {
@@ -154,13 +156,7 @@ public class ManualMapsListener implements AutoCloseable {
                 case SUBTREE_MODIFIED:
                     final ResourceNetworkMap original = rootNode.getDataBefore();
                     final ResourceNetworkMap updated = rootNode.getDataAfter();
-                    if (original == null) {
-                        createNetworkMap(updated, identifier, rwx);
-                        LOG.info("Create new NetworkMap data into OPERATIONAL");
-                    } else {
-                        updateNetworkMap(original, updated, identifier, rwx);
-                        LOG.info("Update NetworkMap data from OPERATIONAL");
-                    }
+                    handleNetworkMapModified(identifier, original, updated, rwx);
                     break;
                 case DELETE:
                     removeNetworkMap(identifier, rootNode.getDataBefore(), rwx);
@@ -174,44 +170,103 @@ public class ManualMapsListener implements AutoCloseable {
         rwx.submit();
     }
 
-    private <T extends NetworkMap> void updateNetworkMap(T origin, T updated, InstanceIdentifier<T> updatedIID,
-                                  final WriteTransaction wx) {
+    private void handleNetworkMapModified(InstanceIdentifier<ResourceNetworkMap> identifier,
+            ResourceNetworkMap original, ResourceNetworkMap updated, ReadWriteTransaction rwx) {
+        if (original == null) {
+            createNetworkMap(updated, identifier, rwx);
+            LOG.info("Create new NetworkMap data into OPERATIONAL");
+        } else {
+            updateNetworkMap(original, updated, identifier, rwx);
+            LOG.info("Update NetworkMap data from OPERATIONAL");
+        }
+    }
+
+    private <T extends NetworkMap> void createNetworkMap(T created,
+            InstanceIdentifier<T> createdIID, final WriteTransaction wx) {
+        ResourcepoolUtils.createResource(ManualMapsUtils.DEFAULT_CONTEXT,
+            created.getResourceId().getValue(),
+            ResourceTypeNetworkmap.class, wx);
+        ResourcepoolUtils.updateResource(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
+            created.getResourceId(), created.getTag(), null, wx);
+        networkmapServiceReg.registerPath(ServiceContext.class,
+            ResourcepoolUtils.getContextTagIID(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
+                created.getResourceId(), created.getTag()));
+        wx.put(LogicalDatastoreType.OPERATIONAL, createdIID, created);
+
+        String path = created.getResourceId().getValue();
+        AltoNbrNetworkmapUtils.createRecord(path, created.getResourceId(), wx);
+        SimpleIrdUtils.createConfigEntry(AltoNbrNetworkmapUtils.BASE_URL + "/" + path,
+            created.getResourceId(), new Uuid(ManualMapsUtils.DEFAULT_CONTEXT), wx);
+    }
+
+    private <T extends CostMap> void createCostMap(T created, InstanceIdentifier<T> createdIID,
+            final WriteTransaction wx) {
+        ResourcepoolUtils.createResource(ManualMapsUtils.DEFAULT_CONTEXT,
+            created.getResourceId().getValue(),
+            ResourceTypeCostmap.class, wx);
+        List<InstanceIdentifier<?>> dependencies = new LinkedList<>();
+        dependencies.add(
+            ResourcepoolUtils.getContextTagIID(
+                new Uuid(ResourcepoolUtils.DEFAULT_CONTEXT),
+                created.getMeta().getDependentVtags().get(0).getResourceId(),
+                created.getMeta().getDependentVtags().get(0).getTag())
+        );
+        ResourcepoolUtils.updateResource(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
+            created.getResourceId(), created.getTag(), dependencies, wx);
+        costmapServiceReg.registerPath(ServiceContext.class,
+            ResourcepoolUtils.getContextTagIID(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
+                created.getResourceId(), created.getTag()));
+        wx.put(LogicalDatastoreType.OPERATIONAL, createdIID, created);
+
+        String path = created.getResourceId().getValue();
+        AltoNbrCostmapUtils.createRecord(path, created.getResourceId(), wx);
+        SimpleIrdUtils.createConfigEntry(AltoNbrCostmapUtils.BASE_URL + "/" + path,
+            created.getResourceId(), new Uuid(ManualMapsUtils.DEFAULT_CONTEXT), wx);
+    }
+
+    private <T extends NetworkMap> void updateNetworkMap(T origin, T updated,
+            InstanceIdentifier<T> updatedIID, final WriteTransaction wx) {
+        // TODO: origin is unused now
         ResourceId rid = updated.getResourceId();
 
         LOG.info("Updating NetworkMap: " + "\n\tResource ID: " + rid.getValue());
         createNetworkMap(updated, updatedIID, wx);
     }
 
-    private <T extends CostMap> void updateCostMap(T origin, T updated, InstanceIdentifier<T> updatedIID,
-                               final WriteTransaction wx) {
+    private <T extends CostMap> void updateCostMap(T origin, T updated,
+            InstanceIdentifier<T> updatedIID, final WriteTransaction wx) {
+        // TODO: origin is unused now
         ResourceId rid = updated.getResourceId();
 
         LOG.info("Updating CostMap: " + "\n\tResource ID: " + rid.getValue());
         createCostMap(updated, updatedIID, wx);
     }
 
-    private <T extends NetworkMap> void removeNetworkMap(InstanceIdentifier<T> mapIID, T removed, final WriteTransaction wx) {
+    private <T extends NetworkMap> void removeNetworkMap(InstanceIdentifier<T> mapIID, T removed,
+            final WriteTransaction wx) {
         SimpleIrdUtils.deleteConfigEntry(removed.getResourceId(), wx);
         String path = removed.getResourceId().getValue();
         AltoNbrNetworkmapUtils.deleteRecord(path, wx);
 
         ResourcepoolUtils.deleteResource(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT), removed.getResourceId(), wx);
-        m_networkmapServiceReg.unregisterPath(ServiceContext.class,
+        networkmapServiceReg.unregisterPath(ServiceContext.class,
                 ResourcepoolUtils.getContextTagIID(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
                         removed.getResourceId(), removed.getTag()));
         removeMap(mapIID, wx);
     }
 
-    private <T extends CostMap> void removeCostMap(InstanceIdentifier<T> mapIID, T removed, final WriteTransaction wx) {
+    private <T extends CostMap> void removeCostMap(InstanceIdentifier<T> mapIID, T removed,
+            final WriteTransaction wx) {
         SimpleIrdUtils.deleteConfigEntry(removed.getResourceId(), wx);
         ManualMapsUtils.deleteResourceCostMap(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT), removed.getResourceId(), wx);
-        m_costmapServiceReg.unregisterPath(ServiceContext.class,
+        costmapServiceReg.unregisterPath(ServiceContext.class,
                 ResourcepoolUtils.getContextTagIID(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
                         removed.getResourceId(), removed.getTag()));
         removeMap(mapIID, wx);
     }
 
-    private void removeConfigContext(InstanceIdentifier<ConfigContext> iid, ConfigContext removed, final WriteTransaction wx) {
+    private void removeConfigContext(InstanceIdentifier<ConfigContext> iid, ConfigContext removed,
+            final WriteTransaction wx) {
         ManualMapsUtils.deleteContext(removed.getContextId(), wx);
         removeMap(iid, wx);
         // TODO: Consistency with SimpleIrd and NrbRecord
@@ -221,47 +276,6 @@ public class ManualMapsListener implements AutoCloseable {
         wx.delete(LogicalDatastoreType.OPERATIONAL, mapIID);
     }
 
-    private <T extends NetworkMap> void createNetworkMap(T created, InstanceIdentifier<T> createdIID, final WriteTransaction wx) {
-        ResourcepoolUtils.createResource(ManualMapsUtils.DEFAULT_CONTEXT,
-                created.getResourceId().getValue(),
-                ResourceTypeNetworkmap.class, wx);
-        ResourcepoolUtils.updateResource(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
-                created.getResourceId(), created.getTag(), null, wx);
-        m_networkmapServiceReg.registerPath(ServiceContext.class,
-                ResourcepoolUtils.getContextTagIID(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
-                        created.getResourceId(), created.getTag()));
-        wx.put(LogicalDatastoreType.OPERATIONAL, createdIID, created);
-
-        String path = created.getResourceId().getValue();
-        AltoNbrNetworkmapUtils.createRecord(path, created.getResourceId(), wx);
-        SimpleIrdUtils.createConfigEntry(AltoNbrNetworkmapUtils.BASE_URL + "/" + path,
-                created.getResourceId(), new Uuid(ManualMapsUtils.DEFAULT_CONTEXT), wx);
-    }
-
-    private <T extends CostMap> void createCostMap(T created, InstanceIdentifier<T> createdIID, final WriteTransaction wx) {
-        ResourcepoolUtils.createResource(ManualMapsUtils.DEFAULT_CONTEXT,
-                created.getResourceId().getValue(),
-                ResourceTypeCostmap.class, wx);
-        List<InstanceIdentifier<?>> dependencies = new LinkedList<>();
-        dependencies.add(
-                ResourcepoolUtils.getContextTagIID(
-                        new Uuid(ResourcepoolUtils.DEFAULT_CONTEXT),
-                        created.getMeta().getDependentVtags().get(0).getResourceId(),
-                        created.getMeta().getDependentVtags().get(0).getTag())
-        );
-        ResourcepoolUtils.updateResource(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
-                created.getResourceId(), created.getTag(), dependencies, wx);
-        m_costmapServiceReg.registerPath(ServiceContext.class,
-                ResourcepoolUtils.getContextTagIID(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
-                        created.getResourceId(), created.getTag()));
-        wx.put(LogicalDatastoreType.OPERATIONAL, createdIID, created);
-
-        String path = created.getResourceId().getValue();
-        AltoNbrCostmapUtils.createRecord(path, created.getResourceId(), wx);
-        SimpleIrdUtils.createConfigEntry(AltoNbrCostmapUtils.BASE_URL + "/" + path,
-                created.getResourceId(), new Uuid(ManualMapsUtils.DEFAULT_CONTEXT), wx);
-    }
-
     private void createConfigContext(ConfigContext created, InstanceIdentifier<ConfigContext> createdIID, final ReadWriteTransaction rwx) {
         try {
             if (!ResourcepoolUtils.contextExists(created.getContextId(), rwx)) {
@@ -271,6 +285,7 @@ public class ManualMapsListener implements AutoCloseable {
                 ResourcepoolUtils.createContext(created.getContextId(), rwx);
             }
         } catch (InterruptedException | ExecutionException e) {
+            LOG.error("Fail to create config context!", e);
             return;
         }
         rwx.put(LogicalDatastoreType.OPERATIONAL, createdIID, created);
index 2a65871a04dfeb88add85981b7b4c433932160a9..f45f2e3080d4f8f4bdbfec85100df53716ebb484 100644 (file)
@@ -49,10 +49,9 @@ public class BasicECSImplementation extends BaseECSImplementation{
 
     @Override
     protected Cost computeCost(TypedAddressData src, TypedAddressData dst, CostTypeData costType) {
-        NumericalBuilder numericalBuilder = new NumericalBuilder();
         if (validSourceAndDest(src, dst)) {
                 if (isAddressEqual(src,dst)) {
-                return numericalBuilder.setCost(new BigDecimal(0)).build();
+                return new NumericalBuilder().setCost(new BigDecimal(0)).build();
             }
             MatchFields matchFields = createMatchField(src,dst);
             LinkNode head = routingService.buildRoutePath(matchFields);
@@ -68,16 +67,17 @@ public class BasicECSImplementation extends BaseECSImplementation{
         if (hasLoop(head, new HashMap<LinkNode, Integer>())) {
             return null;
         }
-        if(costMetric.getValue().toString().equals(new String("hopcount"))){
+        if (costMetric.getValue().toString().equals(new String("hopcount"))) {
             log.info("hopcpunt");
             Numerical cost = computeHopCountECS(head);
             return (cost == null) ? null : cost;
-        }else if(costMetric.getValue().toString().equals(new String("routingcost"))){
+        } else if(costMetric.getValue().toString().equals(new String("routingcost"))) {
             log.info("routingcost");
-//            Numerical cost = computeRoutingcostECS(head);
-//            return (cost == null) ? null : cost;
+            // TODO: Any issue?
+            // Numerical cost = computeRoutingcostECS(head);
+            // return (cost == null) ? null : cost;
             return null;
-        }else if(costMetric.getValue().toString().equals(new String("bandwidth"))){
+        } else if(costMetric.getValue().toString().equals(new String("bandwidth"))) {
              log.info("bandwidth");
             Numerical cost = computeBandwidthECS(head);
             return (cost == null) ? null : cost;
index ffcdd0006352f9fd52efe20e1bed781765a61696..3fccce38f63a056f671b6d4d539d1122aa14e55b 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.alto.basic.endpointcostservice.impl;
 
 import java.util.concurrent.ExecutionException;
+
 import org.opendaylight.alto.core.resourcepool.ResourcepoolUtils;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
@@ -18,7 +19,6 @@ import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
 import org.opendaylight.yang.gen.v1.urn.alto.resourcepool.rev150921.context.Resource;
 import org.opendaylight.yang.gen.v1.urn.alto.resourcepool.rev150921.context.resource.ContextTag;
-import org.opendaylight.yang.gen.v1.urn.alto.types.rev150921.ResourceId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.endpointcost.rev151021.AltoModelEndpointcostService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.endpointcost.rev151021.ResourceTypeEndpointcost;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
@@ -30,24 +30,24 @@ public class EndpointcostserviceProvider implements AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(EndpointcostserviceProvider.class);
 
-    private final DataBroker m_dataBroker;
-    private final BindingAwareBroker.RoutedRpcRegistration<AltoModelEndpointcostService> m_serviceReg;
-    private ListenerRegistration<?> m_listener;
+    private final DataBroker dataBroker;
+    private final BindingAwareBroker.RoutedRpcRegistration<AltoModelEndpointcostService> serviceReg;
+    private ListenerRegistration<?> listenerReg;
 
     private static final String SERVICE_ENDPOINTCOST_NAME = "service-endpointcost";
-    private static final ResourceId SERVICE_ENDPOINTCOST_RID = new ResourceId(SERVICE_ENDPOINTCOST_NAME);
-    private final InstanceIdentifier<Resource> m_testIID = ResourcepoolUtils.getResourceIID(ResourcepoolUtils.DEFAULT_CONTEXT,
+    // private static final ResourceId SERVICE_ENDPOINTCOST_RID = new ResourceId(SERVICE_ENDPOINTCOST_NAME);
+    private final InstanceIdentifier<Resource> testIID = ResourcepoolUtils.getResourceIID(ResourcepoolUtils.DEFAULT_CONTEXT,
             SERVICE_ENDPOINTCOST_NAME);
 
-    public EndpointcostserviceProvider(DataBroker m_dataBroker,
-            RoutedRpcRegistration<AltoModelEndpointcostService> m_serviceReg) {
-        this.m_dataBroker = m_dataBroker;
-        this.m_serviceReg = m_serviceReg;
+    public EndpointcostserviceProvider(DataBroker dataBroker,
+            RoutedRpcRegistration<AltoModelEndpointcostService> serviceReg) {
+        this.dataBroker = dataBroker;
+        this.serviceReg = serviceReg;
     }
 
     protected void createContextTag()
             throws InterruptedException, ExecutionException, TransactionCommitFailedException {
-        WriteTransaction wx = m_dataBroker.newWriteOnlyTransaction();
+        WriteTransaction wx = dataBroker.newWriteOnlyTransaction();
 
         ResourcepoolUtils.createResourceWithCapabilities(ResourcepoolUtils.DEFAULT_CONTEXT,
                 SERVICE_ENDPOINTCOST_NAME,
@@ -62,7 +62,7 @@ public class EndpointcostserviceProvider implements AutoCloseable {
 
     protected void removeContextTag()
             throws InterruptedException, ExecutionException, TransactionCommitFailedException  {
-        WriteTransaction wx = m_dataBroker.newWriteOnlyTransaction();
+        WriteTransaction wx = dataBroker.newWriteOnlyTransaction();
 
         ResourcepoolUtils.deleteResource(ResourcepoolUtils.DEFAULT_CONTEXT,
                 SERVICE_ENDPOINTCOST_NAME, wx);
@@ -71,11 +71,12 @@ public class EndpointcostserviceProvider implements AutoCloseable {
     }
 
     protected void setupListener() {
-        ResourcepoolUtils.ContextTagListener listener = new ResourcepoolUtils.ContextTagListener(m_testIID, m_serviceReg);
-        m_listener = m_dataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL,
-                m_testIID.child(ContextTag.class)), listener);
+        ResourcepoolUtils.ContextTagListener listener = new ResourcepoolUtils.ContextTagListener(testIID, serviceReg);
+        listenerReg = dataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL,
+                testIID.child(ContextTag.class)), listener);
 
-        assert m_listener != null;
+        assert listenerReg != null;
+        LOG.info("Setup listener for Endpointcostservice successfully!");
     }
 
     public void init() {
index 1deec47510b83499868699bc1b42a8283f5d000a..cfc62475ab7b57492a972773f659c9aa998668f3 100644 (file)
@@ -113,7 +113,7 @@ public abstract class BaseECSImplementation {
 
     /**
      * @param input is the input of ECS.
-     * @return true if input is validate.
+     * @return true if input is valid.
      */
     public boolean checkInput(QueryInput input) {
         request = (EndpointcostRequest)input.getRequest();
index 2fed365c29fae415358f748e45dcdc33e911abf8..8a15133fdcfcbadf9087e36b5853c7a388bcd84b 100644 (file)
@@ -24,8 +24,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class NetworkFlowCapableNodeImpl implements NetworkFlowCapableNodeService{
-    private static final Logger log = LoggerFactory
-            .getLogger(NetworkFlowCapableNodeImpl.class);
+    private static final Logger LOG = LoggerFactory.getLogger(NetworkFlowCapableNodeImpl.class);
     private DataBroker dataBroker;
     private NetworkPortStatisticsService portStatistics;
 
@@ -44,37 +43,37 @@ public class NetworkFlowCapableNodeImpl implements NetworkFlowCapableNodeService
 
     @Override
     public FlowCapableNode getFlowCapableNode(String nodeId) {
-        log.info("Reading flow capable node for " + nodeId);
+        LOG.debug("Reading flow capable node for {}", nodeId);
         try {
             return DataStoreHelper.readOperational(dataBroker,
                     InstanceIdentifierUtils.flowCapableNode(nodeId));
         } catch (ReadDataFailedException e) {
-            e.printStackTrace();
+            LOG.info("Error occurs when reading flow capable node!", e);
         }
         return null;
     }
 
     @Override
     public FlowCapableNodeConnector getFlowCapableNodeConnector(String tpId) {
-        log.info("Reading flow capable node connector for " + tpId);
+        LOG.debug("Reading flow capable node connector for {}", tpId);
         try {
             return DataStoreHelper.readOperational(dataBroker,
                     InstanceIdentifierUtils.flowCapableNodeConnector(tpId));
         } catch (ReadDataFailedException e) {
-            e.printStackTrace();
+            LOG.info("Error occurs when reading flow capable node connector!", e);
         }
         return null;
     }
 
     @Override
     public FlowCapableNodeConnectorStatistics getFlowCapableNodeConnectorStatistics(String tpId) {
-        log.info("Reading flow capable node connector statistics data for + " + tpId);
+        LOG.debug("Reading flow capable node connector statistics data for {}", tpId);
         try {
             return DataStoreHelper.readOperational(dataBroker,
                     InstanceIdentifierUtils.flowCapableNodeConnectorStatisticsData(tpId))
                     .getFlowCapableNodeConnectorStatistics();
         } catch (ReadDataFailedException e) {
-            e.printStackTrace();
+            LOG.info("Error occurs when reading flow capable node connector statistics data!", e);
         }
         return null;
     }
@@ -95,8 +94,8 @@ public class NetworkFlowCapableNodeImpl implements NetworkFlowCapableNodeService
         FlowCapableNodeConnector nodeConnector = getFlowCapableNodeConnector(tpId);
         Long capacity = getCapacity(nodeConnector, readMeter(tpId, meterId));
         Long consumedBandwidth = getConsumedBandwidth(tpId, isHalfDuplex(nodeConnector));
-        log.info("capacity: " + capacity);
-        log.info("consumedBandwidth: " + consumedBandwidth);
+        LOG.info("capacity: " + capacity);
+        LOG.info("consumedBandwidth: " + consumedBandwidth);
         if (capacity == null || consumedBandwidth == null) return null;
         return capacity - consumedBandwidth;
     }
@@ -115,14 +114,14 @@ public class NetworkFlowCapableNodeImpl implements NetworkFlowCapableNodeService
 
     private Long getConsumedBandwidth(String tpId, boolean isHalfDuplex) {
         Long transmitted,received;
-        if(portStatistics.getCurrentRxSpeed(tpId,NetworkPortStatisticsService.Metric.BITSPERSECOND) != null){
+        if (portStatistics.getCurrentRxSpeed(tpId,NetworkPortStatisticsService.Metric.BITSPERSECOND) != null) {
             transmitted = portStatistics.getCurrentTxSpeed(tpId, NetworkPortStatisticsService.Metric.BITSPERSECOND)
                     / 1000;
         }
         else {
             transmitted = 0L;
         }
-        if(portStatistics.getCurrentRxSpeed(tpId, NetworkPortStatisticsService.Metric.BITSPERSECOND) != null){
+        if (portStatistics.getCurrentRxSpeed(tpId, NetworkPortStatisticsService.Metric.BITSPERSECOND) != null) {
             received = portStatistics.getCurrentRxSpeed(tpId, NetworkPortStatisticsService.Metric.BITSPERSECOND)
                     / 1000;
         }
index c048226ea63c8b1f110335879b91eec545abec69..f386ef1a26ae9aea2cae3874432df15fdfdb3b26 100644 (file)
@@ -37,8 +37,8 @@ public class RoutingServiceImpl implements RoutingService {
     private NetworkFlowCapableNodeService flowCapableNodeService;
 
     private FlowTableMatcher flowTableMatcher = new FlowTableMatcher();
-    private List<LinkNode> pathStack = new ArrayList<LinkNode>();
-    private Map<String, LinkNode> visitedInPort = new HashMap<String, LinkNode>();
+    private List<LinkNode> pathStack = new ArrayList<>();
+    private Map<String, LinkNode> visitedInPort = new HashMap<>();
 
     public RoutingServiceImpl(NetworkElementService networkService) {
         this.linkService = networkService.getLinkService();
index 8105c8ed370869f16aeb5653e87133dec56f1c70..71a24c4b28f783544b2590c64d1ea64bb44ef22f 100644 (file)
@@ -35,24 +35,23 @@ public class AltoSimpleIrdProvider {
 
     private static final Logger LOG = LoggerFactory.getLogger(AltoSimpleIrdProvider.class);
 
-    private final DataBroker m_dataBroker;
+    private final DataBroker dataBroker;
 
-    InstanceIdentifier<IrdInstanceConfiguration> m_iid = null;
-    InstanceIdentifier<IrdInstance> m_rootIID = null;
+    InstanceIdentifier<IrdInstanceConfiguration> iid = null;
+    InstanceIdentifier<IrdInstance> rootIid = null;
 
-    private String m_context = null;
-    private SimpleIrdListener m_listener = null;
-    private AltoNorthboundRouter m_router = null;
-    private AltoNorthboundRoute m_route = null;
+    private String context = null;
+    private SimpleIrdListener listener = null;
+    private AltoNorthboundRouter router = null;
 
     protected void createContext() throws InterruptedException, ExecutionException {
-        WriteTransaction wx = m_dataBroker.newWriteOnlyTransaction();
+        WriteTransaction wx = dataBroker.newWriteOnlyTransaction();
 
-        m_context = ResourcepoolUtils.getUUID(SIMPLE_IRD_ROUTE_NAME);
-        ResourcepoolUtils.createContext(m_context, wx);
+        context = ResourcepoolUtils.getUUID(SIMPLE_IRD_ROUTE_NAME);
+        ResourcepoolUtils.createContext(context, wx);
 
         InformationBuilder builder = new InformationBuilder();
-        builder.setContextId(new Uuid(m_context));
+        builder.setContextId(new Uuid(context));
 
         InstanceIdentifier<Information> infoIID;
         infoIID = InstanceIdentifier.builder(Information.class).build();
@@ -60,16 +59,16 @@ public class AltoSimpleIrdProvider {
         wx.put(LogicalDatastoreType.OPERATIONAL, infoIID, builder.build());
         wx.submit().get();
 
-        LOG.info("Registered context {} for SimpleIrd", m_context);
+        LOG.info("Registered context {} for SimpleIrd", context);
     }
 
     protected void setupListener() {
-        m_listener = new SimpleIrdListener(new Uuid(m_context));
-        m_listener.register(m_dataBroker, m_iid);
+        listener = new SimpleIrdListener(new Uuid(context));
+        listener.register(dataBroker, iid);
     }
 
     protected void createDefaultIrd() throws InterruptedException, ExecutionException {
-        WriteTransaction wx = m_dataBroker.newWriteOnlyTransaction();
+        WriteTransaction wx = dataBroker.newWriteOnlyTransaction();
 
         IrdInstanceConfigurationBuilder builder = new IrdInstanceConfigurationBuilder();
         builder.setEntryContext(ResourcepoolUtils.getDefaultContextIID())
@@ -85,35 +84,35 @@ public class AltoSimpleIrdProvider {
     }
 
     protected void deleteContext() throws InterruptedException, ExecutionException {
-        WriteTransaction wx = m_dataBroker.newWriteOnlyTransaction();
-        ResourcepoolUtils.deleteContext(m_context, wx);
+        WriteTransaction wx = dataBroker.newWriteOnlyTransaction();
+        ResourcepoolUtils.deleteContext(context, wx);
 
         wx.submit().get();
     }
 
     protected void closeListener() throws Exception {
-        if (m_listener != null) {
-            m_listener.close();
+        if (listener != null) {
+            listener.close();
         }
     }
 
     public AltoSimpleIrdProvider(final DataBroker dataBroker, final AltoNorthboundRouter router) {
-        this.m_dataBroker = dataBroker;
-        this.m_router = router;
+        this.dataBroker = dataBroker;
+        this.router = router;
     }
 
     /**
      * Method called when the blueprint container is created.
      */
     public void init() {
-        m_iid = SimpleIrdUtils.getInstanceConfigurationListIID();
-        m_rootIID = SimpleIrdUtils.getInstanceIID(ROOT_INSTANCE);
+        iid = SimpleIrdUtils.getInstanceConfigurationListIID();
+        rootIid = SimpleIrdUtils.getInstanceIID(ROOT_INSTANCE);
 
         try {
             createContext();
             setupListener();
             createDefaultIrd();
-            setupRoute(m_router);
+            setupRoute(router);
         } catch (Exception e) {
             LOG.error("Failed to create top-level containers");
             e.printStackTrace();
@@ -126,8 +125,8 @@ public class AltoSimpleIrdProvider {
      */
     public void close() {
         try {
-            if (m_router != null) {
-                m_router.removeRoute(SIMPLE_IRD_ROUTE_NAME);
+            if (router != null) {
+                router.removeRoute(SIMPLE_IRD_ROUTE_NAME);
             }
 
             closeListener();
@@ -138,7 +137,7 @@ public class AltoSimpleIrdProvider {
     }
 
     IrdInstance getInstance(ResourceId rid) {
-        ReadTransaction rx = m_dataBroker.newReadOnlyTransaction();
+        ReadTransaction rx = dataBroker.newReadOnlyTransaction();
 
         try {
             return SimpleIrdUtils.readInstance(rid, rx);
@@ -156,7 +155,7 @@ public class AltoSimpleIrdProvider {
         }
 
         try {
-            WriteTransaction wx = m_dataBroker.newWriteOnlyTransaction();
+            WriteTransaction wx = dataBroker.newWriteOnlyTransaction();
 
             InstanceIdentifier<Information> infoIID;
             infoIID = InstanceIdentifier.builder(Information.class).build();
@@ -166,8 +165,6 @@ public class AltoSimpleIrdProvider {
             wx.merge(LogicalDatastoreType.OPERATIONAL, infoIID, builder.build());
 
             wx.submit().get();
-
-            m_route = route;
         } catch (Exception e) {
             LOG.error("Failed to reigster route");
         }
index b4ae8f84bccab7879da78bac9126a20975ed59f1..ab2834099aa837ce0e1e166ec9aab6ecfeb1abd4 100644 (file)
@@ -62,33 +62,33 @@ public class SimpleIrdEntryListener implements AutoCloseable, DataTreeChangeList
 
     private static final Logger LOG = LoggerFactory.getLogger(SimpleIrdEntryListener.class);
 
-    private DataBroker m_dataBroker = null;
-    private ListenerRegistration<?> m_reg = null;
-    private InstanceIdentifier<IrdConfigurationEntry> m_iid = null;
+    private DataBroker dataBroker = null;
+    private ListenerRegistration<?> listenerReg = null;
+    private InstanceIdentifier<IrdConfigurationEntry> irdConfigEntryIid = null;
 
-    private Uuid m_context = null;
-    private ResourceId m_resource = null;
+    private Uuid context = null;
+    private ResourceId resourceId = null;
 
-    private Uuid m_entryContext = null;
+    private Uuid entryContext = null;
 
     public SimpleIrdEntryListener(InstanceIdentifier<Resource> instance, Uuid entryContext) {
-        m_context = instance.firstKeyOf(Context.class).getContextId();
-        m_resource = instance.firstKeyOf(Resource.class).getResourceId();
-        m_entryContext = entryContext;
+        context = instance.firstKeyOf(Context.class).getContextId();
+        resourceId = instance.firstKeyOf(Resource.class).getResourceId();
+        this.entryContext = entryContext;
     }
 
     public void register(DataBroker dataBroker, InstanceIdentifier<IrdConfigurationEntry> iid) {
-        m_dataBroker = dataBroker;
-        m_iid = iid;
+        this.dataBroker = dataBroker;
+        irdConfigEntryIid = iid;
 
-        m_reg = m_dataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(
-                LogicalDatastoreType.CONFIGURATION, m_iid), this);
+        listenerReg = dataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(
+                LogicalDatastoreType.CONFIGURATION, irdConfigEntryIid), this);
 
         LOG.info("SimpleIrdEntryListener registered");
     }
 
     protected boolean isAcceptableContext(Uuid context) {
-        if (m_entryContext.equals(context) || m_context.equals(context)) {
+        if (entryContext.equals(context) || this.context.equals(context)) {
             return true;
         }
         return false;
@@ -97,8 +97,8 @@ public class SimpleIrdEntryListener implements AutoCloseable, DataTreeChangeList
     protected Future<Optional<Resource>> getValidResource(ResourceId rid,
                                                             InstanceIdentifier<Resource> iid,
                                                             ReadTransaction rx) {
-        ContextKey contextKey = new ContextKey(m_context);
-        ContextKey entryContextKey = new ContextKey(m_entryContext);
+        ContextKey contextKey = new ContextKey(context);
+        ContextKey entryContextKey = new ContextKey(entryContext);
         ResourceKey resourceKey = new ResourceKey(rid);
 
         ContextKey iidContextKey = iid.firstKeyOf(Context.class);
@@ -120,9 +120,10 @@ public class SimpleIrdEntryListener implements AutoCloseable, DataTreeChangeList
          * We examine the dependencies and check whether the services are self-contained
          */
 
-        ReadWriteTransaction rwx = m_dataBroker.newReadWriteTransaction();
+        ReadWriteTransaction rwx = dataBroker.newReadWriteTransaction();
 
-        InstanceIdentifier<IrdInstanceConfiguration> configIID = SimpleIrdUtils.getInstanceConfigurationIID(m_resource);
+        InstanceIdentifier<IrdInstanceConfiguration> configIID = SimpleIrdUtils.getInstanceConfigurationIID(
+            resourceId);
 
         Optional<IrdInstanceConfiguration> config;
         try {
@@ -132,7 +133,7 @@ public class SimpleIrdEntryListener implements AutoCloseable, DataTreeChangeList
             return;
         }
 
-        LOG.info("Finished reading data for {}", m_resource.getValue());
+        LOG.info("Finished reading data for {}", resourceId.getValue());
 
         if (config.isPresent()) {
             IrdInstanceConfiguration cfg = config.get();
@@ -345,10 +346,10 @@ public class SimpleIrdEntryListener implements AutoCloseable, DataTreeChangeList
         builder.fieldsFrom(cfg);
         builder.setIrdEntry(entries);
 
-        InstanceIdentifier<IrdInstance> iid = SimpleIrdUtils.getInstanceIID(m_resource);
+        InstanceIdentifier<IrdInstance> iid = SimpleIrdUtils.getInstanceIID(resourceId);
         rwx.put(LogicalDatastoreType.OPERATIONAL, iid, builder.build());
 
-        ResourcepoolUtils.updateResource(m_context, m_resource, dependencies, rwx);
+        ResourcepoolUtils.updateResource(context, resourceId, dependencies, rwx);
     }
 
     protected void cleanupIrdInstance(IrdInstanceConfiguration cfg,
@@ -362,14 +363,14 @@ public class SimpleIrdEntryListener implements AutoCloseable, DataTreeChangeList
 
         rwx.put(LogicalDatastoreType.OPERATIONAL, iid, builder.build());
 
-        ResourcepoolUtils.updateResource(m_context, m_resource, null, rwx);
+        ResourcepoolUtils.updateResource(context, resourceId, null, rwx);
     }
 
     @Override
     public synchronized void close() throws Exception {
         try {
-            if (m_reg != null) {
-                m_reg.close();
+            if (listenerReg != null) {
+                listenerReg.close();
             }
         } catch (Exception e) {
             LOG.info("Error while closing the registration");
index 3aada55a39899b6ec36fafe819d9a91e10ff873b..f96e39a7b6eabeddfbf43f8a32478ee348957a7a 100644 (file)
@@ -51,28 +51,28 @@ public class SimpleIrdListener implements AutoCloseable, DataTreeChangeListener<
 
     private static final Logger LOG = LoggerFactory.getLogger(SimpleIrdListener.class);
 
-    private DataBroker m_dataBroker = null;
-    private ListenerRegistration<?> m_reg = null;
-    private InstanceIdentifier<IrdInstanceConfiguration> m_iid = null;
-    private Uuid m_context = null;
+    private DataBroker mDataBroker = null;
+    private ListenerRegistration<?> mReg = null;
+    private InstanceIdentifier<IrdInstanceConfiguration> mIID = null;
+    private Uuid mContext = null;
 
-    private Map<ResourceId, SimpleIrdEntryListener> m_listeners = null;
-    private Map<ResourceId, SimpleIrdRfc7285DefaultNetworkMapListener> m_rfcListeners = null;
-    private Map<ResourceId, SimpleIrdRfc7285CostTypeListener> m_ctListeners = null;
+    private Map<ResourceId, SimpleIrdEntryListener> mListeners = null;
+    private Map<ResourceId, SimpleIrdRfc7285DefaultNetworkMapListener> mRfcListeners = null;
+    private Map<ResourceId, SimpleIrdRfc7285CostTypeListener> mCostTypeListeners = null;
 
     public SimpleIrdListener(Uuid context) {
-        m_listeners = new HashMap<>();
-        m_rfcListeners = new HashMap<>();
-        m_ctListeners = new HashMap<>();
-        m_context = context;
+        mListeners = new HashMap<>();
+        mRfcListeners = new HashMap<>();
+        mCostTypeListeners = new HashMap<>();
+        mContext = context;
     }
 
     public void register(DataBroker dataBroker, InstanceIdentifier<IrdInstanceConfiguration> iid) {
-        m_dataBroker = dataBroker;
-        m_iid = iid;
+        mDataBroker = dataBroker;
+        mIID = iid;
 
-        m_reg = m_dataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(
-                LogicalDatastoreType.CONFIGURATION, m_iid), this);
+        mReg = mDataBroker.registerDataTreeChangeListener(new DataTreeIdentifier<>(
+                LogicalDatastoreType.CONFIGURATION, mIID), this);
 
         LOG.info("SimpleIrdListener registered");
     }
@@ -88,7 +88,7 @@ public class SimpleIrdListener implements AutoCloseable, DataTreeChangeListener<
          *
          */
 
-        WriteTransaction wx = m_dataBroker.newWriteOnlyTransaction();
+        WriteTransaction wx = mDataBroker.newWriteOnlyTransaction();
 
         for (DataTreeModification<IrdInstanceConfiguration> change: changes) {
             final DataObjectModification<IrdInstanceConfiguration> rootNode = change.getRootNode();
@@ -97,11 +97,7 @@ public class SimpleIrdListener implements AutoCloseable, DataTreeChangeListener<
                 case SUBTREE_MODIFIED:
                     final IrdInstanceConfiguration original = rootNode.getDataBefore();
                     final IrdInstanceConfiguration updated = rootNode.getDataAfter();
-                    if (original == null) {
-                        createIrd(updated, wx);
-                    } else {
-                        updateIrd(original, updated, wx);
-                    }
+                    handleSubtreeModefication(original, updated, wx);
                     break;
                 case DELETE:
                     removeIrd(rootNode.getDataBefore(), wx);
@@ -114,12 +110,21 @@ public class SimpleIrdListener implements AutoCloseable, DataTreeChangeListener<
         wx.submit();
     }
 
+    protected void handleSubtreeModefication(IrdInstanceConfiguration original,
+            IrdInstanceConfiguration updated, WriteTransaction wx) {
+        if (original == null) {
+            createIrd(updated, wx);
+        } else {
+            updateIrd(original, updated, wx);
+        }
+    }
+
     protected void updateIrd(IrdInstanceConfiguration original,
                                 IrdInstanceConfiguration updated, WriteTransaction wx) {
         ResourceId rid = updated.getInstanceId();
 
         LOG.info("Updating Ird: " + "\n\tResource ID: " + rid.getValue());
-        SimpleIrdEntryListener listener = m_listeners.get(rid);
+        SimpleIrdEntryListener listener = mListeners.get(rid);
         if (listener != null) {
             if (original.getEntryContext().equals(updated.getEntryContext())) {
                 // Changes in resources is managed by another listener
@@ -144,28 +149,28 @@ public class SimpleIrdListener implements AutoCloseable, DataTreeChangeListener<
 
         LOG.info("Removing Ird: " + "\n\tResource ID: " + rid.getValue());
 
-        SimpleIrdEntryListener listener = m_listeners.get(rid);
+        SimpleIrdEntryListener listener = mListeners.get(rid);
         if (listener == null) {
             LOG.error("{} is not a valid Ird instance", rid.getValue());
             return;
         }
-        m_listeners.remove(rid);
+        mListeners.remove(rid);
 
-        SimpleIrdRfc7285DefaultNetworkMapListener rfcListener = m_rfcListeners.get(rid);
-        m_rfcListeners.remove(rid);
+        SimpleIrdRfc7285DefaultNetworkMapListener rfcListener = mRfcListeners.get(rid);
+        mRfcListeners.remove(rid);
 
-        SimpleIrdRfc7285CostTypeListener ctListener = m_ctListeners.get(rid);
-        m_ctListeners.remove(rid);
+        SimpleIrdRfc7285CostTypeListener ctListener = mCostTypeListeners.get(rid);
+        mCostTypeListeners.remove(rid);
 
         try {
             listener.close();
             rfcListener.close();
             ctListener.close();
         } catch (Exception e) {
-            LOG.error("Error while closing listener");
+            LOG.error("Error while closing listener", e);
         }
 
-        ResourcepoolUtils.deleteResource(m_context, rid, wx);
+        ResourcepoolUtils.deleteResource(mContext, rid, wx);
 
         InstanceIdentifier<IrdInstance> iid = SimpleIrdUtils.getInstanceIID(rid);
         wx.delete(LogicalDatastoreType.OPERATIONAL, iid);
@@ -196,6 +201,7 @@ public class SimpleIrdListener implements AutoCloseable, DataTreeChangeListener<
         ContextKey key = entryContextIID.firstKeyOf(Context.class);
         if (key == null) {
             LOG.error("Failed to create Ird: The entry-context must point to a certain context");
+            return;
         }
         Uuid entryContext = key.getContextId();
 
@@ -214,43 +220,43 @@ public class SimpleIrdListener implements AutoCloseable, DataTreeChangeListener<
 
         wx.put(LogicalDatastoreType.OPERATIONAL, iid, builder.build());
 
-        ResourcepoolUtils.createResource(m_context, rid, ResourceTypeIrd.class, wx);
-        ResourcepoolUtils.lazyUpdateResource(m_context, rid, wx);
+        ResourcepoolUtils.createResource(mContext, rid, ResourceTypeIrd.class, wx);
+        ResourcepoolUtils.lazyUpdateResource(mContext, rid, wx);
 
-        InstanceIdentifier<Resource> resourceIID = ResourcepoolUtils.getResourceIID(m_context, rid);
+        InstanceIdentifier<Resource> resourceIID = ResourcepoolUtils.getResourceIID(mContext, rid);
 
         SimpleIrdEntryListener listener;
         listener = new SimpleIrdEntryListener(resourceIID, entryContext);
-        listener.register(m_dataBroker, SimpleIrdUtils.getConfigEntryListIID(rid));
-        m_listeners.put(rid, listener);
+        listener.register(mDataBroker, SimpleIrdUtils.getConfigEntryListIID(rid));
+        mListeners.put(rid, listener);
 
         SimpleIrdRfc7285DefaultNetworkMapListener rfcListener;
         rfcListener = new SimpleIrdRfc7285DefaultNetworkMapListener();
-        rfcListener.register(m_dataBroker, rid);
-        m_rfcListeners.put(rid, rfcListener);
+        rfcListener.register(mDataBroker, rid);
+        mRfcListeners.put(rid, rfcListener);
 
         SimpleIrdRfc7285CostTypeListener ctListener;
         ctListener = new SimpleIrdRfc7285CostTypeListener();
-        ctListener.register(m_dataBroker, rid);
-        m_ctListeners.put(rid, ctListener);
+        ctListener.register(mDataBroker, rid);
+        mCostTypeListeners.put(rid, ctListener);
     }
 
     @Override
     public synchronized void close() throws Exception {
         try {
-            if (m_reg != null) {
-                m_reg.close();
+            if (mReg != null) {
+                mReg.close();
             }
         } catch (Exception e) {
-            LOG.info("Error while closing the registration");
+            LOG.info("Error while closing the registration", e);
         }
         try {
-            for (SimpleIrdEntryListener listener: m_listeners.values()) {
+            for (SimpleIrdEntryListener listener: mListeners.values()) {
                 listener.close();
             }
-            m_listeners.clear();
+            mListeners.clear();
         } catch (Exception e) {
-            LOG.info("Error while closing the registration");
+            LOG.info("Error while closing the registration", e);
         }
         LOG.info("SimpleIrdListener closed");
     }
index 62b35e2dcdfcef43166223d00e78462e2b3347e3..62086cc4be88c6f304befd291fdd48b4e6f1f862 100644 (file)
@@ -41,21 +41,21 @@ public class SimpleIrdRoute implements AltoNorthboundRoute {
 
     public static final String ALTO_IRD = "application/alto-directory+json";
 
-    private AltoSimpleIrdProvider m_provider = null;
+    private AltoSimpleIrdProvider provider = null;
 
     public SimpleIrdRoute(AltoSimpleIrdProvider provider) {
-        m_provider = provider;
+        this.provider = provider;
     }
 
     @Path("{path:.+}")
     @GET
     @Produces({ALTO_IRD, ALTO_ERROR})
     public Response route(@Context HttpServletRequest req, @PathParam("path") String path) {
-        if (m_provider == null) {
+        if (provider == null) {
             return Response.status(Response.Status.NOT_FOUND).build();
         }
 
-        IrdInstance ird = m_provider.getInstance(new ResourceId(path));
+        IrdInstance ird = provider.getInstance(new ResourceId(path));
         if (ird == null) {
             return Response.status(Response.Status.NOT_FOUND).build();
         }
index 9f52a7e9af954a4da2309d521437175b8aa21b31..b287e189185e75af2ff6ebc3f30491311105c776 100644 (file)
@@ -12,6 +12,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
 
 public class RFC7285VersionTag {
 
+    private final static char ILLEGAL = '$';
+
     @JsonProperty("resource-id")
     public String rid;
 
@@ -32,8 +34,6 @@ public class RFC7285VersionTag {
         return (rid == null) || (tag == null) || (rid == "") || (tag == "");
     }
 
-    private static char ILLEGAL = '$';
-
     @Override
     public int hashCode() {
         return (rid + ILLEGAL + tag).hashCode();
@@ -41,14 +41,18 @@ public class RFC7285VersionTag {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
         if (obj == null)
             return false;
 
+        if (this.getClass() != obj.getClass())
+            return false;
+
+        if (this == obj)
+            return true;
+
         RFC7285VersionTag other = (RFC7285VersionTag)obj;
-        boolean _rid = (rid == null ? (other.rid == null) : rid.equals(other.rid));
-        boolean _tag = (tag == null ? (other.tag == null) : tag.equals(other.tag));
-        return (_rid && _tag);
+        boolean ridTest = (rid == null ? (other.rid == null) : rid.equals(other.rid));
+        boolean tagTest = (tag == null ? (other.tag == null) : tag.equals(other.tag));
+        return (ridTest && tagTest);
     }
 }
diff --git a/alto-core/standard-northbound-routes/TODO b/alto-core/standard-northbound-routes/TODO
new file mode 100644 (file)
index 0000000..dd2de8d
--- /dev/null
@@ -0,0 +1,2 @@
+We are going to replace the northbound-route by Swagger/OpenAPI specification
+in the next release.
index 8f8009d804dd11bc99e9cc346912dc48635fef1e..a24cb3a78e47e619f60a8af26a6d32766c7b2dbc 100644 (file)
@@ -88,9 +88,10 @@ public class AltoNorthboundRouteCostmap implements AltoNorthboundRoute {
 
     private DataBroker dataBroker = null;
 
-    private AltoNorthboundRouter m_router = null;
+    private AltoNorthboundRouter router = null;
+
+    private static AltoModelCostmapService mapService = null;
 
-    private  static AltoModelCostmapService mapService = null;
     public void setDataBroker(DataBroker dataBroker) {
         this.dataBroker = dataBroker;
     }
@@ -111,12 +112,12 @@ public class AltoNorthboundRouteCostmap implements AltoNorthboundRoute {
     }
 
     public void register(AltoNorthboundRouter router) {
-        m_router = router;
-        m_router.addRoute("costmap", new AltoNorthboundRouteCostmap());
+        this.router = router;
+        this.router.addRoute(COSTMAP_ROUTE, new AltoNorthboundRouteCostmap());
     }
 
     public void close() {
-        m_router.removeRoute("costmap");
+        router.removeRoute(COSTMAP_ROUTE);
     }
 
     @Path("{path}")
index e387c4aaf6fb9705d729da3f3dfd68837aee704f..f77c0ada5e35e62f1afb1f03f5352c91a1d2dc93 100644 (file)
@@ -12,11 +12,9 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   odl:use-default-for-reference-types="true">
   <odl:rpc-service id='altoModelCostmapService'
     interface='org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.AltoModelCostmapService' />
-  <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"/>
   <bean id="provider"
     class="org.opendaylight.alto.core.northbound.route.costmap.impl.AltoNorthboundRouteCostmap"
     init-method="init" destroy-method="close">
     <property name='mapService' ref='altoModelCostmapService' />
-    <property name="dataBroker" ref="dataBroker" />
   </bean>
 </blueprint>