use of org.openkilda.messaging.swmanager.request.DeleteLagPortRequest in project open-kilda by telstra.
the class SwitchServiceImpl method deleteLagPort.
@Override
public CompletableFuture<LagPortDto> deleteLagPort(SwitchId switchId, Integer logicalPortNumber) {
logger.info("Removing Link aggregation group {} on switch {}", logicalPortNumber, switchId);
DeleteLagPortRequest data = new DeleteLagPortRequest(switchId, logicalPortNumber);
CommandMessage request = new CommandMessage(data, System.currentTimeMillis(), RequestCorrelationId.getId());
return messagingChannel.sendAndGet(switchManagerTopic, request).thenApply(LagPortResponse.class::cast).thenApply(lagPortMapper::map);
}
use of org.openkilda.messaging.swmanager.request.DeleteLagPortRequest in project open-kilda by telstra.
the class SwitchManagerHub method onRequest.
@Override
protected void onRequest(Tuple input) throws PipelineException {
if (!active) {
log.info("Switch Manager Topology is inactive");
return;
}
String key = input.getStringByField(MessageKafkaTranslator.FIELD_ID_KEY);
CommandMessage message = pullValue(input, MessageKafkaTranslator.FIELD_ID_PAYLOAD, CommandMessage.class);
CommandData data = message.getData();
if (data instanceof SwitchValidateRequest) {
validateService.handleSwitchValidateRequest(key, (SwitchValidateRequest) data);
} else if (data instanceof SwitchRulesDeleteRequest) {
switchRuleService.deleteRules(key, (SwitchRulesDeleteRequest) data);
} else if (data instanceof SwitchRulesInstallRequest) {
switchRuleService.installRules(key, (SwitchRulesInstallRequest) data);
} else if (data instanceof CreateLagPortRequest) {
createLagPortService.handleCreateLagRequest(key, (CreateLagPortRequest) data);
} else if (data instanceof DeleteLagPortRequest) {
deleteLagPortService.handleDeleteLagRequest(key, (DeleteLagPortRequest) data);
} else {
log.warn("Receive unexpected CommandMessage for key {}: {}", key, data);
}
}
Aggregations