use of org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.add.flows.batch.input.BatchAddFlows in project openflowplugin by opendaylight.
the class SalFlowsBatchServiceImplTest method createEmptyBatchUpdateFlow.
private static BatchUpdateFlows createEmptyBatchUpdateFlow(final String flowIdValue, final int priority) {
final BatchAddFlows emptyOriginalFlow = createEmptyBatchAddFlow(flowIdValue, priority);
final BatchAddFlows emptyUpdatedFlow = createEmptyBatchAddFlow(flowIdValue, priority + 1);
return new BatchUpdateFlowsBuilder().setFlowId(new FlowId(flowIdValue)).setOriginalBatchedFlow(new OriginalBatchedFlowBuilder(emptyOriginalFlow).build()).setUpdatedBatchedFlow(new UpdatedBatchedFlowBuilder(emptyUpdatedFlow).build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.add.flows.batch.input.BatchAddFlows in project openflowplugin by opendaylight.
the class FlatBatchFlowAdapters method adaptFlatBatchAddFlow.
/**
* Adapt flat batch add flow.
* @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.flows.service.rev160314.SalFlowsBatchService#addFlowsBatch(AddFlowsBatchInput)}
*/
public static AddFlowsBatchInput adaptFlatBatchAddFlow(final BatchPlanStep planStep, final NodeRef node) {
final List<BatchAddFlows> batchFlows = new ArrayList<>();
for (FlatBatchAddFlow batchAddFlows : planStep.<FlatBatchAddFlow>getTaskBag()) {
final BatchAddFlows addFlows = new BatchAddFlowsBuilder((Flow) batchAddFlows).setFlowId(batchAddFlows.getFlowId()).build();
batchFlows.add(addFlows);
}
return new AddFlowsBatchInputBuilder().setBarrierAfter(planStep.isBarrierAfter()).setNode(node).setBatchAddFlows(batchFlows).build();
}
Aggregations