Search in sources :

Example 1 with ActivateFlowMonitoringCommand

use of org.openkilda.server42.control.topology.storm.bolt.flow.command.ActivateFlowMonitoringCommand in project open-kilda by telstra.

the class Router method handleInfoMessage.

private void handleInfoMessage(Tuple input, InfoData payload) throws PipelineException {
    if (payload instanceof ActivateFlowMonitoringInfoData) {
        ActivateFlowMonitoringInfoData data = (ActivateFlowMonitoringInfoData) payload;
        emit(STREAM_FLOW_ID, input, makeTuple(new ActivateFlowMonitoringCommand(data, true)));
        emit(STREAM_FLOW_ID, input, makeTuple(new ActivateFlowMonitoringCommand(data, false)));
    } else if (payload instanceof DeactivateFlowMonitoringInfoData) {
        DeactivateFlowMonitoringInfoData data = (DeactivateFlowMonitoringInfoData) payload;
        for (SwitchId switchId : data.getSwitchIds()) {
            emit(STREAM_FLOW_ID, input, makeTuple(new DeactivateFlowMonitoringCommand(switchId, data.getFlowId(), true)));
            emit(STREAM_FLOW_ID, input, makeTuple(new DeactivateFlowMonitoringCommand(switchId, data.getFlowId(), false)));
        }
    } else if (payload instanceof ActivateFlowMonitoringOnSwitchInfoData) {
        ActivateFlowMonitoringOnSwitchInfoData data = (ActivateFlowMonitoringOnSwitchInfoData) payload;
        activateFlowMonitoringOnSwitch(data.getSwitchId());
    } else if (payload instanceof DeactivateFlowMonitoringOnSwitchInfoData) {
        DeactivateFlowMonitoringOnSwitchInfoData data = (DeactivateFlowMonitoringOnSwitchInfoData) payload;
        deactivateFlowMonitoringOnSwitch(data.getSwitchId());
    } else if (payload instanceof ActivateIslMonitoringOnSwitchInfoData) {
        ActivateIslMonitoringOnSwitchInfoData data = (ActivateIslMonitoringOnSwitchInfoData) payload;
        activateIslMonitoringOnSwitch(data.getSwitchId());
    } else if (payload instanceof DeactivateIslMonitoringOnSwitchInfoData) {
        DeactivateIslMonitoringOnSwitchInfoData data = (DeactivateIslMonitoringOnSwitchInfoData) payload;
        deactivateIslMonitoringOnSwitch(data.getSwitchId());
    } else if (payload instanceof FeatureTogglesUpdate) {
        FeatureTogglesUpdate data = (FeatureTogglesUpdate) payload;
        this.service.handleFlowRttFeatureToggle(data.getToggles().getServer42FlowRtt());
        this.service.handleIslRttFeatureToggle(data.getToggles().getServer42IslRtt());
    } else {
        log.error("Do not proxy flow message - unexpected message payload \"{}\"", payload.getClass());
    }
}
Also used : DeactivateFlowMonitoringCommand(org.openkilda.server42.control.topology.storm.bolt.flow.command.DeactivateFlowMonitoringCommand) ActivateFlowMonitoringCommand(org.openkilda.server42.control.topology.storm.bolt.flow.command.ActivateFlowMonitoringCommand) ActivateIslMonitoringOnSwitchInfoData(org.openkilda.server42.control.messaging.islrtt.ActivateIslMonitoringOnSwitchInfoData) ActivateFlowMonitoringOnSwitchInfoData(org.openkilda.server42.control.messaging.flowrtt.ActivateFlowMonitoringOnSwitchInfoData) FeatureTogglesUpdate(org.openkilda.messaging.info.event.FeatureTogglesUpdate) DeactivateFlowMonitoringInfoData(org.openkilda.server42.control.messaging.flowrtt.DeactivateFlowMonitoringInfoData) DeactivateFlowMonitoringOnSwitchInfoData(org.openkilda.server42.control.messaging.flowrtt.DeactivateFlowMonitoringOnSwitchInfoData) SwitchId(org.openkilda.model.SwitchId) DeactivateIslMonitoringOnSwitchInfoData(org.openkilda.server42.control.messaging.islrtt.DeactivateIslMonitoringOnSwitchInfoData) ActivateFlowMonitoringInfoData(org.openkilda.server42.control.messaging.flowrtt.ActivateFlowMonitoringInfoData)

Aggregations

FeatureTogglesUpdate (org.openkilda.messaging.info.event.FeatureTogglesUpdate)1 SwitchId (org.openkilda.model.SwitchId)1 ActivateFlowMonitoringInfoData (org.openkilda.server42.control.messaging.flowrtt.ActivateFlowMonitoringInfoData)1 ActivateFlowMonitoringOnSwitchInfoData (org.openkilda.server42.control.messaging.flowrtt.ActivateFlowMonitoringOnSwitchInfoData)1 DeactivateFlowMonitoringInfoData (org.openkilda.server42.control.messaging.flowrtt.DeactivateFlowMonitoringInfoData)1 DeactivateFlowMonitoringOnSwitchInfoData (org.openkilda.server42.control.messaging.flowrtt.DeactivateFlowMonitoringOnSwitchInfoData)1 ActivateIslMonitoringOnSwitchInfoData (org.openkilda.server42.control.messaging.islrtt.ActivateIslMonitoringOnSwitchInfoData)1 DeactivateIslMonitoringOnSwitchInfoData (org.openkilda.server42.control.messaging.islrtt.DeactivateIslMonitoringOnSwitchInfoData)1 ActivateFlowMonitoringCommand (org.openkilda.server42.control.topology.storm.bolt.flow.command.ActivateFlowMonitoringCommand)1 DeactivateFlowMonitoringCommand (org.openkilda.server42.control.topology.storm.bolt.flow.command.DeactivateFlowMonitoringCommand)1