Search in sources :

Example 46 with NodeBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder in project bgpcep by opendaylight.

the class NodeNlriParser method serializeOspfNode.

private static OspfNodeCase serializeOspfNode(final ContainerNode ospf) {
    final OspfNodeCaseBuilder builder = new OspfNodeCaseBuilder();
    if (ospf.getChild(OSPF_ROUTER_NID).isPresent()) {
        final OspfNodeBuilder nodeBuilder = new OspfNodeBuilder();
        nodeBuilder.setOspfRouterId((Long) ospf.getChild(OSPF_ROUTER_NID).get().getValue());
        builder.setOspfNode(nodeBuilder.build());
    }
    return builder.build();
}
Also used : OspfNodeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.node.identifier.c.router.identifier.ospf.node._case.OspfNodeBuilder) OspfNodeCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.node.identifier.c.router.identifier.OspfNodeCaseBuilder)

Example 47 with NodeBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder in project bgpcep by opendaylight.

the class TopologyNodeState method putTopologyNode.

private synchronized void putTopologyNode() {
    final Node node = new NodeBuilder().setKey(this.nodeId.getKey()).setNodeId(this.nodeId.getKey().getNodeId()).build();
    final WriteTransaction t = this.chain.newWriteOnlyTransaction();
    LOG.trace("Put topology Node {}, value {}", this.nodeId, node);
    t.merge(LogicalDatastoreType.OPERATIONAL, this.nodeId, node);
    Futures.addCallback(t.submit(), new FutureCallback<Void>() {

        @Override
        public void onSuccess(final Void result) {
            LOG.trace("Topology Node stored {}, value {}", TopologyNodeState.this.nodeId, node);
        }

        @Override
        public void onFailure(final Throwable throwable) {
            LOG.trace("Put topology Node failed {}, value {}, {}", TopologyNodeState.this.nodeId, node, throwable);
        }
    }, MoreExecutors.directExecutor());
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) NodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)

Example 48 with NodeBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder in project netvirt by opendaylight.

the class NodeConnectedHandlerUtils method prepareOperationalNode.

NodeBuilder prepareOperationalNode(InstanceIdentifier<Node> iid) {
    NodeBuilder nodeBuilder = new NodeBuilder();
    nodeBuilder.setNodeId(iid.firstKeyOf(Node.class).getNodeId());
    return nodeBuilder;
}
Also used : NodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)

Example 49 with NodeBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder in project netvirt by opendaylight.

the class NodeConnectedHandlerUtils method addNode.

CheckedFuture<Void, TransactionCommitFailedException> addNode(InstanceIdentifier<Node> path, InstanceIdentifier<Node> psPath, String logicalSwitchData, String localUcasMacData, String localMcastData, String remoteMcastData, String remoteUcasteMacData, String globalTerminationPointIp, WriteTransaction transaction) throws Exception {
    NodeBuilder nodeBuilder = null;
    HwvtepGlobalAugmentationBuilder augmentationBuilder = null;
    nodeBuilder = prepareOperationalNode(path);
    augmentationBuilder = prepareAugmentationBuilder();
    GlobalAugmentationHelper.addLogicalSwitches(augmentationBuilder, getData(logicalSwitchData));
    GlobalAugmentationHelper.addLocalUcastMacs(path, augmentationBuilder, getData(localUcasMacData));
    GlobalAugmentationHelper.addLocalMcastMacs(path, augmentationBuilder, getData(localMcastData));
    GlobalAugmentationHelper.addRemoteMcastMacs(path, augmentationBuilder, getData(remoteMcastData));
    GlobalAugmentationHelper.addRemoteUcastMacs(path, augmentationBuilder, getData(remoteUcasteMacData));
    GlobalAugmentationHelper.addGlobalTerminationPoints(nodeBuilder, path, getData(globalTerminationPointIp));
    GlobalAugmentationHelper.addSwitches(augmentationBuilder, psPath);
    nodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, augmentationBuilder.build());
    return TestUtil.submitNode(OPERATIONAL, path, nodeBuilder.build(), transaction);
}
Also used : HwvtepGlobalAugmentationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentationBuilder) NodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)

Example 50 with NodeBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder in project netvirt by opendaylight.

the class HwvtepHAUtil method getNodeBuilderForPath.

public static NodeBuilder getNodeBuilderForPath(InstanceIdentifier<Node> haPath) {
    NodeBuilder nodeBuilder = new NodeBuilder();
    nodeBuilder.setNodeId(haPath.firstKeyOf(Node.class).getNodeId());
    return nodeBuilder;
}
Also used : NodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)

Aggregations

NodeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder)35 NodeBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)30 Node (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)21 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)21 NodeId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId)18 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)17 Test (org.junit.Test)11 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)11 FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)11 FlowBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder)11 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)11 NodeKey (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey)11 ReadWriteTransaction (org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction)10 Nodes (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes)8 ArrayList (java.util.ArrayList)7 Optional (com.google.common.base.Optional)6 BigInteger (java.math.BigInteger)6 TableKey (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey)6 Flow (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow)6 TransactionCommitFailedException (org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException)5