use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathId in project genius by opendaylight.
the class OvsdbSouthboundTestUtil method updateBridge.
public static void updateBridge(DataBroker dataBroker, String datapathId) throws TransactionCommitFailedException {
final OvsdbBridgeName ovsdbBridgeName = new OvsdbBridgeName("s2");
final InstanceIdentifier<Node> bridgeIid = createInstanceIdentifier("192.168.56.101", 6640, ovsdbBridgeName);
final InstanceIdentifier<OvsdbBridgeAugmentation> ovsdbBridgeIid = bridgeIid.builder().augmentation(OvsdbBridgeAugmentation.class).build();
final NodeId bridgeNodeId = createManagedNodeId(bridgeIid);
final NodeBuilder bridgeCreateNodeBuilder = new NodeBuilder();
bridgeCreateNodeBuilder.setNodeId(bridgeNodeId);
OvsdbBridgeAugmentationBuilder bridgeCreateAugmentationBuilder = new OvsdbBridgeAugmentationBuilder();
bridgeCreateAugmentationBuilder.setBridgeName(ovsdbBridgeName).setDatapathId(new DatapathId(datapathId));
bridgeCreateNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, bridgeCreateAugmentationBuilder.build());
LOG.debug("Built with the intent to store bridge data {}", bridgeCreateAugmentationBuilder.toString());
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
tx.merge(LogicalDatastoreType.OPERATIONAL, ovsdbBridgeIid, bridgeCreateAugmentationBuilder.build(), true);
tx.submit().checkedGet();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathId in project genius by opendaylight.
the class FlowNodeConnectorInventoryTranslatorImpl method remove.
@Override
public void remove(InstanceIdentifier<FlowCapableNodeConnector> identifier, FlowCapableNodeConnector del, InstanceIdentifier<FlowCapableNodeConnector> nodeConnIdent) {
Counter counter;
if (compareInstanceIdentifierTail(identifier, II_TO_FLOW_CAPABLE_NODE_CONNECTOR)) {
String nodeConnectorIdentifier = getNodeConnectorId(String.valueOf(nodeConnIdent.firstKeyOf(NodeConnector.class).getId()));
long dataPathId = getDpIdFromPortName(nodeConnectorIdentifier);
if (dpnToPortMultiMap.containsKey(dataPathId)) {
LOG.debug("Node Connector {} removed", nodeConnectorIdentifier);
dpnToPortMultiMap.remove(dataPathId, nodeConnectorIdentifier);
counter = packetInCounter.label("OFSwitch").label(String.valueOf(dataPathId)).label("portsperswitch");
counter.decrement();
PortNameMapping.updatePortMap("openflow:" + dataPathId + ":" + del.getName(), nodeConnectorIdentifier, "DELETE");
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathId in project genius by opendaylight.
the class FlowNodeConnectorInventoryTranslatorImpl method add.
@Override
public void add(InstanceIdentifier<FlowCapableNodeConnector> identifier, FlowCapableNodeConnector add, InstanceIdentifier<FlowCapableNodeConnector> nodeConnIdent) {
Counter counter;
if (compareInstanceIdentifierTail(identifier, II_TO_FLOW_CAPABLE_NODE_CONNECTOR)) {
String nodeConnectorIdentifier = getNodeConnectorId(String.valueOf(nodeConnIdent.firstKeyOf(NodeConnector.class).getId()));
long dataPathId = getDpIdFromPortName(nodeConnectorIdentifier);
if (entityOwnershipUtils.isEntityOwner(FcapsConstants.SERVICE_ENTITY_TYPE, getNodeId(dataPathId))) {
if (!dpnToPortMultiMap.containsEntry(dataPathId, nodeConnectorIdentifier)) {
LOG.debug("Node Connector {} added", nodeConnectorIdentifier);
dpnToPortMultiMap.put(dataPathId, nodeConnectorIdentifier);
counter = packetInCounter.label("OFSwitch").label(String.valueOf(dataPathId)).label("portsperswitch");
counter.increment();
PortNameMapping.updatePortMap("openflow:" + dataPathId + ":" + add.getName(), nodeConnectorIdentifier, "ADD");
} else {
LOG.error("Duplicate Event.Node Connector already added");
}
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.DatapathId 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.params.xml.ns.yang.ovsdb.rev150105.DatapathId in project openflowplugin by opendaylight.
the class InventoryDataServiceUtil method nodeUpdatedBuilderFromDataPathId.
public static NodeUpdatedBuilder nodeUpdatedBuilderFromDataPathId(final BigInteger datapathId) {
NodeUpdatedBuilder builder = new NodeUpdatedBuilder();
builder.setId(nodeIdFromDatapathId(datapathId));
builder.setNodeRef(nodeRefFromNodeKey(new NodeKey(builder.getId())));
return builder;
}
Aggregations