* Implement method FlowManager::reconcileFlows()
Note: for simplicity, we don't compare the old and the new paths,
because it is error-prone.
Instead, we delete all old flow entries, and add the new flow entries,
even if some of those entries haven't changed.
In the future we should perform the appropriate comparison.
* Change addAndMaintainShortestPathFlow() to return the computed
(shortest) flow path.
diff --git a/src/main/java/net/floodlightcontroller/flowcache/web/AddShortestPathFlowResource.java b/src/main/java/net/floodlightcontroller/flowcache/web/AddShortestPathFlowResource.java
index e00a4b5..3c5bcd8 100644
--- a/src/main/java/net/floodlightcontroller/flowcache/web/AddShortestPathFlowResource.java
+++ b/src/main/java/net/floodlightcontroller/flowcache/web/AddShortestPathFlowResource.java
@@ -52,10 +52,12 @@
// Process the request
if (flowPath != null) {
- if (flowService.addAndMaintainShortestPathFlow(flowPath, result)
- != true) {
+ FlowPath addedFlowPath =
+ flowService.addAndMaintainShortestPathFlow(flowPath);
+ if (addedFlowPath == null)
result = new FlowId(); // Error: Return empty Flow Id
- }
+ else
+ result = addedFlowPath.flowId();
}
return result;