src-java/flowhs-topology/flowhs-storm-topology/src/main/java/org/openkilda/wfm/topology/flowhs/service/FlowUpdateService.java
/**
     * Handles create flow loop request.
     *
     * @param request request to handle.
     */
Handles create flow loop request.
@param request request to handle.
Handles create flow loop request . @param request request to handle .
public void handleCreateFlowLoopRequest(String key, CommandContext commandContext,
                                            CreateFlowLoopRequest request) {
        Optional<Flow> flow = flowRepository.findById(request.getFlowId());
        if (flow.isPresent()) {
            FlowRequest flowRequest = RequestedFlowMapper.INSTANCE.toFlowRequest(flow.get());
            if (flowRequest.getLoopSwitchId() == null || flowRequest.getLoopSwitchId().equals(request.getSwitchId())) {
                flowRequest.setLoopSwitchId(request.getSwitchId());
                handleRequest(key, commandContext, flowRequest);
            } else {
                carrier.sendNorthboundResponse(buildFlowAlreadyLoopedErrorMessage(flowRequest, commandContext));
            }
        } else {
            carrier.sendNorthboundResponse(buildFlowNotFoundErrorMessage(request.getFlowId(), commandContext));
        }
    }
public void handleCreateFlowLoopRequest ( String key , CommandContext commandContext , CreateFlowLoopRequest request ) { Optional < Flow > flow = flowRepository . findById ( request . getFlowId ( ) ) ; if ( flow . isPresent ( ) ) { FlowRequest flowRequest = RequestedFlowMapper . INSTANCE . toFlowRequest ( flow . get ( ) ) ; if ( flowRequest . getLoopSwitchId ( ) == null || flowRequest . getLoopSwitchId ( ) . equals ( request . getSwitchId ( ) ) ) { flowRequest . setLoopSwitchId ( request . getSwitchId ( ) ) ; handleRequest ( key , commandContext , flowRequest ) ; } else { carrier . sendNorthboundResponse ( buildFlowAlreadyLoopedErrorMessage ( flowRequest , commandContext ) ) ; } } else { carrier . sendNorthboundResponse ( buildFlowNotFoundErrorMessage ( request . getFlowId ( ) , commandContext ) ) ; } }
Handles create flow loop request.
Handles create flow loop request .