Search in sources :

Example 1 with GroupInstallCommand

use of org.openkilda.floodlight.command.group.GroupInstallCommand 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

GroupInstallCommand (org.openkilda.floodlight.command.group.GroupInstallCommand)1 FlowTransitData (org.openkilda.floodlight.model.FlowTransitData)1 MessageContext (org.openkilda.messaging.MessageContext)1 InstallGroupRequest (org.openkilda.messaging.command.switches.InstallGroupRequest)1 InfoMessage (org.openkilda.messaging.info.InfoMessage)1 InstallGroupResponse (org.openkilda.messaging.info.switches.InstallGroupResponse)1 FlowTransitEncapsulation (org.openkilda.model.FlowTransitEncapsulation)1 MirrorConfig (org.openkilda.model.MirrorConfig)1 SwitchId (org.openkilda.model.SwitchId)1