Search in sources :

Example 1 with MeterDumpResponse

use of org.openkilda.messaging.info.meter.MeterDumpResponse in project open-kilda by telstra.

the class SwitchManagerHub method onWorkerResponse.

@Override
protected void onWorkerResponse(Tuple input) throws PipelineException {
    String key = KeyProvider.getParentKey(input.getStringByField(MessageKafkaTranslator.FIELD_ID_KEY));
    Message message = pullValue(input, MessageKafkaTranslator.FIELD_ID_PAYLOAD, Message.class);
    if (message instanceof InfoMessage) {
        InfoData data = ((InfoMessage) message).getData();
        if (data instanceof FlowDumpResponse) {
            validateService.handleFlowEntriesResponse(key, (FlowDumpResponse) data);
        } else if (data instanceof GroupDumpResponse) {
            validateService.handleGroupEntriesResponse(key, (GroupDumpResponse) data);
        } else if (data instanceof DumpLogicalPortsResponse) {
            validateService.handleLogicalPortResponse(key, (DumpLogicalPortsResponse) data);
        } else if (data instanceof MeterDumpResponse) {
            validateService.handleMeterEntriesResponse(key, (MeterDumpResponse) data);
        } else if (data instanceof SwitchMeterData) {
            handleMetersResponse(key, (SwitchMeterData) data);
        } else if (data instanceof FlowInstallResponse) {
            syncService.handleInstallRulesResponse(key);
        } else if (data instanceof FlowRemoveResponse) {
            syncService.handleRemoveRulesResponse(key);
        } else if (data instanceof FlowReinstallResponse) {
            syncService.handleReinstallDefaultRulesResponse(key, (FlowReinstallResponse) data);
        } else if (data instanceof DeleteMeterResponse) {
            syncService.handleRemoveMetersResponse(key);
        } else if (data instanceof ModifyMeterResponse) {
            syncService.handleModifyMetersResponse(key);
        } else if (data instanceof InstallGroupResponse) {
            syncService.handleInstallGroupResponse(key);
        } else if (data instanceof ModifyGroupResponse) {
            syncService.handleModifyGroupResponse(key);
        } else if (data instanceof DeleteGroupResponse) {
            syncService.handleDeleteGroupResponse(key);
        } else if (data instanceof SwitchRulesResponse) {
            switchRuleService.rulesResponse(key, (SwitchRulesResponse) data);
        } else if (data instanceof CreateLogicalPortResponse) {
            createLagPortService.handleGrpcResponse(key, (CreateLogicalPortResponse) data);
            syncService.handleCreateLogicalPortResponse(key);
        } else if (data instanceof DeleteLogicalPortResponse) {
            deleteLagPortService.handleGrpcResponse(key, (DeleteLogicalPortResponse) data);
            syncService.handleDeleteLogicalPortResponse(key);
        } else {
            log.warn("Receive unexpected InfoData for key {}: {}", key, data);
        }
    } else if (message instanceof ErrorMessage) {
        log.warn("Receive ErrorMessage for key {}", key);
        validateService.handleTaskError(key, (ErrorMessage) message);
        syncService.handleTaskError(key, (ErrorMessage) message);
        createLagPortService.handleTaskError(key, (ErrorMessage) message);
        deleteLagPortService.handleTaskError(key, (ErrorMessage) message);
    }
}
Also used : DumpLogicalPortsResponse(org.openkilda.messaging.info.grpc.DumpLogicalPortsResponse) SwitchMeterData(org.openkilda.messaging.info.meter.SwitchMeterData) FlowDumpResponse(org.openkilda.messaging.info.flow.FlowDumpResponse) FlowReinstallResponse(org.openkilda.messaging.info.flow.FlowReinstallResponse) InfoMessage(org.openkilda.messaging.info.InfoMessage) CommandMessage(org.openkilda.messaging.command.CommandMessage) Message(org.openkilda.messaging.Message) ErrorMessage(org.openkilda.messaging.error.ErrorMessage) ModifyMeterResponse(org.openkilda.messaging.info.switches.ModifyMeterResponse) DeleteMeterResponse(org.openkilda.messaging.info.switches.DeleteMeterResponse) FlowInstallResponse(org.openkilda.messaging.info.flow.FlowInstallResponse) DeleteLogicalPortResponse(org.openkilda.messaging.info.grpc.DeleteLogicalPortResponse) FlowRemoveResponse(org.openkilda.messaging.info.flow.FlowRemoveResponse) CreateLogicalPortResponse(org.openkilda.messaging.info.grpc.CreateLogicalPortResponse) DeleteGroupResponse(org.openkilda.messaging.info.switches.DeleteGroupResponse) GroupDumpResponse(org.openkilda.messaging.info.group.GroupDumpResponse) InfoMessage(org.openkilda.messaging.info.InfoMessage) InfoData(org.openkilda.messaging.info.InfoData) InstallGroupResponse(org.openkilda.messaging.info.switches.InstallGroupResponse) SwitchRulesResponse(org.openkilda.messaging.info.switches.SwitchRulesResponse) MeterDumpResponse(org.openkilda.messaging.info.meter.MeterDumpResponse) ModifyGroupResponse(org.openkilda.messaging.info.switches.ModifyGroupResponse) ErrorMessage(org.openkilda.messaging.error.ErrorMessage)

