Search in sources :

Example 46 with UnknownKeyException

use of org.openkilda.wfm.topology.flowhs.exception.UnknownKeyException in project open-kilda by telstra.

the class FlowDeleteHubBolt method onWorkerResponse.

@Override
protected void onWorkerResponse(Tuple input) throws PipelineException {
    String operationKey = pullKey(input);
    currentKey = KeyProvider.getParentKey(operationKey);
    SpeakerFlowSegmentResponse flowResponse = pullValue(input, FIELD_ID_PAYLOAD, SpeakerFlowSegmentResponse.class);
    try {
        service.handleAsyncResponse(currentKey, flowResponse);
    } catch (UnknownKeyException e) {
        log.warn("Received a response with unknown key {}.", currentKey);
    }
}
Also used : SpeakerFlowSegmentResponse(org.openkilda.floodlight.api.response.SpeakerFlowSegmentResponse) UnknownKeyException(org.openkilda.wfm.topology.flowhs.exception.UnknownKeyException)

Example 47 with UnknownKeyException

use of org.openkilda.wfm.topology.flowhs.exception.UnknownKeyException in project open-kilda by telstra.

the class FlowRerouteHubBolt method onWorkerResponse.

@Override
protected void onWorkerResponse(Tuple input) throws PipelineException {
    String operationKey = pullKey(input);
    currentKey = KeyProvider.getParentKey(operationKey);
    SpeakerFlowSegmentResponse flowResponse = pullValue(input, FIELD_ID_PAYLOAD, SpeakerFlowSegmentResponse.class);
    try {
        service.handleAsyncResponse(currentKey, flowResponse);
    } catch (UnknownKeyException e) {
        log.warn("Received a response with unknown key {}.", currentKey);
    }
}
Also used : SpeakerFlowSegmentResponse(org.openkilda.floodlight.api.response.SpeakerFlowSegmentResponse) UnknownKeyException(org.openkilda.wfm.topology.flowhs.exception.UnknownKeyException)

Example 48 with UnknownKeyException

use of org.openkilda.wfm.topology.flowhs.exception.UnknownKeyException in project open-kilda by telstra.

the class FlowCreateHubBolt method onWorkerResponse.

@Override
protected void onWorkerResponse(Tuple input) throws PipelineException {
    String operationKey = pullKey(input);
    currentKey = KeyProvider.getParentKey(operationKey);
    SpeakerFlowSegmentResponse flowResponse = pullValue(input, FIELD_ID_PAYLOAD, SpeakerFlowSegmentResponse.class);
    try {
        service.handleAsyncResponse(currentKey, flowResponse);
    } catch (UnknownKeyException e) {
        log.warn("Received a response with unknown key {}.", currentKey);
    }
}
Also used : SpeakerFlowSegmentResponse(org.openkilda.floodlight.api.response.SpeakerFlowSegmentResponse) UnknownKeyException(org.openkilda.wfm.topology.flowhs.exception.UnknownKeyException)

Example 49 with UnknownKeyException

use of org.openkilda.wfm.topology.flowhs.exception.UnknownKeyException in project open-kilda by telstra.

the class YFlowRerouteServiceTest method handleSpeakerCommandsAndTimeoutInstall.

private void handleSpeakerCommandsAndTimeoutInstall(YFlowRerouteService service, String yFlowFsmKey) {
    handleSpeakerRequests(request -> {
        SpeakerResponse commandResponse;
        if (request instanceof FlowSegmentRequest) {
            FlowSegmentRequest flowSegmentRequest = (FlowSegmentRequest) request;
            commandResponse = buildSuccessfulSpeakerResponse(flowSegmentRequest);
            handleAsyncResponse(service, yFlowFsmKey, commandResponse);
        } else {
            BaseSpeakerCommandsRequest speakerCommandsRequest = (BaseSpeakerCommandsRequest) request;
            if (speakerCommandsRequest instanceof InstallSpeakerCommandsRequest) {
                try {
                    service.handleTimeout(yFlowFsmKey);
                } catch (UnknownKeyException ex) {
                // skip
                }
            } else {
                commandResponse = buildSuccessfulYFlowSpeakerResponse(speakerCommandsRequest);
                handleAsyncResponse(service, yFlowFsmKey, commandResponse);
            }
        }
    });
}
Also used : FlowSegmentRequest(org.openkilda.floodlight.api.request.FlowSegmentRequest) InstallSpeakerCommandsRequest(org.openkilda.floodlight.api.request.rulemanager.InstallSpeakerCommandsRequest) SpeakerResponse(org.openkilda.floodlight.api.response.SpeakerResponse) BaseSpeakerCommandsRequest(org.openkilda.floodlight.api.request.rulemanager.BaseSpeakerCommandsRequest) UnknownKeyException(org.openkilda.wfm.topology.flowhs.exception.UnknownKeyException)

Aggregations

UnknownKeyException (org.openkilda.wfm.topology.flowhs.exception.UnknownKeyException)49 FlowSegmentRequest (org.openkilda.floodlight.api.request.FlowSegmentRequest)9 SpeakerFlowSegmentResponse (org.openkilda.floodlight.api.response.SpeakerFlowSegmentResponse)9 Flow (org.openkilda.model.Flow)7 SpeakerResponse (org.openkilda.floodlight.api.response.SpeakerResponse)6 Test (org.junit.Test)5 FlowErrorResponse (org.openkilda.floodlight.flow.response.FlowErrorResponse)5 SpeakerCommandResponse (org.openkilda.floodlight.api.response.rulemanager.SpeakerCommandResponse)4 FlowRequest (org.openkilda.messaging.command.flow.FlowRequest)4 FlowEndpoint (org.openkilda.model.FlowEndpoint)4 CommandContext (org.openkilda.wfm.CommandContext)4 ErrorData (org.openkilda.messaging.error.ErrorData)3 HashMap (java.util.HashMap)2 Set (java.util.Set)2 UUID (java.util.UUID)2 Matchers.equalTo (org.hamcrest.Matchers.equalTo)2 Matchers.hasProperty (org.hamcrest.Matchers.hasProperty)2 Assert (org.junit.Assert)2 Assert.assertEquals (org.junit.Assert.assertEquals)2 Assert.assertFalse (org.junit.Assert.assertFalse)2