use of org.projectfloodlight.openflow.types.TableId in project open-kilda by telstra.
the class SwitchManager method removeFlowByOfFlowDelete.
private List<Long> removeFlowByOfFlowDelete(DatapathId dpid, int tableId, OFFlowDelete dropFlowDelete) throws SwitchOperationException {
List<OFFlowStatsEntry> flowStatsBefore = dumpFlowTable(dpid, tableId);
IOFSwitch sw = lookupSwitch(dpid);
pushFlow(sw, "--DeleteFlow--", dropFlowDelete);
// Wait for OFFlowDelete to be processed.
sendBarrierRequest(sw);
List<OFFlowStatsEntry> flowStatsAfter = dumpFlowTable(dpid, tableId);
Set<Long> cookiesAfter = flowStatsAfter.stream().map(entry -> entry.getCookie().getValue()).collect(toSet());
return flowStatsBefore.stream().map(entry -> entry.getCookie().getValue()).filter(cookie -> !cookiesAfter.contains(cookie)).peek(cookie -> logger.info("Rule with cookie {} has been removed from switch {}.", cookie, dpid)).collect(toList());
}
Aggregations