Search in sources :

Example 1 with AliveResponse

use of org.openkilda.messaging.AliveResponse in project open-kilda by telstra.

the class SpeakerToNetworkProxyBolt method proxyInfoMessage.

@Override
protected void proxyInfoMessage(String key, InfoMessage envelope) {
    emitAliveEvidence(envelope);
    InfoData payload = envelope.getData();
    if (payload instanceof AliveResponse) {
        emitRegionNotification(envelope.getRegion(), (AliveResponse) payload);
    } else if (payload instanceof SwitchInfoData) {
        emitNetworkNotification(envelope.getRegion(), (SwitchInfoData) payload);
    } else if (payload instanceof NetworkDumpSwitchData) {
        emitNetworkNotification(envelope.getRegion(), (NetworkDumpSwitchData) payload);
    } else if (payload instanceof PortInfoData) {
        emitNetworkNotification(envelope.getRegion(), (PortInfoData) payload);
    } else {
        super.proxyInfoMessage(key, envelope);
    }
}
Also used : AliveResponse(org.openkilda.messaging.AliveResponse) PortInfoData(org.openkilda.messaging.info.event.PortInfoData) InfoData(org.openkilda.messaging.info.InfoData) SwitchInfoData(org.openkilda.messaging.info.event.SwitchInfoData) PortInfoData(org.openkilda.messaging.info.event.PortInfoData) SwitchInfoData(org.openkilda.messaging.info.event.SwitchInfoData) NetworkDumpSwitchData(org.openkilda.messaging.info.discovery.NetworkDumpSwitchData)

Example 2 with AliveResponse

use of org.openkilda.messaging.AliveResponse in project open-kilda by telstra.

the class RecordHandler method doAliveRequest.

private void doAliveRequest(CommandMessage message) {
    // TODO(tdurakov): return logic for failed amount counter
    int totalFailedAmount = getKafkaProducer().getFailedSendMessageCounter();
    getKafkaProducer().sendMessageAndTrack(context.getKafkaTopoDiscoTopic(), new InfoMessage(new AliveResponse(context.getRegion(), totalFailedAmount), System.currentTimeMillis(), message.getCorrelationId(), context.getRegion()));
}
Also used : AliveResponse(org.openkilda.messaging.AliveResponse) InfoMessage(org.openkilda.messaging.info.InfoMessage) FlowEndpoint(org.openkilda.model.FlowEndpoint)

Aggregations

AliveResponse (org.openkilda.messaging.AliveResponse)2 InfoData (org.openkilda.messaging.info.InfoData)1 InfoMessage (org.openkilda.messaging.info.InfoMessage)1 NetworkDumpSwitchData (org.openkilda.messaging.info.discovery.NetworkDumpSwitchData)1 PortInfoData (org.openkilda.messaging.info.event.PortInfoData)1 SwitchInfoData (org.openkilda.messaging.info.event.SwitchInfoData)1 FlowEndpoint (org.openkilda.model.FlowEndpoint)1