Search in sources :

Example 1 with GroupModifyCommand

use of org.openkilda.floodlight.command.group.GroupModifyCommand in project open-kilda by telstra.

the class RecordHandler method doModifyGroupRequest.

private void doModifyGroupRequest(CommandMessage message) {
    SwitchId switchId = ((ModifyGroupRequest) message.getData()).getSwitchId();
    MirrorConfig mirrorConfig = ((ModifyGroupRequest) message.getData()).getMirrorConfig();
    FlowTransitEncapsulation encapsulation = ((ModifyGroupRequest) message.getData()).getEncapsulation();
    SwitchId egressSwitchId = ((ModifyGroupRequest) message.getData()).getEgressSwitchId();
    FlowTransitData flowTransitData = null;
    if (encapsulation != null) {
        flowTransitData = FlowTransitData.builder().ingressSwitchId(switchId).egressSwitchId(egressSwitchId).encapsulation(encapsulation).build();
    }
    logger.debug("Modify group '{}' for switch '{}'", mirrorConfig.getGroupId().intValue(), switchId);
    handleSpeakerCommand(new GroupModifyCommand(new MessageContext(message), switchId, mirrorConfig, flowTransitData));
    ModifyGroupResponse response = new ModifyGroupResponse(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) MirrorConfig(org.openkilda.model.MirrorConfig) InfoMessage(org.openkilda.messaging.info.InfoMessage) ModifyGroupResponse(org.openkilda.messaging.info.switches.ModifyGroupResponse) FlowTransitEncapsulation(org.openkilda.model.FlowTransitEncapsulation) SwitchId(org.openkilda.model.SwitchId) MessageContext(org.openkilda.messaging.MessageContext) GroupModifyCommand(org.openkilda.floodlight.command.group.GroupModifyCommand) ModifyGroupRequest(org.openkilda.messaging.command.switches.ModifyGroupRequest)

Aggregations

GroupModifyCommand (org.openkilda.floodlight.command.group.GroupModifyCommand)1 FlowTransitData (org.openkilda.floodlight.model.FlowTransitData)1 MessageContext (org.openkilda.messaging.MessageContext)1 ModifyGroupRequest (org.openkilda.messaging.command.switches.ModifyGroupRequest)1 InfoMessage (org.openkilda.messaging.info.InfoMessage)1 ModifyGroupResponse (org.openkilda.messaging.info.switches.ModifyGroupResponse)1 FlowTransitEncapsulation (org.openkilda.model.FlowTransitEncapsulation)1 MirrorConfig (org.openkilda.model.MirrorConfig)1 SwitchId (org.openkilda.model.SwitchId)1