use of org.openkilda.messaging.command.switches.DumpRulesRequest in project open-kilda by telstra.
the class RecordHandler method doDumpRulesRequest.
private void doDumpRulesRequest(final CommandMessage message) {
DumpRulesRequest request = (DumpRulesRequest) message.getData();
final String switchId = request.getSwitchId();
logger.debug("Loading installed rules for switch {}", switchId);
OFFlowStatsReply reply = context.getSwitchManager().dumpFlowTable(DatapathId.of(switchId));
List<FlowEntry> flows = reply.getEntries().stream().map(OFFlowStatsConverter::toFlowEntry).collect(Collectors.toList());
SwitchFlowEntries response = SwitchFlowEntries.builder().switchId(switchId).flowEntries(flows).build();
InfoMessage infoMessage = new InfoMessage(response, message.getTimestamp(), message.getCorrelationId());
context.getKafkaProducer().postMessage(TOPO_ENG_TOPIC, infoMessage);
}
Aggregations