REST API for flow summary /wm/flow/getsummary/{0}/{0}/json
Check network map for missing link even on update link in link discovery to address issue 249
Only the master controller should delete links to address issue 249
diff --git a/src/main/java/net/floodlightcontroller/flowcache/web/GetSummaryFlowsResource.java b/src/main/java/net/floodlightcontroller/flowcache/web/GetSummaryFlowsResource.java
index 74a44d4..7a928c9 100644
--- a/src/main/java/net/floodlightcontroller/flowcache/web/GetSummaryFlowsResource.java
+++ b/src/main/java/net/floodlightcontroller/flowcache/web/GetSummaryFlowsResource.java
@@ -12,12 +12,15 @@
 import org.slf4j.LoggerFactory;
 
 public class GetSummaryFlowsResource extends ServerResource {
-    protected static Logger log = LoggerFactory.getLogger(GetAllFlowsResource.class);
+    protected static Logger log = LoggerFactory.getLogger(GetSummaryFlowsResource.class);
 
     @Get("json")
     public ArrayList<FlowPath> retrieve() {
     	ArrayList<FlowPath> result = null;
     	
+    	FlowId flowId;
+    	int maxFlows = 0;
+    	
     	IFlowService flowService = (IFlowService)getContext().getAttributes().get(IFlowService.class.getCanonicalName());
 
         if (flowService == null) {
@@ -26,11 +29,15 @@
         }
 
         // Extract the arguments
-        log.debug("Get All Flows Endpoints");
+    	String flowIdStr = (String) getRequestAttributes().get("flow-id");
+    	String maxFlowStr = (String) getRequestAttributes().get("max-flows");
+    	log.debug("Get Summary Flows starting flow-id: " + flowIdStr + " max-flows: " + maxFlowStr);
+    	
+    	flowId = new FlowId(flowIdStr);
+    	maxFlows = Integer.parseInt(maxFlowStr);
+    	if (maxFlows < 0) maxFlows = 0;
 
-        FlowId flowId = new FlowId(0);
-        
-        result = flowService.getAllFlowsSummary(flowId, 0);
+        result = flowService.getAllFlowsSummary(flowId, maxFlows);
 
         return result;
     }