@Test public void applyFlowRules() { FlowRule r1 = flowRule(1, 1); FlowRule r2 = flowRule(2, 2); FlowRule r3 = flowRule(3, 3); assertTrue("store should be empty", Sets.newHashSet(service.getFlowEntries(DID)).isEmpty()); mgr.applyFlowRules(r1, r2, r3); assertEquals("3 rules should exist", 3, flowCount()); assertTrue("Entries should be pending add.", validateState(ImmutableMap.of( r1, FlowEntryState.PENDING_ADD, r2, FlowEntryState.PENDING_ADD, r3, FlowEntryState.PENDING_ADD))); }
@Override public void applyFlowRules(FlowRule... flowRules) { checkPermission(FLOWRULE_WRITE); FlowRuleOperations.Builder builder = FlowRuleOperations.builder(); for (FlowRule flowRule : flowRules) { builder.add(flowRule); } apply(builder.build()); }
FlowRuleManager extends AbstractListenerProviderRegistry<FlowRuleEvent, FlowRuleListener,
                                                 FlowRuleProvider, FlowRuleProviderService> implements FlowRuleService, FlowRuleProviderRegistry { @Override public void applyFlowRules(FlowRule... flowRules) { checkPermission(FLOWRULE_WRITE); FlowRuleOperations.Builder builder = FlowRuleOperations.builder(); for (FlowRule flowRule : flowRules) { builder.add(flowRule); } apply(builder.build()); } }
FlowRuleManager extends AbstractListenerProviderRegistry<FlowRuleEvent, FlowRuleListener,
                                                 FlowRuleProvider, FlowRuleProviderService> implements FlowRuleService, FlowRuleProviderRegistry { @Override public void applyFlowRules(FlowRule... flowRules) { checkPermission(FLOWRULE_WRITE); FlowRuleOperations.Builder builder = FlowRuleOperations.builder(); for (FlowRule flowRule : flowRules) { builder.add(flowRule); } apply(builder.build()); }  }
FlowRuleManager extends AbstractListenerProviderRegistry<FlowRuleEvent, FlowRuleListener,
                                                 FlowRuleProvider, FlowRuleProviderService> implements FlowRuleService, FlowRuleProviderRegistry { @Override public void applyFlowRules(FlowRule... flowRules) { checkPermission(FLOWRULE_WRITE); FlowRuleOperations.Builder builder = FlowRuleOperations.builder(); for (FlowRule flowRule : flowRules) { builder.add(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 applyFlowRules(FlowRule... flowRules) { checkPermission(FLOWRULE_WRITE); FlowRuleOperations.Builder builder = FlowRuleOperations.builder(); for (FlowRule flowRule : flowRules) { builder.add(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; }