@Test(expected = IslNotFoundException.class) public void updateIslLatencyNonExistentDstEndpointTest() throws IslNotFoundException, SwitchNotFoundException { islLatencyService.updateIslLatency(SWITCH_ID_1, PORT_1, NON_EXISTENT_SWITCH_ID, PORT_2, 0); }
@VisibleForTesting void updateIslLatency( SwitchId srcSwitchId, int srcPort, SwitchId dstSwitchId, int dstPort, long latency) throws SwitchNotFoundException, IslNotFoundException { transactionManager.doInTransaction(() -> { Isl isl = islRepository.findByEndpoints(srcSwitchId, srcPort, dstSwitchId, dstPort) .orElseThrow(() -> new IslNotFoundException(srcSwitchId, srcPort, dstSwitchId, dstPort)); isl.setLatency(latency); }); }
IslLatencyService { @VisibleForTesting void updateIslLatency( SwitchId srcSwitchId, int srcPort, SwitchId dstSwitchId, int dstPort, long latency) throws SwitchNotFoundException, IslNotFoundException { transactionManager.doInTransaction(() -> { Isl isl = islRepository.findByEndpoints(srcSwitchId, srcPort, dstSwitchId, dstPort) .orElseThrow(() -> new IslNotFoundException(srcSwitchId, srcPort, dstSwitchId, dstPort)); isl.setLatency(latency); }); } }
IslLatencyService { @VisibleForTesting void updateIslLatency( SwitchId srcSwitchId, int srcPort, SwitchId dstSwitchId, int dstPort, long latency) throws SwitchNotFoundException, IslNotFoundException { transactionManager.doInTransaction(() -> { Isl isl = islRepository.findByEndpoints(srcSwitchId, srcPort, dstSwitchId, dstPort) .orElseThrow(() -> new IslNotFoundException(srcSwitchId, srcPort, dstSwitchId, dstPort)); isl.setLatency(latency); }); } IslLatencyService(TransactionManager transactionManager,
                             RepositoryFactory repositoryFactory, long latencyUpdateInterval,
                             long latencyUpdateTimeRange); }
IslLatencyService { @VisibleForTesting void updateIslLatency( SwitchId srcSwitchId, int srcPort, SwitchId dstSwitchId, int dstPort, long latency) throws SwitchNotFoundException, IslNotFoundException { transactionManager.doInTransaction(() -> { Isl isl = islRepository.findByEndpoints(srcSwitchId, srcPort, dstSwitchId, dstPort) .orElseThrow(() -> new IslNotFoundException(srcSwitchId, srcPort, dstSwitchId, dstPort)); isl.setLatency(latency); }); } IslLatencyService(TransactionManager transactionManager,
                             RepositoryFactory repositoryFactory, long latencyUpdateInterval,
                             long latencyUpdateTimeRange); void handleRoundTripIslLatency(IslRoundTripLatency data, Endpoint destination, long timestamp); void handleOneWayIslLatency(IslOneWayLatency data, long timestamp); }
IslLatencyService { @VisibleForTesting void updateIslLatency( SwitchId srcSwitchId, int srcPort, SwitchId dstSwitchId, int dstPort, long latency) throws SwitchNotFoundException, IslNotFoundException { transactionManager.doInTransaction(() -> { Isl isl = islRepository.findByEndpoints(srcSwitchId, srcPort, dstSwitchId, dstPort) .orElseThrow(() -> new IslNotFoundException(srcSwitchId, srcPort, dstSwitchId, dstPort)); isl.setLatency(latency); }); } IslLatencyService(TransactionManager transactionManager,
                             RepositoryFactory repositoryFactory, long latencyUpdateInterval,
                             long latencyUpdateTimeRange); void handleRoundTripIslLatency(IslRoundTripLatency data, Endpoint destination, long timestamp); void handleOneWayIslLatency(IslOneWayLatency data, long timestamp); static final String ONE_WAY_LATENCY; static final String ROUND_TRIP_LATENCY; }