use of org.openkilda.messaging.swmanager.request.CreateLagPortRequest in project open-kilda by telstra.
the class SwitchServiceImpl method createLag.
@Override
public CompletableFuture<LagPortDto> createLag(SwitchId switchId, CreateLagPortDto lagPortDto) {
logger.info("Create Link aggregation group on switch {}, ports {}", switchId, lagPortDto.getPortNumbers());
CreateLagPortRequest data = new CreateLagPortRequest(switchId, lagPortDto.getPortNumbers());
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.CreateLagPortRequest 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