Search in sources :

Example 1 with DeactivateFlowMonitoringInfoData

use of org.openkilda.server42.control.messaging.flowrtt.DeactivateFlowMonitoringInfoData in project open-kilda by telstra.

the class YFlowDeleteHubBolt method sendDeactivateFlowMonitoring.

@Override
public void sendDeactivateFlowMonitoring(String flow, SwitchId srcSwitchId, SwitchId dstSwitchId) {
    DeactivateFlowMonitoringInfoData payload = DeactivateFlowMonitoringInfoData.builder().flowId(flow).switchId(dstSwitchId).switchId(srcSwitchId).build();
    Message message = new InfoMessage(payload, getCommandContext().getCreateTime(), getCommandContext().getCorrelationId());
    emitWithContext(HUB_TO_SERVER42_CONTROL_TOPOLOGY_SENDER.name(), getCurrentTuple(), new Values(flow, message));
}
Also used : InfoMessage(org.openkilda.messaging.info.InfoMessage) CommandMessage(org.openkilda.messaging.command.CommandMessage) Message(org.openkilda.messaging.Message) InfoMessage(org.openkilda.messaging.info.InfoMessage) Values(org.apache.storm.tuple.Values) DeactivateFlowMonitoringInfoData(org.openkilda.server42.control.messaging.flowrtt.DeactivateFlowMonitoringInfoData)

Example 2 with DeactivateFlowMonitoringInfoData

use of org.openkilda.server42.control.messaging.flowrtt.DeactivateFlowMonitoringInfoData in project open-kilda by telstra.

the class FlowDeleteHubBolt method sendDeactivateFlowMonitoring.

@Override
public void sendDeactivateFlowMonitoring(String flow, SwitchId srcSwitchId, SwitchId dstSwitchId) {
    DeactivateFlowMonitoringInfoData payload = DeactivateFlowMonitoringInfoData.builder().flowId(flow).switchId(dstSwitchId).switchId(srcSwitchId).build();
    Message message = new InfoMessage(payload, getCommandContext().getCreateTime(), getCommandContext().getCorrelationId());
    emitWithContext(HUB_TO_SERVER42_CONTROL_TOPOLOGY_SENDER.name(), getCurrentTuple(), new Values(flow, message));
}
Also used : InfoMessage(org.openkilda.messaging.info.InfoMessage) Message(org.openkilda.messaging.Message) CommandMessage(org.openkilda.messaging.command.CommandMessage) InfoMessage(org.openkilda.messaging.info.InfoMessage) Values(org.apache.storm.tuple.Values) DeactivateFlowMonitoringInfoData(org.openkilda.server42.control.messaging.flowrtt.DeactivateFlowMonitoringInfoData)

Example 3 with DeactivateFlowMonitoringInfoData

use of org.openkilda.server42.control.messaging.flowrtt.DeactivateFlowMonitoringInfoData in project open-kilda by telstra.

the class FlowUpdateHubBolt method sendDeactivateFlowMonitoring.

@Override
public void sendDeactivateFlowMonitoring(String flow, SwitchId srcSwitchId, SwitchId dstSwitchId) {
    // TODO(nmarchenko) move that to some util method to avoid duplicate with delete
    DeactivateFlowMonitoringInfoData payload = DeactivateFlowMonitoringInfoData.builder().flowId(flow).switchId(dstSwitchId).switchId(srcSwitchId).build();
    Message message = new InfoMessage(payload, getCommandContext().getCreateTime(), getCommandContext().getCorrelationId());
    emitWithContext(HUB_TO_SERVER42_CONTROL_TOPOLOGY_SENDER.name(), getCurrentTuple(), new Values(flow, message));
}
Also used : InfoMessage(org.openkilda.messaging.info.InfoMessage) CommandMessage(org.openkilda.messaging.command.CommandMessage) Message(org.openkilda.messaging.Message) InfoMessage(org.openkilda.messaging.info.InfoMessage) Values(org.apache.storm.tuple.Values) DeactivateFlowMonitoringInfoData(org.openkilda.server42.control.messaging.flowrtt.DeactivateFlowMonitoringInfoData)

Example 4 with DeactivateFlowMonitoringInfoData

use of org.openkilda.server42.control.messaging.flowrtt.DeactivateFlowMonitoringInfoData 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

DeactivateFlowMonitoringInfoData (org.openkilda.server42.control.messaging.flowrtt.DeactivateFlowMonitoringInfoData)4 Values (org.apache.storm.tuple.Values)3 Message (org.openkilda.messaging.Message)3 CommandMessage (org.openkilda.messaging.command.CommandMessage)3 InfoMessage (org.openkilda.messaging.info.InfoMessage)3 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 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