Search in sources :

Example 1 with BatchUpdateMetersBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.update.meters.batch.input.BatchUpdateMetersBuilder in project openflowplugin by opendaylight.

the class FlatBatchMeterAdapters method adaptFlatBatchUpdateMeter.

/**
 * Adapt flat batch update meter.
 * @param planStep batch step containing changes of the same type
 * @param node     pointer for RPC routing
 * @return input suitable for {@link org.opendaylight.yang.gen.v1.urn
 * .opendaylight.meters.service.rev160316.SalMetersBatchService#updateMetersBatch(UpdateMetersBatchInput)}
 */
public static UpdateMetersBatchInput adaptFlatBatchUpdateMeter(final BatchPlanStep planStep, final NodeRef node) {
    final List<BatchUpdateMeters> batchMeters = new ArrayList<>();
    for (FlatBatchUpdateMeter batchUpdateMeter : planStep.<FlatBatchUpdateMeter>getTaskBag()) {
        final BatchUpdateMeters updateMeters = new BatchUpdateMetersBuilder(batchUpdateMeter).build();
        batchMeters.add(updateMeters);
    }
    return new UpdateMetersBatchInputBuilder().setBarrierAfter(planStep.isBarrierAfter()).setNode(node).setBatchUpdateMeters(batchMeters).build();
}
Also used : BatchUpdateMeters(org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.update.meters.batch.input.BatchUpdateMeters) FlatBatchUpdateMeter(org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.update.meter._case.FlatBatchUpdateMeter) BatchUpdateMetersBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.update.meters.batch.input.BatchUpdateMetersBuilder) ArrayList(java.util.ArrayList) UpdateMetersBatchInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.UpdateMetersBatchInputBuilder)

Aggregations

ArrayList (java.util.ArrayList)1 FlatBatchUpdateMeter (org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.update.meter._case.FlatBatchUpdateMeter)1 UpdateMetersBatchInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.UpdateMetersBatchInputBuilder)1 BatchUpdateMeters (org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.update.meters.batch.input.BatchUpdateMeters)1 BatchUpdateMetersBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.update.meters.batch.input.BatchUpdateMetersBuilder)1