use of org.openkilda.messaging.Message in project open-kilda by telstra.
the class SwitchServiceImpl method installRules.
@Override
public List<Long> installRules(String switchId, InstallRulesAction installAction, String correlationId) {
LOGGER.debug("Install switch rules request received");
SwitchRulesInstallRequest data = new SwitchRulesInstallRequest(switchId, installAction);
CommandMessage request = new CommandWithReplyToMessage(data, System.currentTimeMillis(), correlationId, Destination.CONTROLLER, northboundTopic);
messageProducer.send(floodlightTopic, request);
Message message = messageConsumer.poll(correlationId);
SwitchRulesResponse response = (SwitchRulesResponse) validateInfoMessage(request, message, correlationId);
return response.getRuleIds();
}
use of org.openkilda.messaging.Message in project open-kilda by telstra.
the class HeartBeatAction method run.
@Override
public void run() {
Message message = new org.openkilda.messaging.HeartBeat();
producer.handle(topic, message);
}
use of org.openkilda.messaging.Message in project open-kilda by telstra.
the class SwitchEventCollector method switchDeactivated.
/*
* IFloodlightModule methods.
*/
/**
* {@inheritDoc}
*/
@Override
public void switchDeactivated(final DatapathId switchId) {
switchManager.stopSafeMode(switchId);
Message message = buildSwitchMessage(switchId, SwitchState.DEACTIVATED);
kafkaProducer.postMessage(TOPO_EVENT_TOPIC, message);
}
use of org.openkilda.messaging.Message in project open-kilda by telstra.
the class SwitchEventCollector method switchPortChanged.
/**
* {@inheritDoc}
*/
@Override
public void switchPortChanged(final DatapathId switchId, final OFPortDesc port, final PortChangeType type) {
if (isPhysicalPort(port.getPortNo())) {
Message message = buildPortMessage(switchId, port, type);
kafkaProducer.postMessage(TOPO_EVENT_TOPIC, message);
}
}
use of org.openkilda.messaging.Message in project open-kilda by telstra.
the class SwitchManager method sendSwitchActivate.
/**
* {@inheritDoc}
*/
@Override
public void sendSwitchActivate(final IOFSwitch sw) throws SwitchOperationException {
Message message = SwitchEventCollector.buildSwitchMessage(sw, SwitchState.ACTIVATED);
kafkaProducer.postMessage(TOPO_EVENT_TOPIC, message);
}
Aggregations