Add support for deleting or clearing all flows:
web/delete_flow.py all
web/clear_flow.py all
diff --git a/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java b/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java
index cce873a..251620c 100644
--- a/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java
+++ b/src/main/java/net/floodlightcontroller/flowcache/FlowManager.java
@@ -751,6 +751,23 @@
}
/**
+ * Delete all previously added flows.
+ *
+ * @return true on success, otherwise false.
+ */
+ @Override
+ public boolean deleteAllFlows() {
+
+ // Get all flows and delete them one-by-one
+ ArrayList<FlowPath> allFlows = getAllFlows();
+ for (FlowPath flowPath : allFlows) {
+ deleteFlow(flowPath.flowId());
+ }
+
+ return true;
+ }
+
+ /**
* Delete a previously added flow.
*
* @param flowId the Flow ID of the flow to delete.
@@ -813,6 +830,23 @@
}
/**
+ * Clear the state for all previously added flows.
+ *
+ * @return true on success, otherwise false.
+ */
+ @Override
+ public boolean clearAllFlows() {
+
+ // Get all flows and clear them one-by-one
+ ArrayList<FlowPath> allFlows = getAllFlows();
+ for (FlowPath flowPath : allFlows) {
+ clearFlow(flowPath.flowId());
+ }
+
+ return true;
+ }
+
+ /**
* Clear the state for a previously added flow.
*
* @param flowId the Flow ID of the flow to clear.