Search in sources :

Example 1 with MeterModifyRequest

use of org.openkilda.messaging.nbtopology.request.MeterModifyRequest in project open-kilda by telstra.

the class FlowMeterModifyHubBolt method onRequest.

@Override
protected void onRequest(Tuple input) throws PipelineException {
    String key = input.getStringByField(MessageKafkaTranslator.FIELD_ID_KEY);
    CommandData data = pullValue(input, MessageKafkaTranslator.FIELD_ID_PAYLOAD, CommandData.class);
    if (data instanceof MeterModifyRequest) {
        service.handleRequest(key, (MeterModifyRequest) data, new FlowHubCarrierImpl(input));
    } else {
        unhandledInput(input);
    }
}
Also used : CommandData(org.openkilda.messaging.command.CommandData) MeterModifyRequest(org.openkilda.messaging.nbtopology.request.MeterModifyRequest)

Example 2 with MeterModifyRequest

use of org.openkilda.messaging.nbtopology.request.MeterModifyRequest in project open-kilda by telstra.

the class FlowServiceImpl method modifyMeter.

/**
 * {@inheritDoc}
 */
@Override
public CompletableFuture<FlowMeterEntries> modifyMeter(String flowId) {
    MeterModifyRequest request = new MeterModifyRequest(flowId);
    final String correlationId = RequestCorrelationId.getId();
    CommandMessage message = new CommandMessage(request, System.currentTimeMillis(), correlationId);
    return messagingChannel.sendAndGet(nbworkerTopic, message).thenApply(FlowMeterEntries.class::cast);
}
Also used : FlowMeterEntries(org.openkilda.messaging.info.meter.FlowMeterEntries) MeterModifyRequest(org.openkilda.messaging.nbtopology.request.MeterModifyRequest) CommandMessage(org.openkilda.messaging.command.CommandMessage)

Aggregations

MeterModifyRequest (org.openkilda.messaging.nbtopology.request.MeterModifyRequest)2 CommandData (org.openkilda.messaging.command.CommandData)1 CommandMessage (org.openkilda.messaging.command.CommandMessage)1 FlowMeterEntries (org.openkilda.messaging.info.meter.FlowMeterEntries)1