Search in sources :

Example 21 with FlowTransitEncapsulation

use of org.openkilda.model.FlowTransitEncapsulation in project open-kilda by telstra.

the class RecordHandler method doInstallGroupRequest.

private void doInstallGroupRequest(CommandMessage message) {
    SwitchId switchId = ((InstallGroupRequest) message.getData()).getSwitchId();
    MirrorConfig mirrorConfig = ((InstallGroupRequest) message.getData()).getMirrorConfig();
    FlowTransitEncapsulation encapsulation = ((InstallGroupRequest) message.getData()).getEncapsulation();
    SwitchId egressSwitchId = ((InstallGroupRequest) message.getData()).getEgressSwitchId();
    FlowTransitData flowTransitData = null;
    if (encapsulation != null) {
        flowTransitData = FlowTransitData.builder().ingressSwitchId(switchId).egressSwitchId(egressSwitchId).encapsulation(encapsulation).build();
    }
    logger.debug("Install group '{}' for switch '{}'", mirrorConfig.getGroupId().intValue(), switchId);
    handleSpeakerCommand(new GroupInstallCommand(new MessageContext(message), switchId, mirrorConfig, flowTransitData));
    InstallGroupResponse response = new InstallGroupResponse(switchId, mirrorConfig.getGroupId().intValue());
    String correlationId = message.getCorrelationId();
    InfoMessage infoMessage = new InfoMessage(response, System.currentTimeMillis(), correlationId);
    getKafkaProducer().sendMessageAndTrack(context.getKafkaSwitchManagerTopic(), correlationId, infoMessage);
}
Also used : FlowTransitData(org.openkilda.floodlight.model.FlowTransitData) InstallGroupRequest(org.openkilda.messaging.command.switches.InstallGroupRequest) MirrorConfig(org.openkilda.model.MirrorConfig) InfoMessage(org.openkilda.messaging.info.InfoMessage) InstallGroupResponse(org.openkilda.messaging.info.switches.InstallGroupResponse) FlowTransitEncapsulation(org.openkilda.model.FlowTransitEncapsulation) SwitchId(org.openkilda.model.SwitchId) MessageContext(org.openkilda.messaging.MessageContext) GroupInstallCommand(org.openkilda.floodlight.command.group.GroupInstallCommand)

Aggregations

FlowTransitEncapsulation (org.openkilda.model.FlowTransitEncapsulation)21 SwitchId (org.openkilda.model.SwitchId)12 Test (org.junit.Test)8 ArrayList (java.util.ArrayList)7 Flow (org.openkilda.model.Flow)7 YFlow (org.openkilda.model.YFlow)6 InfoMessage (org.openkilda.messaging.info.InfoMessage)5 NetworkEndpoint (org.openkilda.messaging.model.NetworkEndpoint)5 Ping (org.openkilda.messaging.model.Ping)5 PathId (org.openkilda.model.PathId)5 Switch (org.openkilda.model.Switch)5 Ethernet (net.floodlightcontroller.packet.Ethernet)3 IPacket (net.floodlightcontroller.packet.IPacket)3 FlowEndpoint (org.openkilda.model.FlowEndpoint)3 PathSegment (org.openkilda.model.PathSegment)3 HashSet (java.util.HashSet)2 EgressFlowSegmentRequestFactory (org.openkilda.floodlight.api.request.factory.EgressFlowSegmentRequestFactory)2 FlowTransitData (org.openkilda.floodlight.model.FlowTransitData)2 InputService (org.openkilda.floodlight.service.of.InputService)2 MessageContext (org.openkilda.messaging.MessageContext)2