use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey in project genius by opendaylight.
the class MDSALManager method getNodeConnRef.
protected static NodeConnectorRef getNodeConnRef(final String nodeId, final String port) {
StringBuilder stringBuilder = new StringBuilder(nodeId);
StringBuilder append = stringBuilder.append(":");
StringBuilder build = append.append(port);
String string = build.toString();
NodeConnectorId nodeConnectorId = new NodeConnectorId(string);
NodeConnectorKey nodeConnectorKey = new NodeConnectorKey(nodeConnectorId);
NodeConnectorKey connectorKey = nodeConnectorKey;
InstanceIdentifierBuilder<Nodes> builder = InstanceIdentifier.builder(Nodes.class);
NodeKey nodeKey = new NodeKey(new NodeId(nodeId));
InstanceIdentifierBuilder<Node> child = builder.child(Node.class, nodeKey);
InstanceIdentifierBuilder<NodeConnector> anotherChild = child.child(NodeConnector.class, connectorKey);
InstanceIdentifier<NodeConnector> path = anotherChild.toInstance();
NodeConnectorRef nodeConnectorRef = new NodeConnectorRef(path);
return nodeConnectorRef;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey in project genius by opendaylight.
the class DirectTunnelUtils method isNodeConnectorPresent.
public boolean isNodeConnectorPresent(NodeConnectorId nodeConnectorId) throws ReadFailedException {
NodeId nodeId = getNodeIdFromNodeConnectorId(nodeConnectorId);
InstanceIdentifier<NodeConnector> ncIdentifier = InstanceIdentifier.builder(Nodes.class).child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(nodeId)).child(NodeConnector.class, new NodeConnectorKey(nodeConnectorId)).build();
return SingleTransactionDataBroker.syncReadOptional(dataBroker, LogicalDatastoreType.OPERATIONAL, ncIdentifier).isPresent();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey in project genius by opendaylight.
the class InterfaceManagerTestUtil method buildNodeConnectorInstanceIdentifier.
static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector> buildNodeConnectorInstanceIdentifier(BigInteger dpn, long portNo) {
NodeConnectorId nodeConnectorId = buildNodeConnectorId(dpn, portNo);
NodeId nodeId = IfmUtil.getNodeIdFromNodeConnectorId(nodeConnectorId);
InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector> ncIdentifier = InstanceIdentifier.builder(Nodes.class).child(Node.class, new NodeKey(nodeId)).child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector.class, new NodeConnectorKey(nodeConnectorId)).build();
return ncIdentifier;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey 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