Search in sources :

Example 1 with SwitchPatchRequest

use of org.openkilda.messaging.nbtopology.request.SwitchPatchRequest in project open-kilda by telstra.

the class SwitchServiceImpl method patchSwitch.

/**
 * {@inheritDoc}
 */
@Override
public CompletableFuture<SwitchDtoV2> patchSwitch(SwitchId switchId, SwitchPatchDto dto) {
    logger.info("Patch switch request for switch {}", switchId);
    CommandMessage request = new CommandMessage(new SwitchPatchRequest(switchId, switchMapper.map(dto)), System.currentTimeMillis(), RequestCorrelationId.getId());
    return messagingChannel.sendAndGet(nbworkerTopic, request).thenApply(GetSwitchResponse.class::cast).thenApply(GetSwitchResponse::getPayload).thenApply(switchMapper::map);
}
Also used : GetSwitchResponse(org.openkilda.messaging.nbtopology.response.GetSwitchResponse) SwitchPatchRequest(org.openkilda.messaging.nbtopology.request.SwitchPatchRequest) CommandMessage(org.openkilda.messaging.command.CommandMessage)

Aggregations

CommandMessage (org.openkilda.messaging.command.CommandMessage)1 SwitchPatchRequest (org.openkilda.messaging.nbtopology.request.SwitchPatchRequest)1 GetSwitchResponse (org.openkilda.messaging.nbtopology.response.GetSwitchResponse)1