* Now the FlowManager depends on the DatagridService as well.
* Use the Floodlight ITopologyNetService service implementation
instead of allocating a new TopologyManager.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
index b3b7399..1215558 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
@@ -27,6 +27,8 @@
import net.floodlightcontroller.restserver.IRestApiService;
import net.floodlightcontroller.util.MACAddress;
import net.floodlightcontroller.util.OFMessageDamper;
+
+import net.onrc.onos.datagrid.IDatagridService;
import net.onrc.onos.graph.GraphDBOperation;
import net.onrc.onos.ofcontroller.core.INetMapStorage;
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
@@ -73,9 +75,10 @@
protected GraphDBOperation op;
- protected IRestApiService restApi;
protected volatile IFloodlightProviderService floodlightProvider;
protected volatile ITopologyNetService topologyNetService;
+ protected volatile IDatagridService datagridService;
+ protected IRestApiService restApi;
protected FloodlightModuleContext context;
protected OFMessageDamper messageDamper;
@@ -431,7 +434,6 @@
@Override
public void init(String conf) {
op = new GraphDBOperation(conf);
- topologyNetService = new TopologyManager(conf);
}
/**
@@ -490,6 +492,7 @@
new ArrayList<Class<? extends IFloodlightService>>();
l.add(IFloodlightProviderService.class);
l.add(INetworkGraphService.class);
+ l.add(IDatagridService.class);
l.add(IRestApiService.class);
return l;
}
@@ -504,7 +507,10 @@
throws FloodlightModuleException {
this.context = context;
floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class);
+ topologyNetService = context.getServiceImpl(ITopologyNetService.class);
+ datagridService = context.getServiceImpl(IDatagridService.class);
restApi = context.getServiceImpl(IRestApiService.class);
+
messageDamper = new OFMessageDamper(OFMESSAGE_DAMPER_CAPACITY,
EnumSet.of(OFType.FLOW_MOD),
OFMESSAGE_DAMPER_TIMEOUT);
diff --git a/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java b/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java
index 03cc756..cc67f6a 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java
@@ -696,7 +696,7 @@
// verify the test
verifyAll();
- assertEquals(3, md.size());
+ assertEquals(4, md.size());
assertTrue(md.contains(IFloodlightProviderService.class));
assertTrue(md.contains(IRestApiService.class));
}