Search in sources :

Example 11 with Headers

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

the class FlowHandler method notifyDeactivateFlowMonitoring.

private void notifyDeactivateFlowMonitoring(SwitchId switchId) {
    ClearFlows clearFlows = ClearFlows.builder().headers(buildHeader()).build();
    emit(STREAM_CONTROL_COMMANDS_ID, getCurrentTuple(), new Values(switchId.toString(), clearFlows));
}
Also used : ClearFlows(org.openkilda.server42.control.messaging.flowrtt.ClearFlows) Values(org.apache.storm.tuple.Values)

Example 12 with Headers

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

the class FlowHandler method sendListOfFlowBySwitchId.

@Override
public void sendListOfFlowBySwitchId(SwitchId switchId, Set<String> flowOnSwitch) {
    ListFlowsOnSwitch listFlowsOnSwitch = ListFlowsOnSwitch.builder().headers(buildHeader()).flowIds(flowOnSwitch).build();
    emit(STREAM_CONTROL_COMMANDS_ID, getCurrentTuple(), new Values(switchId.toString(), listFlowsOnSwitch));
}
Also used : ListFlowsOnSwitch(org.openkilda.server42.control.messaging.flowrtt.ListFlowsOnSwitch) Values(org.apache.storm.tuple.Values)

Example 13 with Headers

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

the class GateTest method clearFlowsTest.

@Test
public void clearFlowsTest() throws Exception {
    Headers headers = Headers.builder().correlationId("some-correlation-id").build();
    ClearFlows clearFlows = ClearFlows.builder().headers(headers).build();
    String dpId = "00:00:1b:45:18:d6:71:5a";
    gate.listen(clearFlows, dpId);
    CommandPacket commandPacket = getCommandPacket();
    assertThat(commandPacket.getType()).isEqualTo(Type.CLEAR_FLOWS);
    assertThat(commandPacket.getCommandList()).hasSize(1);
    Any command = commandPacket.getCommand(0);
    assertThat(command.is(FlowRttControl.ClearFlowsFilter.class)).isTrue();
    FlowRttControl.ClearFlowsFilter unpack = command.unpack(FlowRttControl.ClearFlowsFilter.class);
    String dstMac = "1b:45:18:d6:71:5a";
    assertThat(unpack.getDstMac()).isEqualTo(dstMac);
}
Also used : Headers(org.openkilda.server42.control.messaging.flowrtt.Headers) ClearFlows(org.openkilda.server42.control.messaging.flowrtt.ClearFlows) FlowRttControl(org.openkilda.server42.control.messaging.flowrtt.FlowRttControl) CommandPacket(org.openkilda.server42.control.messaging.Control.CommandPacket) Any(com.google.protobuf.Any) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

Values (org.apache.storm.tuple.Values)7 Any (com.google.protobuf.Any)4 Headers (org.openkilda.server42.control.messaging.flowrtt.Headers)4 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)3 CommandPacket (org.openkilda.server42.control.messaging.Control.CommandPacket)3 CommandPacketResponse (org.openkilda.server42.control.messaging.Control.CommandPacketResponse)3 ClearFlows (org.openkilda.server42.control.messaging.flowrtt.ClearFlows)3 HashSet (java.util.HashSet)2 Test (org.junit.Test)2 SwitchId (org.openkilda.model.SwitchId)2 AddFlow (org.openkilda.server42.control.messaging.flowrtt.AddFlow)2 FlowRttControl (org.openkilda.server42.control.messaging.flowrtt.FlowRttControl)2 ListFlowsRequest (org.openkilda.server42.control.messaging.flowrtt.ListFlowsRequest)2 ListFlowsResponse (org.openkilda.server42.control.messaging.flowrtt.ListFlowsResponse)2 RemoveFlow (org.openkilda.server42.control.messaging.flowrtt.RemoveFlow)2 AddIsl (org.openkilda.server42.control.messaging.islrtt.AddIsl)2 ClearIsls (org.openkilda.server42.control.messaging.islrtt.ClearIsls)2 IslRttControl (org.openkilda.server42.control.messaging.islrtt.IslRttControl)2 ListIslsResponse (org.openkilda.server42.control.messaging.islrtt.ListIslsResponse)2 KafkaHandler (org.springframework.kafka.annotation.KafkaHandler)2