use of org.openkilda.floodlight.api.response.SpeakerResponse in project open-kilda by telstra.
the class YFlowDeleteHubBolt method onWorkerResponse.
@Override
protected void onWorkerResponse(Tuple input) throws PipelineException {
String operationKey = pullKey(input);
currentKey = KeyProvider.getParentKey(operationKey);
SpeakerResponse speakerResponse = pullValue(input, FIELD_ID_PAYLOAD, SpeakerResponse.class);
try {
yFlowDeleteService.handleAsyncResponse(currentKey, speakerResponse);
} catch (UnknownKeyException e) {
log.error("Received a response with unknown key {}.", currentKey);
}
}
use of org.openkilda.floodlight.api.response.SpeakerResponse in project open-kilda by telstra.
the class SpeakerWorkerBolt method onAsyncResponse.
@Override
protected void onAsyncResponse(Tuple request, Tuple response) throws PipelineException {
Object payload = response.getValueByField(FIELD_ID_PAYLOAD);
if (payload instanceof SpeakerResponse) {
SpeakerResponse message = (SpeakerResponse) payload;
service.handleResponse(pullKey(response), message);
} else {
log.debug("Unknown response received: {}", payload);
}
}
use of org.openkilda.floodlight.api.response.SpeakerResponse in project open-kilda by telstra.
the class YFlowUpdateHubBolt method onWorkerResponse.
@Override
protected void onWorkerResponse(Tuple input) throws PipelineException {
String operationKey = pullKey(input);
currentKey = KeyProvider.getParentKey(operationKey);
SpeakerResponse speakerResponse = pullValue(input, FIELD_ID_PAYLOAD, SpeakerResponse.class);
try {
yflowUpdateService.handleAsyncResponse(currentKey, speakerResponse);
} catch (UnknownKeyException e) {
log.error("Received a response with unknown key {}.", currentKey);
}
}
use of org.openkilda.floodlight.api.response.SpeakerResponse in project open-kilda by telstra.
the class FlowPathSwapHubBolt method onWorkerResponse.
@Override
protected void onWorkerResponse(Tuple input) {
String operationKey = input.getStringByField(MessageKafkaTranslator.FIELD_ID_KEY);
currentKey = KeyProvider.getParentKey(operationKey);
SpeakerResponse flowResponse = (SpeakerResponse) input.getValueByField(FIELD_ID_PAYLOAD);
service.handleAsyncResponse(currentKey, flowResponse);
}
use of org.openkilda.floodlight.api.response.SpeakerResponse 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);
}
}
});
}
Aggregations