@Test public void convertFlowWithIngressVlanIdMatchesTransitVlanId() { Flow flow = buildFlow(FlowEncapsulationType.TRANSIT_VLAN); Assert.assertNotEquals(0, flow.getSrcVlan()); Assert.assertNotNull(flow.getForwardPath()); TransitVlan encapsulation = TransitVlan.builder() .flowId(flow.getFlowId()) .pathId(flow.getForwardPathId()) .vlan(flow.getSrcVlan()) .build(); List<SimpleSwitchRule> pathView = simpleSwitchRuleConverter.convertFlowPathToSimpleSwitchRules( flow, flow.getForwardPath(), encapsulation, MIN_BURST_SIZE_IN_KBITS, BURST_COEFFICIENT); Assert.assertFalse(pathView.isEmpty()); SimpleSwitchRule ingress = pathView.get(0); Assert.assertEquals(Collections.emptyList(), ingress.getOutVlan()); }
public List<SimpleSwitchRule> convertFlowPathToSimpleSwitchRules(Flow flow, FlowPath flowPath, EncapsulationId encapsulationId, long flowMeterMinBurstSizeInKbits, double flowMeterBurstCoefficient) { List<SimpleSwitchRule> rules = new ArrayList<>(); if (!flowPath.isProtected()) { rules.add(buildIngressSimpleSwitchRule(flow, flowPath, encapsulationId, flowMeterMinBurstSizeInKbits, flowMeterBurstCoefficient)); } if (! flow.isOneSwitchFlow()) { rules.addAll(buildTransitAndEgressSimpleSwitchRules(flow, flowPath, encapsulationId)); } return rules; }
SimpleSwitchRuleConverter { public List<SimpleSwitchRule> convertFlowPathToSimpleSwitchRules(Flow flow, FlowPath flowPath, EncapsulationId encapsulationId, long flowMeterMinBurstSizeInKbits, double flowMeterBurstCoefficient) { List<SimpleSwitchRule> rules = new ArrayList<>(); if (!flowPath.isProtected()) { rules.add(buildIngressSimpleSwitchRule(flow, flowPath, encapsulationId, flowMeterMinBurstSizeInKbits, flowMeterBurstCoefficient)); } if (! flow.isOneSwitchFlow()) { rules.addAll(buildTransitAndEgressSimpleSwitchRules(flow, flowPath, encapsulationId)); } return rules; } }
SimpleSwitchRuleConverter { public List<SimpleSwitchRule> convertFlowPathToSimpleSwitchRules(Flow flow, FlowPath flowPath, EncapsulationId encapsulationId, long flowMeterMinBurstSizeInKbits, double flowMeterBurstCoefficient) { List<SimpleSwitchRule> rules = new ArrayList<>(); if (!flowPath.isProtected()) { rules.add(buildIngressSimpleSwitchRule(flow, flowPath, encapsulationId, flowMeterMinBurstSizeInKbits, flowMeterBurstCoefficient)); } if (! flow.isOneSwitchFlow()) { rules.addAll(buildTransitAndEgressSimpleSwitchRules(flow, flowPath, encapsulationId)); } return rules; }  }
SimpleSwitchRuleConverter { public List<SimpleSwitchRule> convertFlowPathToSimpleSwitchRules(Flow flow, FlowPath flowPath, EncapsulationId encapsulationId, long flowMeterMinBurstSizeInKbits, double flowMeterBurstCoefficient) { List<SimpleSwitchRule> rules = new ArrayList<>(); if (!flowPath.isProtected()) { rules.add(buildIngressSimpleSwitchRule(flow, flowPath, encapsulationId, flowMeterMinBurstSizeInKbits, flowMeterBurstCoefficient)); } if (! flow.isOneSwitchFlow()) { rules.addAll(buildTransitAndEgressSimpleSwitchRules(flow, flowPath, encapsulationId)); } return rules; }  List<SimpleSwitchRule> convertFlowPathToSimpleSwitchRules(Flow flow, FlowPath flowPath,
                                                                     EncapsulationId encapsulationId,
                                                                     long flowMeterMinBurstSizeInKbits,
                                                                     double flowMeterBurstCoefficient); List<SimpleSwitchRule> convertSwitchFlowEntriesToSimpleSwitchRules(SwitchFlowEntries rules,
                                                                              SwitchMeterEntries meters); }
SimpleSwitchRuleConverter { public List<SimpleSwitchRule> convertFlowPathToSimpleSwitchRules(Flow flow, FlowPath flowPath, EncapsulationId encapsulationId, long flowMeterMinBurstSizeInKbits, double flowMeterBurstCoefficient) { List<SimpleSwitchRule> rules = new ArrayList<>(); if (!flowPath.isProtected()) { rules.add(buildIngressSimpleSwitchRule(flow, flowPath, encapsulationId, flowMeterMinBurstSizeInKbits, flowMeterBurstCoefficient)); } if (! flow.isOneSwitchFlow()) { rules.addAll(buildTransitAndEgressSimpleSwitchRules(flow, flowPath, encapsulationId)); } return rules; }  List<SimpleSwitchRule> convertFlowPathToSimpleSwitchRules(Flow flow, FlowPath flowPath,
                                                                     EncapsulationId encapsulationId,
                                                                     long flowMeterMinBurstSizeInKbits,
                                                                     double flowMeterBurstCoefficient); List<SimpleSwitchRule> convertSwitchFlowEntriesToSimpleSwitchRules(SwitchFlowEntries rules,
                                                                              SwitchMeterEntries meters);  }