@Test public void getFlowsForEndpointOneSwitchFlowNoPortTest() throws SwitchNotFoundException { Switch switchA = createSwitch(SWITCH_ID_1); createFlow(FLOW_ID_1, switchA, 1, switchA, 2, FORWARD_PATH_1, REVERSE_PATH_1, null); assertFlows(flowOperationsService.getFlowsForEndpoint(SWITCH_ID_1, null), FLOW_ID_1); createFlow(FLOW_ID_2, switchA, 3, switchA, 4, FORWARD_PATH_2, REVERSE_PATH_2, null); assertFlows(flowOperationsService.getFlowsForEndpoint(SWITCH_ID_1, null), FLOW_ID_1, FLOW_ID_2); }
public Collection<Flow> getFlowsForEndpoint(SwitchId switchId, Integer port) throws SwitchNotFoundException { flowDashboardLogger.onFlowPathsDumpByEndpoint(switchId, port); if (!switchRepository.findById(switchId).isPresent()) { throw new SwitchNotFoundException(switchId); } if (port != null) { return getFlowsForEndpoint(flowPathRepository.findBySegmentEndpoint(switchId, port), flowRepository.findByEndpoint(switchId, port)); } else { return getFlowsForEndpoint(flowPathRepository.findBySegmentSwitch(switchId), flowRepository.findByEndpointSwitch(switchId)); } }
FlowOperationsService { public Collection<Flow> getFlowsForEndpoint(SwitchId switchId, Integer port) throws SwitchNotFoundException { flowDashboardLogger.onFlowPathsDumpByEndpoint(switchId, port); if (!switchRepository.findById(switchId).isPresent()) { throw new SwitchNotFoundException(switchId); } if (port != null) { return getFlowsForEndpoint(flowPathRepository.findBySegmentEndpoint(switchId, port), flowRepository.findByEndpoint(switchId, port)); } else { return getFlowsForEndpoint(flowPathRepository.findBySegmentSwitch(switchId), flowRepository.findByEndpointSwitch(switchId)); } } }
FlowOperationsService { public Collection<Flow> getFlowsForEndpoint(SwitchId switchId, Integer port) throws SwitchNotFoundException { flowDashboardLogger.onFlowPathsDumpByEndpoint(switchId, port); if (!switchRepository.findById(switchId).isPresent()) { throw new SwitchNotFoundException(switchId); } if (port != null) { return getFlowsForEndpoint(flowPathRepository.findBySegmentEndpoint(switchId, port), flowRepository.findByEndpoint(switchId, port)); } else { return getFlowsForEndpoint(flowPathRepository.findBySegmentSwitch(switchId), flowRepository.findByEndpointSwitch(switchId)); } } FlowOperationsService(RepositoryFactory repositoryFactory, TransactionManager transactionManager); }
FlowOperationsService { public Collection<Flow> getFlowsForEndpoint(SwitchId switchId, Integer port) throws SwitchNotFoundException { flowDashboardLogger.onFlowPathsDumpByEndpoint(switchId, port); if (!switchRepository.findById(switchId).isPresent()) { throw new SwitchNotFoundException(switchId); } if (port != null) { return getFlowsForEndpoint(flowPathRepository.findBySegmentEndpoint(switchId, port), flowRepository.findByEndpoint(switchId, port)); } else { return getFlowsForEndpoint(flowPathRepository.findBySegmentSwitch(switchId), flowRepository.findByEndpointSwitch(switchId)); } } FlowOperationsService(RepositoryFactory repositoryFactory, TransactionManager transactionManager); Flow getFlow(String flowId); Set<String> getDiverseFlowsId(String flowId, String groupId); Collection<Flow> getAllFlows(FlowsDumpRequest request); Collection<FlowPath> getFlowPathsForLink(SwitchId srcSwitchId, Integer srcPort,
                                                    SwitchId dstSwitchId, Integer dstPort); Collection<Flow> getFlowsForEndpoint(SwitchId switchId, Integer port); Collection<FlowPath> getFlowPathsForSwitch(SwitchId switchId); List<FlowPathDto> getFlowPath(String flowId); Flow updateFlow(FlowOperationsCarrier carrier, FlowPatch flowPatch); Collection<SwitchConnectedDevice> getFlowConnectedDevice(String flowId); List<FlowRerouteRequest> makeRerouteRequests(
            Collection<FlowPath> targetPaths, Set<IslEndpoint> affectedIslEndpoints, String reason); }
FlowOperationsService { public Collection<Flow> getFlowsForEndpoint(SwitchId switchId, Integer port) throws SwitchNotFoundException { flowDashboardLogger.onFlowPathsDumpByEndpoint(switchId, port); if (!switchRepository.findById(switchId).isPresent()) { throw new SwitchNotFoundException(switchId); } if (port != null) { return getFlowsForEndpoint(flowPathRepository.findBySegmentEndpoint(switchId, port), flowRepository.findByEndpoint(switchId, port)); } else { return getFlowsForEndpoint(flowPathRepository.findBySegmentSwitch(switchId), flowRepository.findByEndpointSwitch(switchId)); } } FlowOperationsService(RepositoryFactory repositoryFactory, TransactionManager transactionManager); Flow getFlow(String flowId); Set<String> getDiverseFlowsId(String flowId, String groupId); Collection<Flow> getAllFlows(FlowsDumpRequest request); Collection<FlowPath> getFlowPathsForLink(SwitchId srcSwitchId, Integer srcPort,
                                                    SwitchId dstSwitchId, Integer dstPort); Collection<Flow> getFlowsForEndpoint(SwitchId switchId, Integer port); Collection<FlowPath> getFlowPathsForSwitch(SwitchId switchId); List<FlowPathDto> getFlowPath(String flowId); Flow updateFlow(FlowOperationsCarrier carrier, FlowPatch flowPatch); Collection<SwitchConnectedDevice> getFlowConnectedDevice(String flowId); List<FlowRerouteRequest> makeRerouteRequests(
            Collection<FlowPath> targetPaths, Set<IslEndpoint> affectedIslEndpoints, String reason);  }