use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorBuilder in project openflowplugin by opendaylight.
the class InventoryDataServiceUtil method nodeConnectorBuilderFromDatapathIdPortNo.
public static NodeConnectorBuilder nodeConnectorBuilderFromDatapathIdPortNo(final BigInteger datapathId, final Long portNo, final OpenflowVersion ofVersion) {
NodeConnectorBuilder builder = new NodeConnectorBuilder();
builder.setId(InventoryDataServiceUtil.nodeConnectorIdfromDatapathPortNo(datapathId, portNo, ofVersion));
return builder;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorBuilder in project openflowplugin by opendaylight.
the class NodeConnectorStatNotificationSupplierImpl method createNotification.
@Override
public NodeConnectorStatisticsUpdate createNotification(final FlowCapableNodeConnectorStatistics flowCapableNodeConnectorStatistics, final InstanceIdentifier<FlowCapableNodeConnectorStatistics> path) {
Preconditions.checkArgument(flowCapableNodeConnectorStatistics != null);
Preconditions.checkArgument(path != null);
final NodeConnectorBuilder ncBuilder = new NodeConnectorBuilder();
final NodeConnectorKey ncKey = path.firstKeyOf(NodeConnector.class, NodeConnectorKey.class);
ncBuilder.setId(ncKey.getId());
ncBuilder.setKey(ncKey);
final NodeConnectorStatisticsUpdateBuilder builder = new NodeConnectorStatisticsUpdateBuilder();
builder.setId(getNodeId(path));
builder.setMoreReplies(Boolean.FALSE);
builder.setNodeConnector(Collections.singletonList(ncBuilder.build()));
builder.setNodeConnectorStatisticsAndPortNumberMap(Collections.singletonList(new NodeConnectorStatisticsAndPortNumberMapBuilder(flowCapableNodeConnectorStatistics).build()));
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorBuilder in project openflowplugin by opendaylight.
the class DeviceContextImpl method writePortStatusMessage.
private void writePortStatusMessage(final PortStatus portStatusMessage) {
final FlowCapableNodeConnector flowCapableNodeConnector = portStatusTranslator.translate(portStatusMessage, getDeviceInfo(), null);
final KeyedInstanceIdentifier<NodeConnector, NodeConnectorKey> iiToNodeConnector = getDeviceInfo().getNodeInstanceIdentifier().child(NodeConnector.class, new NodeConnectorKey(InventoryDataServiceUtil.nodeConnectorIdfromDatapathPortNo(deviceInfo.getDatapathId(), portStatusMessage.getPortNo(), OpenflowVersion.get(deviceInfo.getVersion()))));
writeToTransaction(LogicalDatastoreType.OPERATIONAL, iiToNodeConnector, new NodeConnectorBuilder().setKey(iiToNodeConnector.getKey()).addAugmentation(FlowCapableNodeConnectorStatisticsData.class, new FlowCapableNodeConnectorStatisticsDataBuilder().build()).addAugmentation(FlowCapableNodeConnector.class, flowCapableNodeConnector).build());
submitTransaction();
if (PortReason.OFPPRDELETE.equals(portStatusMessage.getReason())) {
addDeleteToTxChain(LogicalDatastoreType.OPERATIONAL, iiToNodeConnector);
submitTransaction();
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorBuilder in project genius by opendaylight.
the class InterfaceManagerTestUtil method buildFlowCapableNodeConnector.
static org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector buildFlowCapableNodeConnector(NodeConnectorId ncId, String portName, boolean isLive) {
NodeConnectorBuilder ncBuilder = new NodeConnectorBuilder().setId(ncId).setKey(new NodeConnectorKey(ncId));
ncBuilder.addAugmentation(FlowCapableNodeConnector.class, buildFlowCapableNodeConnector(false, isLive, "AA:AA:AA:AA:AA:AA", portName));
return ncBuilder.build();
}
Aggregations