@Test public void testVlanFlowCreation() { LOG.info("SfcOfRspProcessorTest testVlanFlowCreation"); RenderedServicePath vlanRsp = rspBuilder.createRspFromSfTypes(this.sfTypes, Mac.class, Transport.class); this.sfcOfRspProcessor.processRenderedServicePath(vlanRsp); assertMatchAnyMethodsCalled("SFF_0"); assertMatchAnyMethodsCalled("SFF_1"); verify(this.flowProgrammerTestMoc, times(1)).setTableIndexMapper(anyObject()); verify(this.flowProgrammerTestMoc, atLeastOnce()).setFlowRspId(anyLong()); verify(this.flowProgrammerTestMoc, atLeastOnce()).setFlowWriter((SfcOfFlowWriterInterface) anyObject()); verify(this.flowProgrammerTestMoc, times(2)).configureVlanTransportIngressFlow("SFF_0"); verify(this.flowProgrammerTestMoc, times(2)).configureVlanTransportIngressFlow("SFF_1"); verify(this.flowProgrammerTestMoc, times(1)).configureVlanPathMapperFlow(eq("SFF_0"), anyInt(), eq((long) 0), eq(false)); verify(this.flowProgrammerTestMoc, times(1)).configureVlanPathMapperFlow(eq("SFF_1"), anyInt(), eq((long) 0), eq(false)); verify(this.flowProgrammerTestMoc, times(1)).configureVlanPathMapperFlow("SFF_0", 2, 0, true); verify(this.flowProgrammerTestMoc, times(1)).configureVlanPathMapperFlow("SFF_1", 3, 0, true); verify(this.flowProgrammerTestMoc, times(1)).configureMacNextHopFlow("SFF_0", 0, null, "00:00:00:00:00:00"); verify(this.flowProgrammerTestMoc, times(1)).configureMacNextHopFlow("SFF_0", 0, "00:00:00:00:00:00", "00:00:00:00:00:07"); verify(this.flowProgrammerTestMoc, times(1)).configureMacNextHopFlow("SFF_1", 0, "00:00:00:00:00:04", "00:00:00:00:00:05"); verify(this.flowProgrammerTestMoc, times(2)).configureMacNextHopFlow("SFF_1", 0, "00:00:00:00:00:05", null); verify(this.flowProgrammerTestMoc, times(1)).configureVlanTransportEgressFlow( eq("SFF_0"), eq("00:00:00:00:00:04"), eq("00:00:00:00:00:07"), anyInt(), eq("1"), eq((long) 0)); verify(this.flowProgrammerTestMoc, times(1)).configureVlanLastHopTransportEgressFlow( eq("SFF_1"), eq("00:00:00:00:00:09"), eq((String) null), anyInt(), eq("1"), eq((long) 0)); verify(this.flowProgrammerTestMoc, times(1)).configureVlanSfTransportEgressFlow( "SFF_0", "00:00:00:00:00:02", "00:00:00:00:00:00", 2, "1", 0, false); verify(this.flowProgrammerTestMoc, times(1)).configureVlanSfTransportEgressFlow( "SFF_1", "00:00:00:00:00:07", "00:00:00:00:00:05", 3, "1", 0, false); verify(this.flowProgrammerTestMoc).flushFlows(); verify(this.flowProgrammerTestMoc).purgeFlows(); verifyNoMoreInteractions(this.flowProgrammerTestMoc); }
public void processRenderedServicePath(RenderedServicePath rsp) { try { sfcSynchronizer.lock(); sfcOfProviderUtils.addRsp(rsp.getPathId()); SffGraph sffGraph = populateSffGraph(rsp); SfcRspTransportProcessorBase transportProcessor = getTransportProcessor(sffGraph, rsp); transportProcessor.processSffDpls(); transportProcessor.setRspTransports(); SffGraph.SffGraphEntry entry = null; Iterator<SffGraph.SffGraphEntry> sffGraphIter = sffGraph.getGraphEntryIterator(); sfcOfFlowProgrammer.setTableIndexMapper( transportProcessor.getTableIndexMapper().isPresent() ? transportProcessor.getTableIndexMapper().get() : null); while (sffGraphIter.hasNext()) { entry = sffGraphIter.next(); LOG.debug("build flows of entry: {}", entry); sfcOfFlowProgrammer.setFlowRspId(OpenflowConstants.SFC_FLOWS); initializeSff(entry, transportProcessor); sfcOfFlowProgrammer.setFlowRspId(rsp.getPathId()); configureTransportIngressFlows(entry, sffGraph, transportProcessor); configurePathMapperFlows(entry, sffGraph, transportProcessor); configureNextHopFlows(entry, sffGraph, transportProcessor); configureTransportEgressFlows(entry, sffGraph, transportProcessor); } this.sfcOfFlowProgrammer.flushFlows(); transportProcessor.updateOperationalDSInfo(sffGraph, rsp); LOG.info("Processing complete for RSP: name [{}] Id [{}]", rsp.getName(), rsp.getPathId()); } catch (SfcRenderingException e) { LOG.error("SfcRenderingException in processRenderedServicePath: ", e.getMessage(), e); } finally { this.sfcOfFlowProgrammer.purgeFlows(); sfcSynchronizer.unlock(); sfcOfProviderUtils.removeRsp(rsp.getPathId()); } }
SfcOfRspProcessor { public void processRenderedServicePath(RenderedServicePath rsp) { try { sfcSynchronizer.lock(); sfcOfProviderUtils.addRsp(rsp.getPathId()); SffGraph sffGraph = populateSffGraph(rsp); SfcRspTransportProcessorBase transportProcessor = getTransportProcessor(sffGraph, rsp); transportProcessor.processSffDpls(); transportProcessor.setRspTransports(); SffGraph.SffGraphEntry entry = null; Iterator<SffGraph.SffGraphEntry> sffGraphIter = sffGraph.getGraphEntryIterator(); sfcOfFlowProgrammer.setTableIndexMapper( transportProcessor.getTableIndexMapper().isPresent() ? transportProcessor.getTableIndexMapper().get() : null); while (sffGraphIter.hasNext()) { entry = sffGraphIter.next(); LOG.debug("build flows of entry: {}", entry); sfcOfFlowProgrammer.setFlowRspId(OpenflowConstants.SFC_FLOWS); initializeSff(entry, transportProcessor); sfcOfFlowProgrammer.setFlowRspId(rsp.getPathId()); configureTransportIngressFlows(entry, sffGraph, transportProcessor); configurePathMapperFlows(entry, sffGraph, transportProcessor); configureNextHopFlows(entry, sffGraph, transportProcessor); configureTransportEgressFlows(entry, sffGraph, transportProcessor); } this.sfcOfFlowProgrammer.flushFlows(); transportProcessor.updateOperationalDSInfo(sffGraph, rsp); LOG.info("Processing complete for RSP: name [{}] Id [{}]", rsp.getName(), rsp.getPathId()); } catch (SfcRenderingException e) { LOG.error("SfcRenderingException in processRenderedServicePath: ", e.getMessage(), e); } finally { this.sfcOfFlowProgrammer.purgeFlows(); sfcSynchronizer.unlock(); sfcOfProviderUtils.removeRsp(rsp.getPathId()); } } }
SfcOfRspProcessor { public void processRenderedServicePath(RenderedServicePath rsp) { try { sfcSynchronizer.lock(); sfcOfProviderUtils.addRsp(rsp.getPathId()); SffGraph sffGraph = populateSffGraph(rsp); SfcRspTransportProcessorBase transportProcessor = getTransportProcessor(sffGraph, rsp); transportProcessor.processSffDpls(); transportProcessor.setRspTransports(); SffGraph.SffGraphEntry entry = null; Iterator<SffGraph.SffGraphEntry> sffGraphIter = sffGraph.getGraphEntryIterator(); sfcOfFlowProgrammer.setTableIndexMapper( transportProcessor.getTableIndexMapper().isPresent() ? transportProcessor.getTableIndexMapper().get() : null); while (sffGraphIter.hasNext()) { entry = sffGraphIter.next(); LOG.debug("build flows of entry: {}", entry); sfcOfFlowProgrammer.setFlowRspId(OpenflowConstants.SFC_FLOWS); initializeSff(entry, transportProcessor); sfcOfFlowProgrammer.setFlowRspId(rsp.getPathId()); configureTransportIngressFlows(entry, sffGraph, transportProcessor); configurePathMapperFlows(entry, sffGraph, transportProcessor); configureNextHopFlows(entry, sffGraph, transportProcessor); configureTransportEgressFlows(entry, sffGraph, transportProcessor); } this.sfcOfFlowProgrammer.flushFlows(); transportProcessor.updateOperationalDSInfo(sffGraph, rsp); LOG.info("Processing complete for RSP: name [{}] Id [{}]", rsp.getName(), rsp.getPathId()); } catch (SfcRenderingException e) { LOG.error("SfcRenderingException in processRenderedServicePath: ", e.getMessage(), e); } finally { this.sfcOfFlowProgrammer.purgeFlows(); sfcSynchronizer.unlock(); sfcOfProviderUtils.removeRsp(rsp.getPathId()); } } SfcOfRspProcessor(
            SfcOfFlowProgrammerInterface sfcOfFlowProgrammer,
            SfcOfBaseProviderUtils sfcOfProviderUtils,
            SfcSynchronizer sfcSynchronizer,
            RpcProviderRegistry rpcProviderRegistry,
            DataBroker dataBroker); }