Example 2 with MeterDumpResponse

use of org.openkilda.messaging.info.meter.MeterDumpResponse in project open-kilda by telstra.

the class RecordHandler method dumpRuleManagerMeters.

private void dumpRuleManagerMeters(SwitchId switchId, java.util.function.Consumer<MessageData> sender) {
    try {
        logger.debug("Get all meters for switch {}", switchId);
        ISwitchManager switchManager = context.getSwitchManager();
        DatapathId datapathId = DatapathId.of(switchId.toLong());
        List<OFMeterConfig> meterEntries = switchManager.dumpMeters(datapathId);
        IOFSwitch iofSwitch = switchManager.lookupSwitch(datapathId);
        boolean inaccurate = featureDetectorService.detectSwitch(iofSwitch).contains(SwitchFeature.INACCURATE_METER);
        List<MeterSpeakerData> meters = meterEntries.stream().map(entry -> org.openkilda.floodlight.converter.rulemanager.OfMeterConverter.INSTANCE.convertToMeterSpeakerData(entry, inaccurate)).collect(Collectors.toList());
        MeterDumpResponse response = MeterDumpResponse.builder().switchId(switchId).meterSpeakerData(meters).build();
        sender.accept(response);
    } catch (UnsupportedSwitchOperationException e) {
        logger.info("Meters not supported: {}", switchId);
        sender.accept(new SwitchMeterUnsupported(switchId));
    } catch (SwitchNotFoundException e) {
        logger.info("Dumping switch meters is unsuccessful. Switch {} not found", switchId);
        ErrorData errorData = anError(ErrorType.NOT_FOUND).withMessage(e.getMessage()).withDescription(switchId.toString()).buildData();
        sender.accept(errorData);
    } catch (SwitchOperationException e) {
        logger.error("Unable to dump meters", e);
        ErrorData errorData = anError(ErrorType.NOT_FOUND).withMessage(e.getMessage()).withDescription("Unable to dump meters").buildData();
        sender.accept(errorData);
    }
}
Also used : MirrorConfig(org.openkilda.model.MirrorConfig) OFPortDesc(org.projectfloodlight.openflow.protocol.OFPortDesc) GroupModifyCommand(org.openkilda.floodlight.command.group.GroupModifyCommand) SwitchMeterUnsupported(org.openkilda.messaging.info.meter.SwitchMeterUnsupported) OfFlowStatsMapper(org.openkilda.floodlight.converter.OfFlowStatsMapper) DeleteMeterRequest(org.openkilda.messaging.command.flow.DeleteMeterRequest) CommandMessage(org.openkilda.messaging.command.CommandMessage) MULTITABLE_POST_INGRESS_DROP_COOKIE(org.openkilda.model.cookie.Cookie.MULTITABLE_POST_INGRESS_DROP_COOKIE) Map(java.util.Map) DeleteRulesAction(org.openkilda.messaging.command.switches.DeleteRulesAction) DumpPortDescriptionRequest(org.openkilda.messaging.command.switches.DumpPortDescriptionRequest) RemoveFlow(org.openkilda.messaging.command.flow.RemoveFlow) SwitchGroupEntries(org.openkilda.messaging.info.rule.SwitchGroupEntries) PortStatus(org.openkilda.model.PortStatus) SetupBfdSessionDispatcher(org.openkilda.floodlight.kafka.dispatcher.SetupBfdSessionDispatcher) InvalidMeterIdException(org.openkilda.floodlight.error.InvalidMeterIdException) AliveResponse(org.openkilda.messaging.AliveResponse) MULTITABLE_PRE_INGRESS_PASS_THROUGH_COOKIE(org.openkilda.model.cookie.Cookie.MULTITABLE_PRE_INGRESS_PASS_THROUGH_COOKIE) MessageContext(org.openkilda.messaging.MessageContext) CookieType(org.openkilda.model.cookie.CookieBase.CookieType) GroupEntry(org.openkilda.messaging.info.rule.GroupEntry) CommandProcessorService(org.openkilda.floodlight.service.CommandProcessorService) OFMeterConfig(org.projectfloodlight.openflow.protocol.OFMeterConfig) ROUND_TRIP_LATENCY_RULE_COOKIE(org.openkilda.model.cookie.Cookie.ROUND_TRIP_LATENCY_RULE_COOKIE) ReinstallServer42FlowForSwitchManagerRequest(org.openkilda.messaging.command.flow.ReinstallServer42FlowForSwitchManagerRequest) LLDP_INGRESS_COOKIE(org.openkilda.model.cookie.Cookie.LLDP_INGRESS_COOKIE) BaseSpeakerCommandsRequest(org.openkilda.floodlight.api.request.rulemanager.BaseSpeakerCommandsRequest) InstallIngressFlow(org.openkilda.messaging.command.flow.InstallIngressFlow) Command(org.openkilda.floodlight.command.Command) SwitchTrackingService(org.openkilda.floodlight.switchmanager.SwitchTrackingService) PortDescription(org.openkilda.messaging.info.switches.PortDescription) BaseInstallFlow(org.openkilda.messaging.command.flow.BaseInstallFlow) TransitFlowLoopSegmentInstallCommand(org.openkilda.floodlight.command.flow.transit.TransitFlowLoopSegmentInstallCommand) ModifyGroupResponse(org.openkilda.messaging.info.switches.ModifyGroupResponse) SpeakerCommand(org.openkilda.floodlight.command.SpeakerCommand) SwitchPortsDescription(org.openkilda.messaging.info.switches.SwitchPortsDescription) DumpGroupsForFlowHsRequest(org.openkilda.messaging.command.switches.DumpGroupsForFlowHsRequest) FlowEndpoint(org.openkilda.model.FlowEndpoint) GroupDumpResponse(org.openkilda.messaging.info.group.GroupDumpResponse) CorrelationContextClosable(org.openkilda.floodlight.utils.CorrelationContext.CorrelationContextClosable) NetworkCommandData(org.openkilda.messaging.command.discovery.NetworkCommandData) ErrorType(org.openkilda.messaging.error.ErrorType) SERVER_42_ISL_RTT_OUTPUT_COOKIE(org.openkilda.model.cookie.Cookie.SERVER_42_ISL_RTT_OUTPUT_COOKIE) MeterDumpResponse(org.openkilda.messaging.info.meter.MeterDumpResponse) IOException(java.io.IOException) FeatureDetectorService(org.openkilda.floodlight.service.FeatureDetectorService) InstallTransitLoopFlow(org.openkilda.messaging.command.flow.InstallTransitLoopFlow) PortStatusData(org.openkilda.messaging.info.stats.PortStatusData) InstallIslDefaultRulesCommand(org.openkilda.messaging.payload.switches.InstallIslDefaultRulesCommand) FlowSharedSegmentCookie(org.openkilda.model.cookie.FlowSharedSegmentCookie) DumpRulesForFlowHsRequest(org.openkilda.messaging.command.switches.DumpRulesForFlowHsRequest) InstallSharedFlow(org.openkilda.messaging.command.flow.InstallSharedFlow) PortConfigurationResponse(org.openkilda.messaging.info.switches.PortConfigurationResponse) DeleteGroupRequest(org.openkilda.messaging.command.switches.DeleteGroupRequest) GroupInstallCommand(org.openkilda.floodlight.command.group.GroupInstallCommand) DatapathId(org.projectfloodlight.openflow.types.DatapathId) SpeakerCommandReport(org.openkilda.floodlight.command.SpeakerCommandReport) OneSwitchFlowInstallCommand(org.openkilda.floodlight.command.flow.ingress.OneSwitchFlowInstallCommand) DumpMetersForSwitchManagerRequest(org.openkilda.messaging.command.switches.DumpMetersForSwitchManagerRequest) ModifyDefaultMeterForSwitchManagerRequest(org.openkilda.messaging.command.flow.ModifyDefaultMeterForSwitchManagerRequest) FlowSegmentResponseFactory(org.openkilda.floodlight.command.flow.FlowSegmentResponseFactory) OfPortDescConverter(org.openkilda.floodlight.converter.OfPortDescConverter) PingRequestDispatcher(org.openkilda.floodlight.kafka.dispatcher.PingRequestDispatcher) SwitchFeature(org.openkilda.model.SwitchFeature) FlowSegmentSyncResponseFactory(org.openkilda.floodlight.command.flow.FlowSegmentSyncResponseFactory) DeleteGroupResponse(org.openkilda.messaging.info.switches.DeleteGroupResponse) LLDP_POST_INGRESS_COOKIE(org.openkilda.model.cookie.Cookie.LLDP_POST_INGRESS_COOKIE) OneSwitchMirrorFlowInstallCommand(org.openkilda.floodlight.command.flow.ingress.OneSwitchMirrorFlowInstallCommand) SwitchOperationException(org.openkilda.floodlight.error.SwitchOperationException) SwitchRulesInstallRequest(org.openkilda.messaging.command.switches.SwitchRulesInstallRequest) RemoveIslDefaultRulesCommand(org.openkilda.messaging.payload.switches.RemoveIslDefaultRulesCommand) OFFlowStatsEntry(org.projectfloodlight.openflow.protocol.OFFlowStatsEntry) InstallIngressMirrorFlow(org.openkilda.messaging.command.flow.InstallIngressMirrorFlow) ModifyGroupRequest(org.openkilda.messaging.command.switches.ModifyGroupRequest) InstallFlowForSwitchManagerRequest(org.openkilda.messaging.command.flow.InstallFlowForSwitchManagerRequest) ISwitchManager(org.openkilda.floodlight.switchmanager.ISwitchManager) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) CommandContext(org.openkilda.floodlight.command.CommandContext) Objects(java.util.Objects) MacAddress(org.openkilda.model.MacAddress) MULTITABLE_EGRESS_PASS_THROUGH_COOKIE(org.openkilda.model.cookie.Cookie.MULTITABLE_EGRESS_PASS_THROUGH_COOKIE) SwitchNotFoundException(org.openkilda.floodlight.error.SwitchNotFoundException) ARP_POST_INGRESS_VXLAN_COOKIE(org.openkilda.model.cookie.Cookie.ARP_POST_INGRESS_VXLAN_COOKIE) DumpRulesForSwitchManagerRequest(org.openkilda.messaging.command.switches.DumpRulesForSwitchManagerRequest) ARP_INGRESS_COOKIE(org.openkilda.model.cookie.Cookie.ARP_INGRESS_COOKIE) SwitchPortStatusData(org.openkilda.messaging.info.stats.SwitchPortStatusData) MULTITABLE_TRANSIT_DROP_COOKIE(org.openkilda.model.cookie.Cookie.MULTITABLE_TRANSIT_DROP_COOKIE) SERVER_42_FLOW_RTT_TURNING_COOKIE(org.openkilda.model.cookie.Cookie.SERVER_42_FLOW_RTT_TURNING_COOKIE) RemoveFlowForSwitchManagerRequest(org.openkilda.messaging.command.flow.RemoveFlowForSwitchManagerRequest) FlowTransitEncapsulation(org.openkilda.model.FlowTransitEncapsulation) DumpSwitchPortsDescriptionRequest(org.openkilda.messaging.command.switches.DumpSwitchPortsDescriptionRequest) CATCH_BFD_RULE_COOKIE(org.openkilda.model.cookie.Cookie.CATCH_BFD_RULE_COOKIE) HashSet(java.util.HashSet) DumpMetersForFlowHsRequest(org.openkilda.messaging.command.switches.DumpMetersForFlowHsRequest) ImmutableList(com.google.common.collect.ImmutableList) MULTITABLE_INGRESS_DROP_COOKIE(org.openkilda.model.cookie.Cookie.MULTITABLE_INGRESS_DROP_COOKIE) MAPPER(org.openkilda.messaging.Utils.MAPPER) BroadcastStatsRequestDispatcher(org.openkilda.floodlight.kafka.dispatcher.BroadcastStatsRequestDispatcher) ConnectModeResponse(org.openkilda.messaging.info.switches.ConnectModeResponse) SharedSegmentType(org.openkilda.model.cookie.FlowSharedSegmentCookie.SharedSegmentType) POST_INGRESS_TABLE_ID(org.openkilda.floodlight.switchmanager.SwitchManager.POST_INGRESS_TABLE_ID) MeterSpeakerData(org.openkilda.rulemanager.MeterSpeakerData) Logger(org.slf4j.Logger) EgressFlowSegmentInstallCommand(org.openkilda.floodlight.command.flow.egress.EgressFlowSegmentInstallCommand) MeterModifyCommand(org.openkilda.floodlight.command.meter.MeterModifyCommand) LLDP_INPUT_PRE_DROP_COOKIE(org.openkilda.model.cookie.Cookie.LLDP_INPUT_PRE_DROP_COOKIE) FlowSpeakerData(org.openkilda.rulemanager.FlowSpeakerData) MeterId(org.openkilda.model.MeterId) OfInstallException(org.openkilda.floodlight.error.OfInstallException) CommandDispatcher(org.openkilda.floodlight.kafka.dispatcher.CommandDispatcher) FlowDumpResponse(org.openkilda.messaging.info.flow.FlowDumpResponse) GroupId(org.openkilda.model.GroupId) DROP_VERIFICATION_LOOP_RULE_COOKIE(org.openkilda.model.cookie.Cookie.DROP_VERIFICATION_LOOP_RULE_COOKIE) VERIFICATION_UNICAST_VXLAN_RULE_COOKIE(org.openkilda.model.cookie.Cookie.VERIFICATION_UNICAST_VXLAN_RULE_COOKIE) IOFSwitch(net.floodlightcontroller.core.IOFSwitch) SERVER_42_FLOW_RTT_VXLAN_TURNING_COOKIE(org.openkilda.model.cookie.Cookie.SERVER_42_FLOW_RTT_VXLAN_TURNING_COOKIE) RemoveBfdSessionDispatcher(org.openkilda.floodlight.kafka.dispatcher.RemoveBfdSessionDispatcher) DeleteMeterResponse(org.openkilda.messaging.info.switches.DeleteMeterResponse) SwitchFlowEntries(org.openkilda.messaging.info.rule.SwitchFlowEntries) DiscoverIslCommandData(org.openkilda.messaging.command.discovery.DiscoverIslCommandData) IngressMirrorFlowSegmentInstallCommand(org.openkilda.floodlight.command.flow.ingress.IngressMirrorFlowSegmentInstallCommand) BroadcastWrapper(org.openkilda.messaging.command.BroadcastWrapper) RulesContext(org.openkilda.floodlight.model.RulesContext) IKafkaProducerService(org.openkilda.floodlight.service.kafka.IKafkaProducerService) EgressMirrorFlowSegmentInstallCommand(org.openkilda.floodlight.command.flow.egress.EgressMirrorFlowSegmentInstallCommand) FlowTransitData(org.openkilda.floodlight.model.FlowTransitData) Set(java.util.Set) OfFlowConverter(org.openkilda.floodlight.converter.rulemanager.OfFlowConverter) SwitchMeterEntries(org.openkilda.messaging.info.meter.SwitchMeterEntries) CorrelationContext(org.openkilda.floodlight.utils.CorrelationContext) MeterModifyCommandRequest(org.openkilda.messaging.command.flow.MeterModifyCommandRequest) ConsumerRecord(org.apache.kafka.clients.consumer.ConsumerRecord) PortsCommandData(org.openkilda.messaging.command.discovery.PortsCommandData) Message(org.openkilda.messaging.Message) InstallServer42IngressFlow(org.openkilda.messaging.command.flow.InstallServer42IngressFlow) MeterEntry(org.openkilda.messaging.info.meter.MeterEntry) MessageData(org.openkilda.messaging.MessageData) RemoveIslDefaultRulesResult(org.openkilda.messaging.info.discovery.RemoveIslDefaultRulesResult) ArrayList(java.util.ArrayList) SpeakerDataResponse(org.openkilda.floodlight.api.response.SpeakerDataResponse) InstallIngressLoopFlow(org.openkilda.messaging.command.flow.InstallIngressLoopFlow) LLDP_TRANSIT_COOKIE(org.openkilda.model.cookie.Cookie.LLDP_TRANSIT_COOKIE) GroupRemoveCommand(org.openkilda.floodlight.command.group.GroupRemoveCommand) DiscoverPathCommandData(org.openkilda.messaging.command.discovery.DiscoverPathCommandData) AliveRequest(org.openkilda.messaging.AliveRequest) FlowCommandErrorData(org.openkilda.messaging.error.rule.FlowCommandErrorData) FlowEntry(org.openkilda.messaging.info.rule.FlowEntry) PortColourCookie(org.openkilda.model.cookie.PortColourCookie) DROP_RULE_COOKIE(org.openkilda.model.cookie.Cookie.DROP_RULE_COOKIE) InstallOneSwitchFlow(org.openkilda.messaging.command.flow.InstallOneSwitchFlow) InstallRulesAction(org.openkilda.messaging.command.switches.InstallRulesAction) TRANSIT_TABLE_ID(org.openkilda.floodlight.switchmanager.SwitchManager.TRANSIT_TABLE_ID) InstallGroupRequest(org.openkilda.messaging.command.switches.InstallGroupRequest) InstallEgressMirrorFlow(org.openkilda.messaging.command.flow.InstallEgressMirrorFlow) VERIFICATION_UNICAST_RULE_COOKIE(org.openkilda.model.cookie.Cookie.VERIFICATION_UNICAST_RULE_COOKIE) FlowCommandException(org.openkilda.floodlight.error.FlowCommandException) GroupSpeakerData(org.openkilda.rulemanager.GroupSpeakerData) InstallIslDefaultRulesResult(org.openkilda.messaging.info.discovery.InstallIslDefaultRulesResult) FlowRemoveResponse(org.openkilda.messaging.info.flow.FlowRemoveResponse) FlowSegmentWrapperCommand(org.openkilda.floodlight.command.flow.FlowSegmentWrapperCommand) VERIFICATION_BROADCAST_RULE_COOKIE(org.openkilda.model.cookie.Cookie.VERIFICATION_BROADCAST_RULE_COOKIE) ErrorMessage(org.openkilda.messaging.error.ErrorMessage) InfoMessage(org.openkilda.messaging.info.InfoMessage) IngressFlowLoopSegmentInstallCommand(org.openkilda.floodlight.command.flow.ingress.IngressFlowLoopSegmentInstallCommand) DumpMetersRequest(org.openkilda.messaging.command.switches.DumpMetersRequest) InstallServer42Flow(org.openkilda.messaging.command.flow.InstallServer42Flow) IngressFlowSegmentInstallCommand(org.openkilda.floodlight.command.flow.ingress.IngressFlowSegmentInstallCommand) ARP_POST_INGRESS_COOKIE(org.openkilda.model.cookie.Cookie.ARP_POST_INGRESS_COOKIE) DeleteRulesCriteria(org.openkilda.messaging.command.switches.DeleteRulesCriteria) LoggerFactory(org.slf4j.LoggerFactory) InstallTransitFlow(org.openkilda.messaging.command.flow.InstallTransitFlow) ARP_INPUT_PRE_DROP_COOKIE(org.openkilda.model.cookie.Cookie.ARP_INPUT_PRE_DROP_COOKIE) InstallOneSwitchMirrorFlow(org.openkilda.messaging.command.flow.InstallOneSwitchMirrorFlow) DumpGroupsForSwitchManagerRequest(org.openkilda.messaging.command.switches.DumpGroupsForSwitchManagerRequest) SwitchRulesDeleteRequest(org.openkilda.messaging.command.switches.SwitchRulesDeleteRequest) BaseFlow(org.openkilda.messaging.command.flow.BaseFlow) SERVER_42_FLOW_RTT_OUTPUT_VXLAN_COOKIE(org.openkilda.model.cookie.Cookie.SERVER_42_FLOW_RTT_OUTPUT_VXLAN_COOKIE) ReinstallDefaultFlowForSwitchManagerRequest(org.openkilda.messaging.command.flow.ReinstallDefaultFlowForSwitchManagerRequest) InstallGroupResponse(org.openkilda.messaging.info.switches.InstallGroupResponse) PortConfigurationRequest(org.openkilda.messaging.command.switches.PortConfigurationRequest) MeterConfig(org.openkilda.model.MeterConfig) ConnectModeRequest(org.openkilda.messaging.command.switches.ConnectModeRequest) TypeReference(com.fasterxml.jackson.core.type.TypeReference) ModifyFlowMeterForSwitchManagerRequest(org.openkilda.messaging.command.flow.ModifyFlowMeterForSwitchManagerRequest) OFGroupDescStatsEntry(org.projectfloodlight.openflow.protocol.OFGroupDescStatsEntry) LLDP_POST_INGRESS_VXLAN_COOKIE(org.openkilda.model.cookie.Cookie.LLDP_POST_INGRESS_VXLAN_COOKIE) ModifyMeterResponse(org.openkilda.messaging.info.switches.ModifyMeterResponse) FlowReinstallResponse(org.openkilda.messaging.info.flow.FlowReinstallResponse) IngressServer42FlowInstallCommand(org.openkilda.floodlight.command.flow.ingress.IngressServer42FlowInstallCommand) InfoData(org.openkilda.messaging.info.InfoData) OfGroupConverter(org.openkilda.floodlight.converter.rulemanager.OfGroupConverter) TransitFlowSegmentInstallCommand(org.openkilda.floodlight.command.flow.transit.TransitFlowSegmentInstallCommand) String.format(java.lang.String.format) UnsupportedSwitchOperationException(org.openkilda.floodlight.error.UnsupportedSwitchOperationException) InstallEgressFlow(org.openkilda.messaging.command.flow.InstallEgressFlow) DumpRulesRequest(org.openkilda.messaging.command.switches.DumpRulesRequest) List(java.util.List) INGRESS_TABLE_ID(org.openkilda.floodlight.switchmanager.SwitchManager.INGRESS_TABLE_ID) FlowSegmentMetadata(org.openkilda.floodlight.model.FlowSegmentMetadata) FlowInstallResponse(org.openkilda.messaging.info.flow.FlowInstallResponse) Optional(java.util.Optional) JsonMappingException(com.fasterxml.jackson.databind.JsonMappingException) CommandData(org.openkilda.messaging.command.CommandData) DeleterMeterForSwitchManagerRequest(org.openkilda.messaging.command.switches.DeleterMeterForSwitchManagerRequest) Getter(lombok.Getter) ARP_POST_INGRESS_ONE_SWITCH_COOKIE(org.openkilda.model.cookie.Cookie.ARP_POST_INGRESS_ONE_SWITCH_COOKIE) Cookie(org.openkilda.model.cookie.Cookie) SERVER_42_FLOW_RTT_OUTPUT_VLAN_COOKIE(org.openkilda.model.cookie.Cookie.SERVER_42_FLOW_RTT_OUTPUT_VLAN_COOKIE) ARP_TRANSIT_COOKIE(org.openkilda.model.cookie.Cookie.ARP_TRANSIT_COOKIE) ErrorMessageBuilder.anError(org.openkilda.floodlight.kafka.ErrorMessageBuilder.anError) SERVER_42_ISL_RTT_TURNING_COOKIE(org.openkilda.model.cookie.Cookie.SERVER_42_ISL_RTT_TURNING_COOKIE) OfMeterConverter(org.openkilda.floodlight.converter.OfMeterConverter) SwitchId(org.openkilda.model.SwitchId) SwitchRulesResponse(org.openkilda.messaging.info.switches.SwitchRulesResponse) VisibleForTesting(com.google.common.annotations.VisibleForTesting) ErrorData(org.openkilda.messaging.error.ErrorData) LLDP_POST_INGRESS_ONE_SWITCH_COOKIE(org.openkilda.model.cookie.Cookie.LLDP_POST_INGRESS_ONE_SWITCH_COOKIE) SwitchOperationException(org.openkilda.floodlight.error.SwitchOperationException) UnsupportedSwitchOperationException(org.openkilda.floodlight.error.UnsupportedSwitchOperationException) IOFSwitch(net.floodlightcontroller.core.IOFSwitch) ISwitchManager(org.openkilda.floodlight.switchmanager.ISwitchManager) SwitchMeterUnsupported(org.openkilda.messaging.info.meter.SwitchMeterUnsupported) DatapathId(org.projectfloodlight.openflow.types.DatapathId) SwitchNotFoundException(org.openkilda.floodlight.error.SwitchNotFoundException) MeterSpeakerData(org.openkilda.rulemanager.MeterSpeakerData) UnsupportedSwitchOperationException(org.openkilda.floodlight.error.UnsupportedSwitchOperationException) MeterDumpResponse(org.openkilda.messaging.info.meter.MeterDumpResponse) OFMeterConfig(org.projectfloodlight.openflow.protocol.OFMeterConfig) FlowCommandErrorData(org.openkilda.messaging.error.rule.FlowCommandErrorData) ErrorData(org.openkilda.messaging.error.ErrorData)

