Search in sources :

Example 1 with LinkPropsGet

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

the class LinkServiceImpl method getLinkProps.

@Override
public CompletableFuture<List<LinkPropsDto>> getLinkProps(SwitchId srcSwitch, Integer srcPort, SwitchId dstSwitch, Integer dstPort) {
    final String correlationId = RequestCorrelationId.getId();
    logger.debug("Get link properties request received");
    LinkPropsGet request = new LinkPropsGet(new NetworkEndpointMask(srcSwitch, srcPort), new NetworkEndpointMask(dstSwitch, dstPort));
    CommandMessage message = new CommandMessage(request, System.currentTimeMillis(), correlationId);
    return messagingChannel.sendAndGetChunked(nbworkerTopic, message).thenApply(response -> response.stream().map(LinkPropsData.class::cast).map(linkPropsMapper::toDto).collect(Collectors.toList()));
}
Also used : LinkPropsGet(org.openkilda.messaging.nbtopology.request.LinkPropsGet) NetworkEndpointMask(org.openkilda.messaging.model.NetworkEndpointMask) CommandMessage(org.openkilda.messaging.command.CommandMessage)

Aggregations

CommandMessage (org.openkilda.messaging.command.CommandMessage)1 NetworkEndpointMask (org.openkilda.messaging.model.NetworkEndpointMask)1 LinkPropsGet (org.openkilda.messaging.nbtopology.request.LinkPropsGet)1