SfcOfRspProcessor { public void processRenderedServicePath(RenderedServicePath rsp) { try { sfcSynchronizer.lock(); sfcOfProviderUtils.addRsp(rsp.getPathId()); SffGraph sffGraph = populateSffGraph(rsp); SfcRspTransportProcessorBase transportProcessor = getTransportProcessor(sffGraph, rsp); transportProcessor.processSffDpls(); transportProcessor.setRspTransports(); SffGraph.SffGraphEntry entry = null; Iterator<SffGraph.SffGraphEntry> sffGraphIter = sffGraph.getGraphEntryIterator(); sfcOfFlowProgrammer.setTableIndexMapper( transportProcessor.getTableIndexMapper().isPresent() ? transportProcessor.getTableIndexMapper().get() : null); while (sffGraphIter.hasNext()) { entry = sffGraphIter.next(); LOG.debug("build flows of entry: {}", entry); sfcOfFlowProgrammer.setFlowRspId(OpenflowConstants.SFC_FLOWS); initializeSff(entry, transportProcessor); sfcOfFlowProgrammer.setFlowRspId(rsp.getPathId()); configureTransportIngressFlows(entry, sffGraph, transportProcessor); configurePathMapperFlows(entry, sffGraph, transportProcessor); configureNextHopFlows(entry, sffGraph, transportProcessor); configureTransportEgressFlows(entry, sffGraph, transportProcessor); } this.sfcOfFlowProgrammer.flushFlows(); transportProcessor.updateOperationalDSInfo(sffGraph, rsp); LOG.info("Processing complete for RSP: name [{}] Id [{}]", rsp.getName(), rsp.getPathId()); } catch (SfcRenderingException e) { LOG.error("SfcRenderingException in processRenderedServicePath: ", e.getMessage(), e); } finally { this.sfcOfFlowProgrammer.purgeFlows(); sfcSynchronizer.unlock(); sfcOfProviderUtils.removeRsp(rsp.getPathId()); } } SfcOfRspProcessor(
            SfcOfFlowProgrammerInterface sfcOfFlowProgrammer,
            SfcOfBaseProviderUtils sfcOfProviderUtils,
            SfcSynchronizer sfcSynchronizer,
            RpcProviderRegistry rpcProviderRegistry,
            DataBroker dataBroker); void processRenderedServicePath(RenderedServicePath rsp); void deleteRenderedServicePath(RenderedServicePath rsp); SfcRspTransportProcessorBase getTransportProcessor(SffGraph sffGraph, RenderedServicePath rsp); }
