src-java/flowhs-topology/flowhs-storm-topology/src/main/java/org/openkilda/wfm/topology/flowhs/service/FlowRerouteService.java
/**
     * Handles request for flow reroute.
     */
Handles request for flow reroute.
Handles request for flow reroute .
public void handleRequest(String key, FlowRerouteRequest reroute, final CommandContext commandContext) {
        log.debug("Handling flow reroute request with key {} and flow ID: {}", key, reroute.getFlowId());
        try {
            checkRequestsCollision(key, reroute.getFlowId(), commandContext);
        } catch (Exception e) {
            log.error(e.getMessage());
            FlowRerouteFsm fsm = fsms.get(key);
            if (fsm != null) {
                removeIfFinished(fsm, key);
            }
            return;
        }
        final String flowId = reroute.getFlowId();
        if (isRerouteAlreadyInProgress(flowId)) {
            carrier.sendRerouteResultStatus(flowId, new RerouteInProgressError(),
                    commandContext.getCorrelationId());
            return;
        }
        FlowRerouteFsm fsm = fsmFactory.newInstance(commandContext, flowId);
        fsms.put(key, fsm);
        FlowRerouteContext context = FlowRerouteContext.builder()
                .flowId(flowId)
                .affectedIsl(reroute.getAffectedIsl())
                .forceReroute(reroute.isForce())
                .ignoreBandwidth(reroute.isIgnoreBandwidth())
                .effectivelyDown(reroute.isEffectivelyDown())
                .rerouteReason(reroute.getReason())
                .build();
        fsmExecutor.fire(fsm, Event.NEXT, context);
        removeIfFinished(fsm, key);
    }
public void handleRequest ( String key , FlowRerouteRequest reroute , final CommandContext commandContext ) { log . debug ( "Handling flow reroute request with key {} and flow ID: {}" , key , reroute . getFlowId ( ) ) ; try { checkRequestsCollision ( key , reroute . getFlowId ( ) , commandContext ) ; } catch ( Exception e ) { log . error ( e . getMessage ( ) ) ; FlowRerouteFsm fsm = fsms . get ( key ) ; if ( fsm != null ) { removeIfFinished ( fsm , key ) ; } return ; } final String flowId = reroute . getFlowId ( ) ; if ( isRerouteAlreadyInProgress ( flowId ) ) { carrier . sendRerouteResultStatus ( flowId , new RerouteInProgressError ( ) , commandContext . getCorrelationId ( ) ) ; return ; } FlowRerouteFsm fsm = fsmFactory . newInstance ( commandContext , flowId ) ; fsms . put ( key , fsm ) ; FlowRerouteContext context = FlowRerouteContext . builder ( ) . flowId ( flowId ) . affectedIsl ( reroute . getAffectedIsl ( ) ) . forceReroute ( reroute . isForce ( ) ) . ignoreBandwidth ( reroute . isIgnoreBandwidth ( ) ) . effectivelyDown ( reroute . isEffectivelyDown ( ) ) . rerouteReason ( reroute . getReason ( ) ) . build ( ) ; fsmExecutor . fire ( fsm , Event . NEXT , context ) ; removeIfFinished ( fsm , key ) ; }
Handles request for flow reroute.
Handles request for flow reroute .