Search in sources :

Example 6 with SpeakerRequestError

use of org.openkilda.messaging.info.reroute.error.SpeakerRequestError in project open-kilda by telstra.

the class SetInstallRuleErrorAction method execute.

@Override
public void execute(State from, State to, Event event, FlowRerouteContext context, FlowRerouteFsm stateMachine) {
    Set<SwitchId> switches = Stream.concat(stateMachine.getPendingCommands().values().stream(), stateMachine.getFailedCommands().values().stream().map(SpeakerResponse::getSwitchId)).collect(Collectors.toSet());
    stateMachine.setRerouteError(new SpeakerRequestError("Failed to install rules", switches));
    log.debug("Abandoning all pending commands: {}", stateMachine.getPendingCommands());
    stateMachine.clearPendingCommands();
}
Also used : SpeakerResponse(org.openkilda.floodlight.api.response.SpeakerResponse) SwitchId(org.openkilda.model.SwitchId) SpeakerRequestError(org.openkilda.messaging.info.reroute.error.SpeakerRequestError)

Aggregations

SpeakerRequestError (org.openkilda.messaging.info.reroute.error.SpeakerRequestError)6 Test (org.junit.Test)3 RerouteResultInfoData (org.openkilda.messaging.info.reroute.RerouteResultInfoData)3 SwitchId (org.openkilda.model.SwitchId)3 FlowThrottlingData (org.openkilda.wfm.topology.reroute.model.FlowThrottlingData)3 RerouteQueue (org.openkilda.wfm.topology.reroute.model.RerouteQueue)3 SpeakerResponse (org.openkilda.floodlight.api.response.SpeakerResponse)2 YFlowRerouteRequest (org.openkilda.messaging.command.yflow.YFlowRerouteRequest)2 IslEndpoint (org.openkilda.model.IslEndpoint)2 FlowRerouteRequest (org.openkilda.messaging.command.flow.FlowRerouteRequest)1 NoPathFoundError (org.openkilda.messaging.info.reroute.error.NoPathFoundError)1 RerouteInProgressError (org.openkilda.messaging.info.reroute.error.RerouteInProgressError)1 Flow (org.openkilda.model.Flow)1 YFlow (org.openkilda.model.YFlow)1 YSubFlow (org.openkilda.model.YSubFlow)1