Example 3 with MeterDumpResponse

use of org.openkilda.messaging.info.meter.MeterDumpResponse in project open-kilda by telstra.

the class SwitchValidateServiceImplTest method handleDataReceiveAndValidate.

private void handleDataReceiveAndValidate() {
    service.handleFlowEntriesResponse(KEY, new FlowDumpResponse(SWITCH_ID, singletonList(flowSpeakerData)));
    service.handleMeterEntriesResponse(KEY, new MeterDumpResponse(SWITCH_ID, singletonList(meterSpeakerData)));
    service.handleGroupEntriesResponse(KEY, new GroupDumpResponse(SWITCH_ID, emptyList()));
    verify(validationService).validateRules(eq(SWITCH_ID), any(), any());
    verify(validationService).validateMeters(eq(SWITCH_ID), any(), any());
    verify(validationService).validateGroups(eq(SWITCH_ID), any(), any());
}
Also used : FlowDumpResponse(org.openkilda.messaging.info.flow.FlowDumpResponse) GroupDumpResponse(org.openkilda.messaging.info.group.GroupDumpResponse) MeterDumpResponse(org.openkilda.messaging.info.meter.MeterDumpResponse)

Aggregations

FlowDumpResponse (org.openkilda.messaging.info.flow.FlowDumpResponse)3 GroupDumpResponse (org.openkilda.messaging.info.group.GroupDumpResponse)3 MeterDumpResponse (org.openkilda.messaging.info.meter.MeterDumpResponse)3 Message (org.openkilda.messaging.Message)2 CommandMessage (org.openkilda.messaging.command.CommandMessage)2 ErrorMessage (org.openkilda.messaging.error.ErrorMessage)2 InfoData (org.openkilda.messaging.info.InfoData)2 InfoMessage (org.openkilda.messaging.info.InfoMessage)2 FlowInstallResponse (org.openkilda.messaging.info.flow.FlowInstallResponse)2 FlowReinstallResponse (org.openkilda.messaging.info.flow.FlowReinstallResponse)2 FlowRemoveResponse (org.openkilda.messaging.info.flow.FlowRemoveResponse)2 DeleteGroupResponse (org.openkilda.messaging.info.switches.DeleteGroupResponse)2 DeleteMeterResponse (org.openkilda.messaging.info.switches.DeleteMeterResponse)2 InstallGroupResponse (org.openkilda.messaging.info.switches.InstallGroupResponse)2 ModifyGroupResponse (org.openkilda.messaging.info.switches.ModifyGroupResponse)2 ModifyMeterResponse (org.openkilda.messaging.info.switches.ModifyMeterResponse)2 SwitchRulesResponse (org.openkilda.messaging.info.switches.SwitchRulesResponse)2 TypeReference (com.fasterxml.jackson.core.type.TypeReference)1 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1