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();
}
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());
}
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;
}
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);
}
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;
}
Aggregations