Search in sources :

Example 1 with Flow

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

the class YFlowCreateHubBolt method sendActivateFlowMonitoring.

@Override
public void sendActivateFlowMonitoring(@NonNull RequestedFlow flow) {
    ActivateFlowMonitoringInfoData payload = RequestedFlowMapper.INSTANCE.toActivateFlowMonitoringInfoData(flow);
    Message message = new InfoMessage(payload, getCommandContext().getCreateTime(), getCommandContext().getCorrelationId());
    emitWithContext(HUB_TO_SERVER42_CONTROL_TOPOLOGY_SENDER.name(), getCurrentTuple(), new Values(flow.getFlowId(), 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) ActivateFlowMonitoringInfoData(org.openkilda.server42.control.messaging.flowrtt.ActivateFlowMonitoringInfoData)

Example 2 with Flow

use of org.openkilda.server42.control.messaging.flowrtt.FlowRttControl.Flow 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 3 with Flow

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

the class YFlowUpdateHubBolt method sendActivateFlowMonitoring.

@Override
public void sendActivateFlowMonitoring(@NonNull RequestedFlow flow) {
    ActivateFlowMonitoringInfoData payload = RequestedFlowMapper.INSTANCE.toActivateFlowMonitoringInfoData(flow);
    Message message = new InfoMessage(payload, getCommandContext().getCreateTime(), getCommandContext().getCorrelationId());
    emitWithContext(HUB_TO_SERVER42_CONTROL_TOPOLOGY_SENDER.name(), getCurrentTuple(), new Values(flow.getFlowId(), message));
}
Also used : InfoMessage(org.openkilda.messaging.info.InfoMessage) CommandMessage(org.openkilda.messaging.command.CommandMessage) Message(org.openkilda.messaging.Message) ErrorMessage(org.openkilda.messaging.error.ErrorMessage) InfoMessage(org.openkilda.messaging.info.InfoMessage) Values(org.apache.storm.tuple.Values) ActivateFlowMonitoringInfoData(org.openkilda.server42.control.messaging.flowrtt.ActivateFlowMonitoringInfoData)

Example 4 with Flow

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

the class YFlowRerouteHubBolt method sendActivateFlowMonitoring.

@Override
public void sendActivateFlowMonitoring(@NonNull RequestedFlow flow) {
    ActivateFlowMonitoringInfoData payload = RequestedFlowMapper.INSTANCE.toActivateFlowMonitoringInfoData(flow);
    Message message = new InfoMessage(payload, getCommandContext().getCreateTime(), getCommandContext().getCorrelationId());
    emitWithContext(HUB_TO_SERVER42_CONTROL_TOPOLOGY_SENDER.name(), getCurrentTuple(), new Values(flow.getFlowId(), 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) ActivateFlowMonitoringInfoData(org.openkilda.server42.control.messaging.flowrtt.ActivateFlowMonitoringInfoData)

Example 5 with Flow

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

Aggregations

Test (org.junit.Test)11 SwitchId (org.openkilda.model.SwitchId)10 InfoMessage (org.openkilda.messaging.info.InfoMessage)9 FlowDirection (org.openkilda.server42.messaging.FlowDirection)9 Duration (java.time.Duration)8 Values (org.apache.storm.tuple.Values)8 RunWith (org.junit.runner.RunWith)8 Mockito.verify (org.mockito.Mockito.verify)8 Message (org.openkilda.messaging.Message)8 CommandMessage (org.openkilda.messaging.command.CommandMessage)8 Arrays (java.util.Arrays)7 Assert.assertEquals (org.junit.Assert.assertEquals)7 Assert.assertTrue (org.junit.Assert.assertTrue)7 Before (org.junit.Before)7 Mock (org.mockito.Mock)7 Mockito.times (org.mockito.Mockito.times)7 Mockito.verifyNoMoreInteractions (org.mockito.Mockito.verifyNoMoreInteractions)7 MockitoJUnitRunner (org.mockito.junit.MockitoJUnitRunner)7 UpdateFlowCommand (org.openkilda.messaging.info.flow.UpdateFlowCommand)7 FlowPathDto (org.openkilda.messaging.model.FlowPathDto)7