Remove RibSupportUtils
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / ApplicationPeer.java
index 8162d365dbdfad2106fa5227d3c9487b14f3f8dc..89f9df173ed47951ca34d127d38b3e70fbf3a169 100644 (file)
@@ -131,8 +131,15 @@ public class ApplicationPeer extends AbstractPeer implements ClusteredDOMDataTre
     public synchronized void instantiateServiceInstance(final DOMDataTreeChangeService dataTreeChangeService,
             final DOMDataTreeIdentifier appPeerDOMId) {
         setActive(true);
-        final Set<TablesKey> localTables = rib.getLocalTablesKeys();
-        localTables.forEach(tablesKey -> supportedTables.add(RibSupportUtils.toYangTablesKey(tablesKey)));
+        final var localTables = rib.getLocalTablesKeys();
+        for (var localTable : localTables) {
+            final var tableSupport = rib.getRibSupportContext().getRIBSupport(localTable);
+            if (tableSupport != null) {
+                supportedTables.add(tableSupport.tablesKey());
+            } else {
+                LOG.warn("Ignoring unsupported table {}", localTable);
+            }
+        }
         setAdvertizedGracefulRestartTableTypes(List.of());
 
         createDomChain();