use of org.openkilda.wfm.topology.flowhs.exception.UnknownKeyException in project open-kilda by telstra.
the class FlowCreateService method handleAsyncResponse.
/**
* Handles async response from worker.
*
* @param key command identifier.
*/
public void handleAsyncResponse(@NonNull String key, @NonNull SpeakerFlowSegmentResponse flowResponse) throws UnknownKeyException {
log.debug("Received flow command response {}", flowResponse);
FlowCreateFsm fsm = fsmRegister.getFsmByKey(key).orElseThrow(() -> new UnknownKeyException(key));
FlowCreateContext context = FlowCreateContext.builder().speakerFlowResponse(flowResponse).build();
fsmExecutor.fire(fsm, Event.RESPONSE_RECEIVED, context);
removeIfFinished(fsm, key);
}
use of org.openkilda.wfm.topology.flowhs.exception.UnknownKeyException in project open-kilda by telstra.
the class FlowValidationHubService method handleTimeoutByFlowId.
/**
* Handles timeout case.
* Used if the command identifier is unknown, so FSM is identified by the flow Id.
*/
public void handleTimeoutByFlowId(@NonNull String flowId) throws UnknownKeyException {
String commandKey = fsmRegister.getKeyByFlowId(flowId).orElseThrow(() -> new UnknownKeyException(flowId));
handleTimeout(commandKey);
}
use of org.openkilda.wfm.topology.flowhs.exception.UnknownKeyException in project open-kilda by telstra.
the class FlowUpdateHubBolt method onWorkerResponse.
@Override
protected void onWorkerResponse(Tuple input) {
String operationKey = input.getStringByField(MessageKafkaTranslator.FIELD_ID_KEY);
currentKey = KeyProvider.getParentKey(operationKey);
SpeakerFlowSegmentResponse flowResponse = (SpeakerFlowSegmentResponse) input.getValueByField(FIELD_ID_PAYLOAD);
try {
service.handleAsyncResponse(currentKey, flowResponse);
} catch (UnknownKeyException e) {
log.warn("Received a response with unknown key {}.", currentKey);
}
}
use of org.openkilda.wfm.topology.flowhs.exception.UnknownKeyException in project open-kilda by telstra.
the class FlowValidationHubBolt method onWorkerResponse.
@Override
protected void onWorkerResponse(Tuple input) throws PipelineException {
String operationKey = pullKey(input);
currentKey = KeyProvider.getParentKey(operationKey);
MessageData messageData = pullValue(input, FIELD_ID_PAYLOAD, MessageData.class);
try {
service.handleAsyncResponse(currentKey, messageData);
} catch (UnknownKeyException e) {
log.warn("Received a response with unknown key {}.", currentKey);
}
}
use of org.openkilda.wfm.topology.flowhs.exception.UnknownKeyException 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);
}
}
Aggregations