@Test public void removeFlowRules() { FlowRule f1 = addFlowRule(1); FlowRule f2 = addFlowRule(2); FlowRule f3 = addFlowRule(3); assertEquals("3 rules should exist", 3, flowCount()); FlowEntry fe1 = new DefaultFlowEntry(f1); FlowEntry fe2 = new DefaultFlowEntry(f2); FlowEntry fe3 = new DefaultFlowEntry(f3); providerService.pushFlowMetrics(DID, ImmutableList.of(fe1, fe2, fe3)); validateEvents(RULE_ADD_REQUESTED, RULE_ADD_REQUESTED, RULE_ADD_REQUESTED, RULE_ADDED, RULE_ADDED, RULE_ADDED); mgr.removeFlowRules(f1, f2); validateEvents(RULE_REMOVE_REQUESTED, RULE_REMOVE_REQUESTED); assertEquals("3 rule should exist", 3, flowCount()); assertTrue("Entries should be pending remove.", validateState(ImmutableMap.of( f1, FlowEntryState.PENDING_REMOVE, f2, FlowEntryState.PENDING_REMOVE, f3, FlowEntryState.ADDED))); mgr.removeFlowRules(f1); assertEquals("3 rule should still exist", 3, flowCount()); }
@Override public void removeFlowRules(FlowRule... flowRules) { checkPermission(FLOWRULE_WRITE); FlowRuleOperations.Builder builder = FlowRuleOperations.builder(); for (FlowRule flowRule : flowRules) { builder.remove(flowRule); } apply(builder.build()); }
FlowRuleManager extends AbstractListenerProviderRegistry<FlowRuleEvent, FlowRuleListener,
                                                 FlowRuleProvider, FlowRuleProviderService> implements FlowRuleService, FlowRuleProviderRegistry { @Override public void removeFlowRules(FlowRule... flowRules) { checkPermission(FLOWRULE_WRITE); FlowRuleOperations.Builder builder = FlowRuleOperations.builder(); for (FlowRule flowRule : flowRules) { builder.remove(flowRule); } apply(builder.build()); } }
FlowRuleManager extends AbstractListenerProviderRegistry<FlowRuleEvent, FlowRuleListener,
                                                 FlowRuleProvider, FlowRuleProviderService> implements FlowRuleService, FlowRuleProviderRegistry { @Override public void removeFlowRules(FlowRule... flowRules) { checkPermission(FLOWRULE_WRITE); FlowRuleOperations.Builder builder = FlowRuleOperations.builder(); for (FlowRule flowRule : flowRules) { builder.remove(flowRule); } apply(builder.build()); }  }
FlowRuleManager extends AbstractListenerProviderRegistry<FlowRuleEvent, FlowRuleListener,
                                                 FlowRuleProvider, FlowRuleProviderService> implements FlowRuleService, FlowRuleProviderRegistry { @Override public void removeFlowRules(FlowRule... flowRules) { checkPermission(FLOWRULE_WRITE); FlowRuleOperations.Builder builder = FlowRuleOperations.builder(); for (FlowRule flowRule : flowRules) { builder.remove(flowRule); } apply(builder.build()); }  @Activate void activate(ComponentContext context); @Deactivate void deactivate(); @Modified void modified(ComponentContext context); @Override int getFlowRuleCount(); @Override Iterable<FlowEntry> getFlowEntries(DeviceId deviceId); @Override void applyFlowRules(FlowRule... flowRules); @Override void removeFlowRules(FlowRule... flowRules); @Override void removeFlowRulesById(ApplicationId id); @Override Iterable<FlowRule> getFlowRulesById(ApplicationId id); @Override Iterable<FlowRule> getFlowRulesByGroupId(ApplicationId appId, short groupId); @Override void apply(FlowRuleOperations ops); @Override Iterable<TableStatisticsEntry> getFlowTableStatistics(DeviceId deviceId); }
FlowRuleManager extends AbstractListenerProviderRegistry<FlowRuleEvent, FlowRuleListener,
                                                 FlowRuleProvider, FlowRuleProviderService> implements FlowRuleService, FlowRuleProviderRegistry { @Override public void removeFlowRules(FlowRule... flowRules) { checkPermission(FLOWRULE_WRITE); FlowRuleOperations.Builder builder = FlowRuleOperations.builder(); for (FlowRule flowRule : flowRules) { builder.remove(flowRule); } apply(builder.build()); }  @Activate void activate(ComponentContext context); @Deactivate void deactivate(); @Modified void modified(ComponentContext context); @Override int getFlowRuleCount(); @Override Iterable<FlowEntry> getFlowEntries(DeviceId deviceId); @Override void applyFlowRules(FlowRule... flowRules); @Override void removeFlowRules(FlowRule... flowRules); @Override void removeFlowRulesById(ApplicationId id); @Override Iterable<FlowRule> getFlowRulesById(ApplicationId id); @Override Iterable<FlowRule> getFlowRulesByGroupId(ApplicationId appId, short groupId); @Override void apply(FlowRuleOperations ops); @Override Iterable<TableStatisticsEntry> getFlowTableStatistics(DeviceId deviceId); static final String FLOW_RULE_NULL; }