use of org.opendaylight.yang.gen.v1.urn.tech.pantheon.netconfdevice.network.topology.rpcs.rev180320.node.data.Node in project openflowplugin by opendaylight.
the class NodeConnectorRefToPortTranslator method toNodeConnectorRef.
/**
* Converts {@link PacketIn} to {@link NodeConnectorRef}.
* @param packetIn Packet input
* @param dataPathId Data path id
* @return packet input converted to node connector reference
*/
@Nullable
public static NodeConnectorRef toNodeConnectorRef(@Nonnull PacketIn packetIn, BigInteger dataPathId) {
Preconditions.checkNotNull(packetIn);
NodeConnectorRef ref = null;
Long port = getPortNoFromPacketIn(packetIn);
if (port != null) {
OpenflowVersion version = OpenflowVersion.get(packetIn.getVersion());
ref = InventoryDataServiceUtil.nodeConnectorRefFromDatapathIdPortno(dataPathId, port, version);
}
return ref;
}
use of org.opendaylight.yang.gen.v1.urn.tech.pantheon.netconfdevice.network.topology.rpcs.rev180320.node.data.Node 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();
}
use of org.opendaylight.yang.gen.v1.urn.tech.pantheon.netconfdevice.network.topology.rpcs.rev180320.node.data.Node in project openflowplugin by opendaylight.
the class FlatBatchFlowAdapters method adaptFlatBatchRemoveFlow.
/**
* Adapt flat batch remove 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#removeFlowsBatch(RemoveFlowsBatchInput)}
*/
public static RemoveFlowsBatchInput adaptFlatBatchRemoveFlow(final BatchPlanStep planStep, final NodeRef node) {
final List<BatchRemoveFlows> batchFlows = new ArrayList<>();
for (FlatBatchRemoveFlow batchRemoveFlow : planStep.<FlatBatchRemoveFlow>getTaskBag()) {
final BatchRemoveFlows removeFlows = new BatchRemoveFlowsBuilder((Flow) batchRemoveFlow).setFlowId(batchRemoveFlow.getFlowId()).build();
batchFlows.add(removeFlows);
}
return new RemoveFlowsBatchInputBuilder().setBarrierAfter(planStep.isBarrierAfter()).setNode(node).setBatchRemoveFlows(batchFlows).build();
}
use of org.opendaylight.yang.gen.v1.urn.tech.pantheon.netconfdevice.network.topology.rpcs.rev180320.node.data.Node in project openflowplugin by opendaylight.
the class FlatBatchFlowAdapters method adaptFlatBatchUpdateFlow.
/**
* Adapt flat batch update 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#updateFlowsBatch(UpdateFlowsBatchInput)}
*/
public static UpdateFlowsBatchInput adaptFlatBatchUpdateFlow(final BatchPlanStep planStep, final NodeRef node) {
final List<BatchUpdateFlows> batchFlows = new ArrayList<>();
for (FlatBatchUpdateFlow batchUpdateFlow : planStep.<FlatBatchUpdateFlow>getTaskBag()) {
final BatchUpdateFlows updateFlows = new BatchUpdateFlowsBuilder(batchUpdateFlow).build();
batchFlows.add(updateFlows);
}
return new UpdateFlowsBatchInputBuilder().setBarrierAfter(planStep.isBarrierAfter()).setNode(node).setBatchUpdateFlows(batchFlows).build();
}
use of org.opendaylight.yang.gen.v1.urn.tech.pantheon.netconfdevice.network.topology.rpcs.rev180320.node.data.Node in project openflowplugin by opendaylight.
the class FlatBatchMeterAdapters method adaptFlatBatchAddMeter.
/**
* Adapt flat batch add 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#addMetersBatch(AddMetersBatchInput)}
*/
public static AddMetersBatchInput adaptFlatBatchAddMeter(final BatchPlanStep planStep, final NodeRef node) {
final List<BatchAddMeters> batchMeters = new ArrayList<>();
for (FlatBatchAddMeter batchAddMeter : planStep.<FlatBatchAddMeter>getTaskBag()) {
final BatchAddMeters addMeters = new BatchAddMetersBuilder(batchAddMeter).setMeterId(batchAddMeter.getMeterId()).build();
batchMeters.add(addMeters);
}
return new AddMetersBatchInputBuilder().setBarrierAfter(planStep.isBarrierAfter()).setNode(node).setBatchAddMeters(batchMeters).build();
}
Aggregations