ONOS-3023 Changing flowTable sets to map so that we can compare
stored vs. new rule when adding and removing
Change-Id: Ibd885023d550af3b2220056fbdf44ad8ec7fefda
diff --git a/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java b/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
index 63ee03e..269d6b4 100644
--- a/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
+++ b/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
@@ -311,6 +311,7 @@
} catch (UnsupportedOperationException e) {
log.warn(e.getMessage());
if (flowRule instanceof DefaultFlowEntry) {
+ //FIXME modification of "stored" flow entry outside of store
((DefaultFlowEntry) flowRule).setState(FlowEntry.FlowEntryState.FAILED);
}
}
@@ -323,10 +324,8 @@
log.debug("Flow {} removed", flowRule);
post(event);
}
-
}
-
private void extraneousFlow(FlowRule flowRule) {
checkNotNull(flowRule, FLOW_RULE_NULL);
checkValidity();
@@ -335,13 +334,11 @@
log.debug("Flow {} is on switch but not in store.", flowRule);
}
-
private void flowAdded(FlowEntry flowEntry) {
checkNotNull(flowEntry, FLOW_RULE_NULL);
checkValidity();
if (checkRuleLiveness(flowEntry, store.getFlowEntry(flowEntry))) {
-
FlowRuleEvent event = store.addOrUpdateFlowRule(flowEntry);
if (event == null) {
log.debug("No flow store event generated.");
@@ -353,7 +350,6 @@
log.debug("Removing flow rules....");
removeFlowRules(flowEntry);
}
-
}
private boolean checkRuleLiveness(FlowEntry swRule, FlowEntry storedRule) {