final class LinkstateAdjRIBsIn extends AbstractAdjRIBsIn<CLinkstateDestination, LinkstateRoute> {
private abstract static class LinkstateRIBEntryData<A extends LinkStateAttribute> extends
- RIBEntryData<CLinkstateDestination, LinkstateRoute> {
+ RIBEntryData<CLinkstateDestination, LinkstateRoute> {
private final A lsattr;
protected LinkstateRIBEntryData(final PathAttributes attributes, final A lsattr) {
@Override
public InstanceIdentifier<LinkstateRoute> identifierForKey(final InstanceIdentifier<Tables> basePath, final CLinkstateDestination key) {
- return InstanceIdentifier.builder(basePath).child(LinkstateRoutes.class).child(LinkstateRoute.class,
+ return basePath.builder().child(LinkstateRoutes.class).child(LinkstateRoute.class,
new LinkstateRouteKey(LinkstateNlriParser.serializeNlri(key))).toInstance();
}
@Override
public InstanceIdentifier<Ipv4Route> identifierForKey(final InstanceIdentifier<Tables> basePath, final Ipv4Prefix key) {
- return InstanceIdentifier.builder(basePath).child(Ipv4Routes.class).child(Ipv4Route.class, new Ipv4RouteKey(key)).toInstance();
+ return basePath.builder().child(Ipv4Routes.class).child(Ipv4Route.class, new Ipv4RouteKey(key)).toInstance();
}
@Override
@Override
public InstanceIdentifier<Ipv6Route> identifierForKey(final InstanceIdentifier<Tables> basePath, final Ipv6Prefix key) {
- return InstanceIdentifier.builder(basePath).child(Ipv6Routes.class).child(Ipv6Route.class, new Ipv6RouteKey(key)).toInstance();
+ return basePath.builder().child(Ipv6Routes.class).child(Ipv6Route.class, new Ipv6RouteKey(key)).toInstance();
}
@Override
private final Map<Peer, Boolean> peers = new HashMap<>();
protected AbstractAdjRIBsIn(final DataModificationTransaction trans, final RibReference rib, final TablesKey key) {
- this.basePath = InstanceIdentifier.builder(rib.getInstanceIdentifier()).child(LocRib.class).child(Tables.class, key).toInstance();
+ this.basePath = rib.getInstanceIdentifier().child(LocRib.class).child(Tables.class, key);
this.eor = new UpdateBuilder().setPathAttributes(
new PathAttributesBuilder().addAugmentation(
}
private InstanceIdentifier<Node1> nodeInstanceId(final NodeId ni) {
- return InstanceIdentifier.builder(getInstanceIdentifier()).child(Node.class, new NodeKey(ni)).augmentation(Node1.class).toInstance();
+ return getInstanceIdentifier().builder().child(Node.class, new NodeKey(ni)).augmentation(Node1.class).toInstance();
}
private InstanceIdentifier<Node1> ensureNodePresent(final DataModification<InstanceIdentifier<?>, DataObject> trans, final NodeId ni) {
final PrefixKey pk = new PrefixKey(prefix);
trans.putOperationalData(
- InstanceIdentifier.builder(nii).child(
+ nii.builder().child(
org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.igp.node.attributes.IgpNodeAttributes.class).child(
Prefix.class, pk).toInstance(), new PrefixBuilder().setKey(pk).setPrefix(prefix).build());
}
final IpPrefix prefix = getPrefix(value);
final PrefixKey pk = new PrefixKey(prefix);
- trans.removeOperationalData(InstanceIdentifier.builder(nii).child(
+ trans.removeOperationalData(nii.builder().child(
org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.igp.node.attributes.IgpNodeAttributes.class).child(
Prefix.class, pk).toInstance());
}
public final InstanceIdentifier<Tables> tableInstanceIdentifier(final Class<? extends AddressFamily> afi, final Class<? extends SubsequentAddressFamily> safi) {
- return InstanceIdentifier.builder(locRibReference.getInstanceIdentifier()).child(LocRib.class).child(Tables.class, new TablesKey(afi, safi)).toInstance();
+ return locRibReference.getInstanceIdentifier().builder().child(LocRib.class).child(Tables.class, new TablesKey(afi, safi)).toInstance();
}
protected abstract void createObject(DataModification<InstanceIdentifier<?>, DataObject> trans, InstanceIdentifier<T> id, T value);
/**
* Synchronized in-core state of a node into the backing store using the transaction
- *
+ *
* @param trans data modification transaction which to use
* @return True if the node has been purged, false otherwise.
*/
private boolean syncState(final DataModification<InstanceIdentifier<?>, DataObject> trans) {
- final InstanceIdentifier<Node> nid = InstanceIdentifier.builder(getInstanceIdentifier()).child(
+ final InstanceIdentifier<Node> nid = getInstanceIdentifier().child(
org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node.class,
- this.nb.getKey()).build();
+ this.nb.getKey());
/*
* Transaction's putOperationalData() does a merge. Force it onto a replace
}
private InstanceIdentifier<?> buildLinkIdentifier(final UriBuilder base, final LinkId id) {
- return InstanceIdentifier.builder(getInstanceIdentifier()).child(
+ return getInstanceIdentifier().child(
org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link.class,
- new LinkKey(id)).toInstance();
+ new LinkKey(id));
}
private static Float bandwidthToFloat(final Bandwidth bandwidth) {
for (final Node n : topo.getNode()) {
LOG.debug("Matching topology node {} to id {}", n, pccId);
if (n.getNodeId().getValue().equals(pccId)) {
- this.topologyNode = InstanceIdentifier.builder(this.serverSessionManager.getTopology()).child(Node.class, n.getKey()).toInstance();
+ this.topologyNode = this.serverSessionManager.getTopology().child(Node.class, n.getKey());
LOG.debug("Reusing topology node {} for id {} at {}", n, pccId, this.topologyNode);
return n;
}
*/
final NodeId id = new NodeId(pccId);
final NodeKey nk = new NodeKey(id);
- final InstanceIdentifier<Node> nti = InstanceIdentifier.builder(this.serverSessionManager.getTopology()).child(Node.class, nk).toInstance();
+ final InstanceIdentifier<Node> nti = this.serverSessionManager.getTopology().child(Node.class, nk);
final Node ret = new NodeBuilder().setKey(nk).setNodeId(id).build();
onSessionUp(session, this.pccBuilder);
this.topologyAugmentBuilder = new Node1Builder().setPathComputationClient(this.pccBuilder.build());
- this.topologyAugment = InstanceIdentifier.builder(this.topologyNode).augmentation(Node1.class).toInstance();
+ this.topologyAugment = this.topologyNode.augmentation(Node1.class);
final Node1 ta = this.topologyAugmentBuilder.build();
trans.putOperationalData(this.topologyAugment, ta);
}
protected InstanceIdentifierBuilder<PathComputationClient> pccIdentifier() {
- return InstanceIdentifier.builder(this.topologyAugment).child(PathComputationClient.class);
+ return this.topologyAugment.builder().child(PathComputationClient.class);
}
protected final synchronized PCEPRequest removeRequest(final SRPID id) {
}
for (final ReportedLsp l : pccnode.getPathComputationClient().getReportedLsp()) {
- lsps.add(InstanceIdentifier.builder(id).augmentation(Node1.class).child(PathComputationClient.class).child(ReportedLsp.class,
+ lsps.add(id.builder().augmentation(Node1.class).child(PathComputationClient.class).child(ReportedLsp.class,
l.getKey()).toInstance());
}
}
}
private InstanceIdentifier<Link> linkForLsp(final LinkId linkId) {
- return InstanceIdentifier.builder(this.target).child(Link.class, new LinkKey(linkId)).toInstance();
+ return this.target.child(Link.class, new LinkKey(linkId));
}
private SupportingNode createSupportingNode(final NodeId sni, final Boolean inControl) {
final SupportingNode sn = createSupportingNode(k.getNodeId(), inControl);
trans.putOperationalData(
- InstanceIdentifier.builder(this.target).child(Node.class, n.getKey()).child(
+ this.target.builder().child(Node.class, n.getKey()).child(
SupportingNode.class, sn.getKey()).toInstance(), sn);
}
}
- return InstanceIdentifier.builder(this.target).child(Node.class, n.getKey()).child(TerminationPoint.class,
+ return this.target.builder().child(Node.class, n.getKey()).child(TerminationPoint.class,
tp.getKey()).toInstance();
}
}
nb.setSupportingNode(Lists.newArrayList(createSupportingNode(InstanceIdentifier.keyOf(sni).getNodeId(), inControl)));
}
- trans.putOperationalData(InstanceIdentifier.builder(this.target).child(Node.class, nb.getKey()).toInstance(), nb.build());
- return InstanceIdentifier.builder(this.target).child(Node.class, nb.getKey()).child(TerminationPoint.class, tpb.getKey()).toInstance();
+ final InstanceIdentifier<Node> nid = this.target.child(Node.class, nb.getKey());
+ trans.putOperationalData(nid, nb.build());
+ return nid.child(TerminationPoint.class, tpb.getKey());
}
private void create(final DataModificationTransaction trans, final InstanceIdentifier<ReportedLsp> i, final ReportedLsp value) {
}
private InstanceIdentifier<TerminationPoint> tpIdentifier(final NodeId node, final TpId tp) {
- return InstanceIdentifier.builder(this.target).child(Node.class, new NodeKey(node)).child(TerminationPoint.class, new TerminationPointKey(tp)).toInstance();
+ return this.target.builder().child(Node.class, new NodeKey(node)).child(TerminationPoint.class, new TerminationPointKey(tp)).toInstance();
}
private InstanceIdentifier<Node> nodeIdentifier(final NodeId node) {
- return InstanceIdentifier.builder(this.target).child(Node.class, new NodeKey(node)).toInstance();
+ return this.target.child(Node.class, new NodeKey(node));
}
private void remove(final DataModificationTransaction trans, final InstanceIdentifier<ReportedLsp> i, final ReportedLsp value) {
trans.removeOperationalData(li);
LOG.debug("Searching for orphan links/nodes");
- final Topology t = (Topology) trans.readOperationalData(InstanceIdentifier.builder(this.target).toInstance());
+ final Topology t = (Topology) trans.readOperationalData(this.target);
NodeId srcNode = l.getSource().getSourceNode();
NodeId dstNode = l.getDestination().getDestNode();
public static InstanceIdentifier<Link> linkIdentifier(final InstanceIdentifier<Topology> topology, final NodeId node,
final String name) {
- return InstanceIdentifier.builder(topology).child(Link.class, new LinkKey(new LinkId(node.getValue() + "/lsp/" + name))).toInstance();
+ return topology.child(Link.class, new LinkKey(new LinkId(node.getValue() + "/lsp/" + name)));
}
}
child(Topology.class, new TopologyKey(targetTopology)).toInstance();
final NodeChangedListener ncl = new NodeChangedListener(dataProvider, dst);
- final InstanceIdentifier<Node> src = InstanceIdentifier.builder(sourceTopology).child(Node.class).toInstance();
+ final InstanceIdentifier<Node> src = sourceTopology.child(Node.class);
final ListenerRegistration<DataChangeListener> reg = dataProvider.registerDataChangeListener(src, ncl);
return new PCEPTunnelTopologyProvider(dst, reg);
TpReader(final DataModificationTransaction t, final InstanceIdentifier<Topology> topo, final TpReference ref) {
this.t = Preconditions.checkNotNull(t);
- this.nii = InstanceIdentifier.builder(topo).child(Node.class, new NodeKey(ref.getNode())).toInstance();
- this.tii = InstanceIdentifier.builder(this.nii).child(TerminationPoint.class, new TerminationPointKey(ref.getTp())).toInstance();
+ this.nii = topo.child(Node.class, new NodeKey(ref.getNode()));
+ this.tii = this.nii.child(TerminationPoint.class, new TerminationPointKey(ref.getTp()));
}
private Node getNode() {
}
private Node sourceNode(final DataModificationTransaction t, final InstanceIdentifier<Topology> topology, final Link link) {
- final InstanceIdentifier<Node> nii = InstanceIdentifier.builder(topology).child(Node.class,
- new NodeKey(link.getSource().getSourceNode())).toInstance();
- return (Node) t.readOperationalData(nii);
+ return (Node) t.readOperationalData(topology.child(Node.class, new NodeKey(link.getSource().getSourceNode())));
}
@Override
builder.setStatus(status);
final DataModificationTransaction t = dataProvider.beginTransaction();
- t.putOperationalData(InstanceIdentifier.builder(qid).child(
+ t.putOperationalData(qid.child(
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev130930.instruction.queue.Instruction.class,
- new InstructionKey(builder.getId())).build(), builder.build());
+ new InstructionKey(builder.getId())), builder.build());
t.commit();
}
@Override
public void instructionRemoved() {
final DataModificationTransaction t = dataProvider.beginTransaction();
- t.removeOperationalData(InstanceIdentifier.builder(qid).child(
+ t.removeOperationalData(qid.child(
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev130930.instruction.queue.Instruction.class,
- new InstructionKey(builder.getId())).build());
+ new InstructionKey(builder.getId())));
t.commit();
}
}
public static InstanceIdentifier<Link> linkIdentifier(final InstanceIdentifier<Topology> topology, final BaseTunnelInput input) {
Preconditions.checkNotNull(input.getLinkId());
- return InstanceIdentifier.builder(topology).child(Link.class, new LinkKey(input.getLinkId())).toInstance();
+ return topology.child(Link.class, new LinkKey(input.getLinkId()));
}
}