use of org.openkilda.wfm.protocol.KafkaMessage in project open-kilda by telstra.
the class PopulateIslFilterAction method handle.
@Override
protected void handle() throws MessageFormatException, UnsupportedActionException, JsonProcessingException {
KafkaMessage input = new KafkaMessage(getTuple());
Message message = input.getPayload();
if (message.getDestination() != Destination.WFM_OF_DISCOVERY) {
return;
}
if (!(message instanceof CommandMessage)) {
return;
}
CommandMessage command = (CommandMessage) message;
if (!(command.getData() instanceof DiscoveryFilterPopulateData)) {
return;
}
DiscoveryFilterPopulateData payload = (DiscoveryFilterPopulateData) command.getData();
logger.info("Clean ISL filter");
filter.clear();
for (DiscoveryFilterEntity entity : payload.getFilter()) {
logger.info("Add ISL filter record - switcID=\"{}\" portId=\"{}\"", entity.switchId, entity.portId);
filter.add(entity.switchId, entity.portId);
}
}
use of org.openkilda.wfm.protocol.KafkaMessage in project open-kilda by telstra.
the class CtrlEmbeddedAction method emitResponse.
protected void emitResponse(ResponseData payload) throws JsonProcessingException {
CtrlResponse response = new CtrlResponse(payload, System.currentTimeMillis(), getMessage().getCorrelationId(), Destination.CTRL_CLIENT);
KafkaMessage message = new KafkaMessage(response);
getOutputCollector().emit(getMaster().getStreamId(), getTuple(), message.pack());
}
use of org.openkilda.wfm.protocol.KafkaMessage in project open-kilda by telstra.
the class RouteAction method handle.
@Override
protected void handle() throws MessageFormatException, JsonProcessingException {
KafkaMessage input = new KafkaMessage(getTuple());
Message payload = input.getPayload();
if (!(payload instanceof CtrlRequest)) {
getLogger().debug(String.format("Skip foreign message (correlation-id: %s timestamp: %s)", payload.getCorrelationId(), payload.getTimestamp()));
return;
}
handleMessage((CtrlRequest) payload);
}
Aggregations