@Test public void testMplsFlowCreation() { LOG.info("SfcOfRspProcessorTest testMplsFlowCreation"); RenderedServicePath mplsRsp = rspBuilder.createRspFromSfTypes(this.sfTypes, Mpls.class, Transport.class); this.sfcOfRspProcessor.processRenderedServicePath(mplsRsp); 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(1)).configureVlanTransportIngressFlow("SFF_0"); verify(this.flowProgrammerTestMoc, times(1)).configureVlanTransportIngressFlow("SFF_1"); verify(this.flowProgrammerTestMoc, times(1)).configureMplsTransportIngressFlow("SFF_0"); verify(this.flowProgrammerTestMoc, times(1)).configureMplsTransportIngressFlow("SFF_1"); verify(this.flowProgrammerTestMoc, times(1)).configureVlanPathMapperFlow(eq("SFF_0"), anyInt(), anyLong(), anyBoolean()); verify(this.flowProgrammerTestMoc, times(1)).configureVlanPathMapperFlow(eq("SFF_1"), anyInt(), anyLong(), anyBoolean()); verify(this.flowProgrammerTestMoc, times(1)).configureMplsPathMapperFlow(eq("SFF_0"), anyLong(), anyLong(), anyBoolean()); verify(this.flowProgrammerTestMoc, times(1)).configureMplsPathMapperFlow(eq("SFF_1"), anyLong(), anyLong(), anyBoolean()); verify(this.flowProgrammerTestMoc, times(2)).configureMacNextHopFlow(eq("SFF_0"), anyLong(), anyString(), anyString()); verify(this.flowProgrammerTestMoc, times(3)).configureMacNextHopFlow(eq("SFF_1"), anyLong(), anyString(), anyString()); verify(this.flowProgrammerTestMoc, times(1)).configureVlanSfTransportEgressFlow(eq("SFF_0"), anyString(), anyString(), anyInt(), anyString(), anyLong(), anyBoolean()); verify(this.flowProgrammerTestMoc, times(1)).configureVlanSfTransportEgressFlow(eq("SFF_1"), anyString(), anyString(), anyInt(), anyString(), anyLong(), anyBoolean()); verify(this.flowProgrammerTestMoc, times(1)).configureMplsTransportEgressFlow(eq("SFF_0"), anyString(), anyString(), anyLong(), anyString(), anyLong()); verify(this.flowProgrammerTestMoc, times(1)).configureMplsLastHopTransportEgressFlow(eq("SFF_1"), anyString(), anyString(), anyLong(), anyString(), anyLong()); 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);  }