Search in sources :

Example 1 with BatchUpdateGroupsBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.update.groups.batch.input.BatchUpdateGroupsBuilder in project openflowplugin by opendaylight.

the class FlatBatchGroupAdapters method adaptFlatBatchUpdateGroup.

/**
 * Adapt flat batch update group.
 * @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.groups.service.rev160315.SalGroupsBatchService#updateGroupsBatch(UpdateGroupsBatchInput)}
 */
public static UpdateGroupsBatchInput adaptFlatBatchUpdateGroup(final BatchPlanStep planStep, final NodeRef node) {
    final List<BatchUpdateGroups> batchGroups = new ArrayList<>();
    for (FlatBatchUpdateGroup batchUpdateGroup : planStep.<FlatBatchUpdateGroup>getTaskBag()) {
        final BatchUpdateGroups updateGroups = new BatchUpdateGroupsBuilder(batchUpdateGroup).build();
        batchGroups.add(updateGroups);
    }
    return new UpdateGroupsBatchInputBuilder().setBarrierAfter(planStep.isBarrierAfter()).setNode(node).setBatchUpdateGroups(batchGroups).build();
}
Also used : UpdateGroupsBatchInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.UpdateGroupsBatchInputBuilder) BatchUpdateGroups(org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.update.groups.batch.input.BatchUpdateGroups) BatchUpdateGroupsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.update.groups.batch.input.BatchUpdateGroupsBuilder) ArrayList(java.util.ArrayList) FlatBatchUpdateGroup(org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.update.group._case.FlatBatchUpdateGroup)

Aggregations

ArrayList (java.util.ArrayList)1 FlatBatchUpdateGroup (org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.update.group._case.FlatBatchUpdateGroup)1 UpdateGroupsBatchInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.UpdateGroupsBatchInputBuilder)1 BatchUpdateGroups (org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.update.groups.batch.input.BatchUpdateGroups)1 BatchUpdateGroupsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.update.groups.batch.input.BatchUpdateGroupsBuilder)1