SfcOfRspProcessor { public void processRenderedServicePath(RenderedServicePath rsp) { try { sfcSynchronizer.lock(); sfcOfProviderUtils.addRsp(rsp.getPathId()); SffGraph sffGraph = populateSffGraph(rsp); SfcRspTransportProcessorBase transportProcessor = getTransportProcessor(sffGraph, rsp); transportProcessor.processSffDpls(); transportProcessor.setRspTransports(); SffGraph.SffGraphEntry entry = null; Iterator<SffGraph.SffGraphEntry> sffGraphIter = sffGraph.getGraphEntryIterator(); sfcOfFlowProgrammer.setTableIndexMapper( transportProcessor.getTableIndexMapper().isPresent() ? transportProcessor.getTableIndexMapper().get() : null); while (sffGraphIter.hasNext()) { entry = sffGraphIter.next(); LOG.debug("build flows of entry: {}", entry); sfcOfFlowProgrammer.setFlowRspId(OpenflowConstants.SFC_FLOWS); initializeSff(entry, transportProcessor); sfcOfFlowProgrammer.setFlowRspId(rsp.getPathId()); configureTransportIngressFlows(entry, sffGraph, transportProcessor); configurePathMapperFlows(entry, sffGraph, transportProcessor); configureNextHopFlows(entry, sffGraph, transportProcessor); configureTransportEgressFlows(entry, sffGraph, transportProcessor); } this.sfcOfFlowProgrammer.flushFlows(); transportProcessor.updateOperationalDSInfo(sffGraph, rsp); LOG.info("Processing complete for RSP: name [{}] Id [{}]", rsp.getName(), rsp.getPathId()); } catch (SfcRenderingException e) { LOG.error("SfcRenderingException in processRenderedServicePath: ", e.getMessage(), e); } finally { this.sfcOfFlowProgrammer.purgeFlows(); sfcSynchronizer.unlock(); sfcOfProviderUtils.removeRsp(rsp.getPathId()); } } SfcOfRspProcessor(
            SfcOfFlowProgrammerInterface sfcOfFlowProgrammer,
            SfcOfBaseProviderUtils sfcOfProviderUtils,
            SfcSynchronizer sfcSynchronizer,
            RpcProviderRegistry rpcProviderRegistry,
            DataBroker dataBroker); void processRenderedServicePath(RenderedServicePath rsp); void deleteRenderedServicePath(RenderedServicePath rsp); SfcRspTransportProcessorBase getTransportProcessor(SffGraph sffGraph, RenderedServicePath rsp);  }