Migrate users of NormalizedNode.getIdentifier() 21/109921/6
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 23 Jan 2024 07:28:58 +0000 (08:28 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 23 Jan 2024 09:38:07 +0000 (10:38 +0100)
Use NormalizedNode.name() instead.

Change-Id: I3f566b3a24b87234a0c8344a98432be24977d197
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 files changed:
bgp/extensions/evpn/src/main/java/org/opendaylight/protocol/bgp/evpn/impl/esi/types/SimpleEsiTypeRegistry.java
bgp/extensions/evpn/src/main/java/org/opendaylight/protocol/bgp/evpn/impl/nlri/SimpleEvpnNlriRegistry.java
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/impl/BestPathStateImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AbstractPeer.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibInWriter.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AdjRibOutListener.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/LocRibWriter.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/RIBImpl.java
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/config/RibImplTest.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/entry/AbstractAdvertizedRoute.java
bmp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/app/BmpRibInWriter.java
config-loader/bmp-monitors-config-loader/src/main/java/org/opendaylight/bgpcep/config/loader/bmp/BmpMonitorConfigFileProcessor.java
config-loader/protocols-config-loader/src/main/java/org/opendaylight/bgpcep/config/loader/protocols/ProtocolsConfigFileProcessor.java
config-loader/topology-config-loader/src/main/java/org/opendaylight/bgpcep/config/loader/topology/NetworkTopologyConfigFileProcessor.java

index e08e703ec90449e926d8f72aa47ab6819026a52f..c22e7554cb49b25f35a9cc06dc4c4c94f422e5d1 100644 (file)
@@ -102,7 +102,7 @@ public final class SimpleEsiTypeRegistry implements EsiRegistry {
         checkArgument(buffer.readableBytes() == CONTENT_LENGTH,
                 "Wrong length of array of bytes. Passed: %s;", buffer.readableBytes());
 
-        final EsiParser parser = this.handlers.getParser(EsiType.forValue(buffer.readByte()).getIntValue());
+        final EsiParser parser = handlers.getParser(EsiType.forValue(buffer.readByte()).getIntValue());
         return parser == null ? null : parser.parseEsi(buffer.readSlice(ESI_LENGTH));
     }
 
@@ -113,7 +113,7 @@ public final class SimpleEsiTypeRegistry implements EsiRegistry {
         final Collection<DataContainerChild> value = esiChoice.body();
         checkArgument(!value.isEmpty(), "ESI may not be empty");
         final ContainerNode cont = (ContainerNode) Iterables.getOnlyElement(value);
-        final EsiSerializer serializer = this.modelHandlers.get(cont.getIdentifier());
+        final EsiSerializer serializer = modelHandlers.get(cont.name());
         if (serializer != null) {
             return serializer.serializeEsi(cont);
         }
@@ -124,7 +124,7 @@ public final class SimpleEsiTypeRegistry implements EsiRegistry {
 
     @Override
     public void serializeEsi(final Esi esi, final ByteBuf buffer) {
-        final EsiSerializer serializer = this.handlers.getSerializer(esi.implementedInterface());
+        final EsiSerializer serializer = handlers.getSerializer(esi.implementedInterface());
         if (serializer != null) {
             serializer.serializeEsi(esi, buffer);
         }
index f9ba63a52aa26d325f1f9a13c9af8434ab0a2a7b..2414876b756d299f9571fded3424d30bc51e3ee4 100644 (file)
@@ -85,13 +85,13 @@ public final class SimpleEvpnNlriRegistry implements EvpnRegistry {
     @SuppressFBWarnings(value = "NP_NONNULL_RETURN_VIOLATION", justification = "SB does not grok TYPE_USE")
     public EvpnChoice parseEvpn(final NlriType type, final ByteBuf buffer) {
         checkArgument(buffer != null && buffer.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
-        final EvpnParser parser = this.handlers.getParser(type.getIntValue());
+        final EvpnParser parser = handlers.getParser(type.getIntValue());
         return parser == null ? null : parser.parseEvpn(buffer);
     }
 
     @Override
     public ByteBuf serializeEvpn(final EvpnChoice evpn, final ByteBuf common) {
-        final EvpnSerializer serializer = this.handlers.getSerializer(evpn.implementedInterface());
+        final EvpnSerializer serializer = handlers.getSerializer(evpn.implementedInterface());
         return serializer == null ? common : serializer.serializeEvpn(evpn, common);
     }
 
@@ -110,7 +110,7 @@ public final class SimpleEvpnNlriRegistry implements EvpnRegistry {
         final Collection<DataContainerChild> value = evpnChoice.body();
         checkArgument(!value.isEmpty(), "Evpn case is mandatyr, cannot be empty");
         final ContainerNode cont = (ContainerNode) Iterables.getOnlyElement(value);
-        final EvpnSerializer serializer = this.modelHandlers.get(cont.getIdentifier());
+        final EvpnSerializer serializer = modelHandlers.get(cont.name());
         return serializer == null ? null : serializerInterface.check(serializer, cont);
     }
 }
index a0526ebf0eb7707731fbcb15129c0eb33df1d6ea..4b05ae03536e719209fe539cb0132b289a2a4106 100644 (file)
@@ -107,7 +107,7 @@ public final class BestPathStateImpl implements BestPathState {
             return;
         }
 
-        final NamespaceSpecificIds ids = PATH_CACHE.getUnchecked(attributes.getIdentifier().getNodeType().getModule());
+        final NamespaceSpecificIds ids = PATH_CACHE.getUnchecked(attributes.name().getNodeType().getModule());
         localPref = (Uint32) NormalizedNodes.findNode(attributes, ids.locPref)
             .map(NormalizedNode::body)
             .orElse(null);
index e060c42163f889eb9084d299b5fdd18d51426c77..54967c2603dda6e04af971874986296e8164882d 100644 (file)
@@ -370,7 +370,7 @@ abstract class AbstractPeer extends BGPPeerStateImpl implements BGPRouteEntryImp
         final Peer fromPeer = entryDep.getPeerTracker().getPeer(fromPeerId);
         final RIBSupport<?, ?> ribSupport = entryDep.getRIBSupport();
         final BGPRouteEntryExportParameters routeEntry = new BGPRouteEntryExportParametersImpl(fromPeer, this,
-            ribSupport.extractRouteKey(route.getIdentifier()), rtCache);
+            ribSupport.extractRouteKey(route.name()), rtCache);
 
         final Attributes bindingAttrs = ribSupport.attributeFromContainerNode(attrs);
         final Optional<Attributes> optExportAttrs = entryDep.getRoutingPolicies().applyExportPolicies(routeEntry,
index e6ae77c681e93970be79e1365b7b2c1c4b0f72b7..24155b249973c25c8237b276badbb7e0f4afd940 100644 (file)
@@ -195,7 +195,7 @@ final class AdjRibInWriter {
             final Builder<TablesKey, TableContext> tb) {
         // We will use table keys very often, make sure they are optimized
         final InstanceIdentifierBuilder idb = YangInstanceIdentifier.builder(newPeerPath
-                .node(EMPTY_ADJRIBIN.getIdentifier()).node(TABLES_NID)).node(rs.getRibSupport().tablesKey());
+                .node(EMPTY_ADJRIBIN.name()).node(TABLES_NID)).node(rs.getRibSupport().tablesKey());
 
         final TableContext ctx = new TableContext(rs, idb.build());
         ctx.createEmptyTableStructure(tx);
@@ -219,7 +219,7 @@ final class AdjRibInWriter {
         }
         tx.put(LogicalDatastoreType.OPERATIONAL, newPeerPath.node(PEER_TABLES).node(supTablesKey), tt.build());
         rs.createEmptyTableStructure(tx,
-            newPeerPath.node(EMPTY_ADJRIBOUT.getIdentifier()).node(TABLES_NID).node(tableKey));
+            newPeerPath.node(EMPTY_ADJRIBOUT.name()).node(TABLES_NID).node(tableKey));
     }
 
     private void createEmptyPeerStructure(final PeerId newPeerId,
@@ -348,7 +348,7 @@ final class AdjRibInWriter {
                                     synchronized (staleRoutesRegistry) {
                                         final MapNode routesNode = (MapNode) routesOptional.orElseThrow();
                                         final List<NodeIdentifierWithPredicates> routes = routesNode.body().stream()
-                                                .map(MapEntryNode::getIdentifier)
+                                                .map(MapEntryNode::name)
                                                 .collect(Collectors.toList());
                                         if (!routes.isEmpty()) {
                                             staleRoutesRegistry.put(tablesKey, routes);
index 3bceb1442829dcde3e94297d39bbe3a68b320257..ddd3069a5b624a34d14c9c62e2805f785d139142 100644 (file)
@@ -126,7 +126,7 @@ final class AdjRibOutListener implements ClusteredDOMDataTreeChangeListener, Pre
         final Update update;
         switch (route.getModificationType()) {
             case UNMODIFIED:
-                LOG.debug("Skipping unmodified route {}", route.getIdentifier());
+                LOG.debug("Skipping unmodified route {}", route.name());
                 return;
             case DELETE:
             case DISAPPEARED:
index 0801369e23699251f0e3bc5cfc075a60b9c01b5a..4a73bbec12564b4ef0a7556885400d4d6c1f86c8 100644 (file)
@@ -278,7 +278,7 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
     @Holding("this")
     private void changeDataTree(final DOMDataTreeWriteTransaction tx, final YangInstanceIdentifier rootPath,
             final DataTreeCandidateNode root, final DataTreeCandidateNode table) {
-        final PathArgument lastArg = table.getIdentifier();
+        final PathArgument lastArg = table.name();
         verify(lastArg instanceof NodeIdentifierWithPredicates, "Unexpected type %s in path %s", lastArg.getClass(),
             rootPath);
         final NodeIdentifierWithPredicates tableKey = (NodeIdentifierWithPredicates) lastArg;
@@ -430,8 +430,7 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
         if (maybeRoutesAfter.isPresent()) {
             final YangInstanceIdentifier routesPath = routeMapPath(ribSupport, effectiveTablePath);
             for (MapEntryNode routeAfter : extractMap(maybeRoutesAfter).body()) {
-                writeRoute(tx, ribSupport, routesPath.node(routeAfter.getIdentifier()), null, routeAfter,
-                    longLivedStale);
+                writeRoute(tx, ribSupport, routesPath.node(routeAfter.name()), null, routeAfter, longLivedStale);
             }
         }
     }
@@ -441,7 +440,7 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
         if (RouteTargetConstrainSubsequentAddressFamily.VALUE.equals(ribSupport.getTablesKey().getSafi())) {
             final YangInstanceIdentifier routesPath = routeMapPath(ribSupport, effectiveTablePath);
             for (final MapEntryNode routeBefore : deletedRoutes) {
-                deleteRouteTarget(ribSupport, routesPath.node(routeBefore.getIdentifier()), routeBefore);
+                deleteRouteTarget(ribSupport, routesPath.node(routeBefore.name()), routeBefore);
             }
             rtMembershipsUpdated = true;
         }
@@ -452,8 +451,8 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
 
     private void processRoute(final DOMDataTreeWriteTransaction tx, final RIBSupport<?, ?> ribSupport,
             final YangInstanceIdentifier routesPath, final DataTreeCandidateNode route, final boolean longLivedStale) {
-        LOG.debug("Process route {}", route.getIdentifier());
-        final YangInstanceIdentifier routePath = ribSupport.routePath(routesPath, route.getIdentifier());
+        LOG.debug("Process route {}", route.name());
+        final YangInstanceIdentifier routePath = ribSupport.routePath(routesPath, route.name());
         switch (route.getModificationType()) {
             case DELETE:
             case DISAPPEARED:
index 227b5cdccb84625a055a46bb81a5044ef98cacfa..39c74959e19a5d4dc78d9f224a6759e7eacb1b7b 100644 (file)
@@ -280,7 +280,7 @@ final class LocRibWriter<C extends Routes & DataObject & ChoiceIn<Tables>, S ext
     private void updateRoutesEntries(final Collection<DataTreeCandidateNode> collection,
             final RouterId routerId, final Map<RouteUpdateKey, RouteEntry<C, S>> routes) {
         for (final DataTreeCandidateNode route : collection) {
-            final PathArgument routeArg = route.getIdentifier();
+            final PathArgument routeArg = route.name();
             if (!(routeArg instanceof NodeIdentifierWithPredicates routeId)) {
                 LOG.debug("Route {} already deleted", routeArg);
                 return;
index 3cc0b02240506e8d61c6bda528ac5afa6651b4de..edcc6fe0d9e577f48b5849f5a57a9959aa830518 100644 (file)
@@ -152,7 +152,7 @@ public final class RIBImpl extends BGPRibStateImpl implements RIB, DOMTransactio
         if (ribSupport != null) {
             final MapEntryNode emptyTable = ribSupport.emptyTable();
             final InstanceIdentifierBuilder tableId = YangInstanceIdentifier
-                    .builder(yangRibId.node(LOCRIB_NID).node(TABLES_NID)).node(emptyTable.getIdentifier());
+                    .builder(yangRibId.node(LOCRIB_NID).node(TABLES_NID)).node(emptyTable.name());
 
             tx.put(LogicalDatastoreType.OPERATIONAL, tableId.build(), emptyTable);
             try {
index da731b2e758cea5016b75fed7e750ff1d5515772..34013f79f3f32fc58c4cf0cc5c51d8a95b09ea87 100644 (file)
@@ -83,7 +83,7 @@ public class RibImplTest extends AbstractConfig {
         doReturn(emptyTable).when(ribSupport).emptyTable();
         final NodeIdentifierWithPredicates niie = NodeIdentifierWithPredicates.of(Rib.QNAME,
                 QName.create("", "test").intern(), "t");
-        doReturn(niie).when(emptyTable).getIdentifier();
+        doReturn(niie).when(emptyTable).name();
         doReturn(domTx).when(domDataBroker).createMergingTransactionChain(any());
         final DOMDataTreeChangeService dOMDataTreeChangeService = mock(DOMDataTreeChangeService.class);
         doReturn(ImmutableClassToInstanceMap.of(DOMDataTreeChangeService.class, dOMDataTreeChangeService))
index 8b4799d42af7b45c805c9fd50d32de6030fac3b5..d3f29be1d42770a0c2e133907786621490d19cac 100644 (file)
@@ -48,12 +48,12 @@ public abstract class AbstractAdvertizedRoute<C extends Routes & DataObject & Ch
         this.attributes = attributes;
         this.depreferenced = depreferenced;
         this.isFirstBestPath = isFirstBestPath;
-        this.addPathRouteKeyIdentifier = ribSupport.toAddPathListArgument(route.getIdentifier());
-        this.nonAddPathRouteKeyIdentifier = ribSupport.toNonPathListArgument(addPathRouteKeyIdentifier);
+        addPathRouteKeyIdentifier = ribSupport.toAddPathListArgument(route.name());
+        nonAddPathRouteKeyIdentifier = ribSupport.toNonPathListArgument(addPathRouteKeyIdentifier);
     }
 
     public final PeerId getFromPeerId() {
-        return this.fromPeerId;
+        return fromPeerId;
     }
 
     public final MapEntryNode getRoute() {
@@ -75,6 +75,6 @@ public abstract class AbstractAdvertizedRoute<C extends Routes & DataObject & Ch
 
     @Override
     public final NodeIdentifierWithPredicates getAddPathRouteKeyIdentifier() {
-        return route.getIdentifier();
+        return route.name();
     }
 }
index 33ca3a930d2a6baa978dd1ec159a25085fbd4c3c..f7ab0a8c67a865b70f5ac2a97e9bda1dd59f2609 100644 (file)
@@ -24,7 +24,6 @@ import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
 import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionConsumerContext;
-import org.opendaylight.protocol.bgp.rib.spi.RIBSupport;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.ipv4.prefixes.DestinationIpv4Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.ipv4.prefixes.destination.ipv4.Ipv4Prefixes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.ipv4.prefixes.destination.ipv4.Ipv4PrefixesBuilder;
@@ -55,7 +54,7 @@ final class BmpRibInWriter {
     private static final LeafNode<Boolean> ATTRIBUTES_UPTODATE_FALSE =
             ImmutableNodes.leafNode(QName.create(BMP_ATTRIBUTES_QNAME, "uptodate").intern(), Boolean.FALSE);
     private static final LeafNode<Boolean> ATTRIBUTES_UPTODATE_TRUE =
-            ImmutableNodes.leafNode(ATTRIBUTES_UPTODATE_FALSE.getIdentifier(), Boolean.TRUE);
+            ImmutableNodes.leafNode(ATTRIBUTES_UPTODATE_FALSE.name(), Boolean.TRUE);
 
     private final DOMTransactionChain chain;
     private final Map<TablesKey, TableContext> tables;
@@ -130,7 +129,7 @@ final class BmpRibInWriter {
 
         final ImmutableMap.Builder<TablesKey, TableContext> tb = ImmutableMap.builder();
         for (final TablesKey tableType : tableTypes) {
-            final RIBSupport rs = ribExtensions.getRIBSupport(tableType);
+            final var rs = ribExtensions.getRIBSupport(tableType);
             if (rs == null) {
                 LOG.warn("No support for table type {}, skipping it", tableType);
                 continue;
@@ -143,7 +142,7 @@ final class BmpRibInWriter {
             ctx.createTable(tx);
 
             tx.put(LogicalDatastoreType.OPERATIONAL, ctx.getTableId().node(BMP_ATTRIBUTES_QNAME)
-                    .node(ATTRIBUTES_UPTODATE_FALSE.getIdentifier()), ATTRIBUTES_UPTODATE_FALSE);
+                    .node(ATTRIBUTES_UPTODATE_FALSE.name()), ATTRIBUTES_UPTODATE_FALSE);
             LOG.debug("Created table instance {}", ctx.getTableId());
             tb.put(tableType, ctx);
         }
@@ -285,7 +284,7 @@ final class BmpRibInWriter {
         final DOMDataTreeWriteTransaction tx = chain.newWriteOnlyTransaction();
         final TableContext ctxPre = tables.get(tableTypes);
         tx.merge(LogicalDatastoreType.OPERATIONAL, ctxPre.getTableId().node(BMP_ATTRIBUTES_QNAME)
-                .node(ATTRIBUTES_UPTODATE_TRUE.getIdentifier()), ATTRIBUTES_UPTODATE_TRUE);
+                .node(ATTRIBUTES_UPTODATE_TRUE.name()), ATTRIBUTES_UPTODATE_TRUE);
         tx.commit().addCallback(new FutureCallback<CommitInfo>() {
             @Override
             public void onSuccess(final CommitInfo result) {
index 4caa13f69b1bd8fe27dcd962f38ad645a3e79467..ac0f77de4fe6c3a9befd93129f3c7a3c11d16807 100644 (file)
@@ -61,7 +61,7 @@ public final class BmpMonitorConfigFileProcessor extends AbstractConfigFileProce
 
         final DOMDataTreeWriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
         wtx.merge(LogicalDatastoreType.CONFIGURATION,
-            YangInstanceIdentifier.create(new NodeIdentifier(OdlBmpMonitors.QNAME), monitorsList.getIdentifier()),
+            YangInstanceIdentifier.create(new NodeIdentifier(OdlBmpMonitors.QNAME), monitorsList.name()),
             monitorsList);
         return wtx.commit();
     }
index 2fce6705bb25dfe7a6ac6e73599b68e2e1307313..d7abe971e6fdf63ca66ade5af0462a5aeba0ad9a 100644 (file)
@@ -86,7 +86,7 @@ public final class ProtocolsConfigFileProcessor extends AbstractConfigFileProces
             .withChild(ImmutableNodes.leafNode(NAME, GLOBAL_BGP_NAME))
             .build());
         wtx.merge(LogicalDatastoreType.CONFIGURATION,
-            GLOBAL_BGP_PATH.node(Protocols.QNAME).node(protocols.getIdentifier()), protocols);
+            GLOBAL_BGP_PATH.node(Protocols.QNAME).node(protocols.name()), protocols);
         return wtx.commit();
     }
 }
index 708d129e0f0ae14bb41485979579ea251f5592dc..9084f3874269dfd8fc914b83fc92961029ff61ba 100644 (file)
@@ -67,9 +67,9 @@ public final class NetworkTopologyConfigFileProcessor extends AbstractConfigFile
         final DOMDataTreeWriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
 
         LOG.info("Storing Topologies {}", topologies.body().stream()
-            .map(topo -> topo.getIdentifier().asMap()).collect(Collectors.toList()));
+            .map(topo -> topo.name().asMap()).collect(Collectors.toList()));
         wtx.merge(LogicalDatastoreType.CONFIGURATION,
-            YangInstanceIdentifier.create(new NodeIdentifier(NetworkTopology.QNAME), topologies.getIdentifier()),
+            YangInstanceIdentifier.create(new NodeIdentifier(NetworkTopology.QNAME), topologies.name()),
             topologies);
 
         return wtx.commit();