use of org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.remove.meter._case.FlatBatchRemoveMeterBuilder in project openflowplugin by opendaylight.
the class SyncPlanPushStrategyFlatBatchImpl method assembleRemoveMeters.
@VisibleForTesting
static int assembleRemoveMeters(final List<Batch> batchBag, int batchOrder, final ItemSyncBox<Meter> meterItemSyncBox) {
// process meter remove
int order = batchOrder;
if (meterItemSyncBox != null && !meterItemSyncBox.getItemsToPush().isEmpty()) {
final List<FlatBatchRemoveMeter> flatBatchRemoveMeterBag = new ArrayList<>(meterItemSyncBox.getItemsToUpdate().size());
int itemOrder = 0;
for (Meter meter : meterItemSyncBox.getItemsToPush()) {
flatBatchRemoveMeterBag.add(new FlatBatchRemoveMeterBuilder(meter).setBatchOrder(itemOrder++).build());
}
final Batch batch = new BatchBuilder().setBatchChoice(new FlatBatchRemoveMeterCaseBuilder().setFlatBatchRemoveMeter(flatBatchRemoveMeterBag).build()).setBatchOrder(order).build();
order += itemOrder;
batchBag.add(batch);
}
return order;
}
Aggregations