Search in sources :

Example 1 with MeterModifyCommand

use of org.openkilda.floodlight.command.meter.MeterModifyCommand in project open-kilda by telstra.

the class RecordHandler method doModifyFlowMeterForSwitchManager.

private void doModifyFlowMeterForSwitchManager(CommandMessage message) {
    ModifyFlowMeterForSwitchManagerRequest request = (ModifyFlowMeterForSwitchManagerRequest) message.getData();
    IKafkaProducerService producerService = getKafkaProducer();
    long meterId = request.getMeterId();
    SwitchId switchId = request.getSwitchId();
    MeterConfig meterConfig = new MeterConfig(new MeterId(request.getMeterId()), request.getRate());
    logger.info("Modifying flow meter {} on Switch {}", meterId, switchId);
    handleSpeakerCommand(new MeterModifyCommand(new MessageContext(message), switchId, meterConfig));
    InfoMessage response = new InfoMessage(new ModifyMeterResponse(switchId, request.getMeterId()), System.currentTimeMillis(), message.getCorrelationId());
    producerService.sendMessageAndTrack(context.getKafkaSwitchManagerTopic(), message.getCorrelationId(), response);
}
Also used : MeterModifyCommand(org.openkilda.floodlight.command.meter.MeterModifyCommand) ModifyMeterResponse(org.openkilda.messaging.info.switches.ModifyMeterResponse) IKafkaProducerService(org.openkilda.floodlight.service.kafka.IKafkaProducerService) InfoMessage(org.openkilda.messaging.info.InfoMessage) SwitchId(org.openkilda.model.SwitchId) MessageContext(org.openkilda.messaging.MessageContext) OFMeterConfig(org.projectfloodlight.openflow.protocol.OFMeterConfig) MeterConfig(org.openkilda.model.MeterConfig) ModifyFlowMeterForSwitchManagerRequest(org.openkilda.messaging.command.flow.ModifyFlowMeterForSwitchManagerRequest) MeterId(org.openkilda.model.MeterId)

Aggregations

MeterModifyCommand (org.openkilda.floodlight.command.meter.MeterModifyCommand)1 IKafkaProducerService (org.openkilda.floodlight.service.kafka.IKafkaProducerService)1 MessageContext (org.openkilda.messaging.MessageContext)1 ModifyFlowMeterForSwitchManagerRequest (org.openkilda.messaging.command.flow.ModifyFlowMeterForSwitchManagerRequest)1 InfoMessage (org.openkilda.messaging.info.InfoMessage)1 ModifyMeterResponse (org.openkilda.messaging.info.switches.ModifyMeterResponse)1 MeterConfig (org.openkilda.model.MeterConfig)1 MeterId (org.openkilda.model.MeterId)1 SwitchId (org.openkilda.model.SwitchId)1 OFMeterConfig (org.projectfloodlight.openflow.protocol.OFMeterConfig)1