use of org.openkilda.messaging.command.yflow.YFlowDeleteRequest in project open-kilda by telstra.
the class YFlowDeleteServiceTest method processRequestAndSpeakerCommands.
private void processRequestAndSpeakerCommands(String yFlowId) throws DuplicateKeyException {
YFlowDeleteRequest yFlowRequest = new YFlowDeleteRequest(yFlowId);
YFlowDeleteService service = makeYFlowDeleteService(0);
service.handleRequest(yFlowRequest.getYFlowId(), new CommandContext(), yFlowRequest);
verifyYFlowStatus(yFlowRequest.getYFlowId(), FlowStatus.IN_PROGRESS);
handleSpeakerRequests(speakerRequest -> {
SpeakerResponse commandResponse;
if (speakerRequest instanceof FlowSegmentRequest) {
FlowSegmentRequest flowSegmentRequest = (FlowSegmentRequest) speakerRequest;
commandResponse = buildSuccessfulSpeakerResponse(flowSegmentRequest);
} else {
BaseSpeakerCommandsRequest speakerCommandsRequest = (BaseSpeakerCommandsRequest) speakerRequest;
commandResponse = buildSuccessfulYFlowSpeakerResponse(speakerCommandsRequest);
}
handleAsyncResponse(service, yFlowRequest.getYFlowId(), commandResponse);
});
}
use of org.openkilda.messaging.command.yflow.YFlowDeleteRequest in project open-kilda by telstra.
the class YFlowDeleteHubBolt method onRequest.
@Override
protected void onRequest(Tuple input) throws PipelineException {
currentKey = pullKey(input);
YFlowDeleteRequest payload = pullValue(input, FIELD_ID_PAYLOAD, YFlowDeleteRequest.class);
try {
yFlowDeleteService.handleRequest(currentKey, getCommandContext(), payload);
} catch (DuplicateKeyException e) {
log.error("Failed to handle a request with key {}. {}", currentKey, e.getMessage());
}
}
Aggregations