use of org.openkilda.server42.control.messaging.flowrtt.ListFlowsOnSwitch in project open-kilda by telstra.
the class Gate method listen.
@KafkaHandler
void listen(ListFlowsOnSwitch data, @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) String switchIdKey) {
CommandPacket commandPacket = getFlowListCommandPacket(switchIdKey);
try {
CommandPacketResponse serverResponse = zeroMqClient.send(commandPacket);
if (serverResponse == null) {
log.error("No response from server on {}", data.getHeaders().getCorrelationId());
return;
}
for (Any any : serverResponse.getResponseList()) {
String flowId = any.unpack(Flow.class).getFlowId();
if (!data.getFlowIds().contains(flowId)) {
removeFlow(flowId, FlowDirection.FORWARD);
removeFlow(flowId, FlowDirection.REVERSE);
}
}
} catch (InvalidProtocolBufferException e) {
log.error("Marshalling error on {}", data);
}
}
use of org.openkilda.server42.control.messaging.flowrtt.ListFlowsOnSwitch in project open-kilda by telstra.
the class FlowHandler method sendListOfFlowBySwitchId.
@Override
public void sendListOfFlowBySwitchId(SwitchId switchId, Set<String> flowOnSwitch) {
ListFlowsOnSwitch listFlowsOnSwitch = ListFlowsOnSwitch.builder().headers(buildHeader()).flowIds(flowOnSwitch).build();
emit(STREAM_CONTROL_COMMANDS_ID, getCurrentTuple(), new Values(switchId.toString(), listFlowsOnSwitch));
}
Aggregations