Undo damage done by https://git.opendaylight.org/gerrit/#/c/69403/ 57/78757/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 6 Dec 2018 15:19:04 +0000 (16:19 +0100)
committerRobert Varga <nite@hq.sk>
Thu, 13 Dec 2018 16:39:48 +0000 (16:39 +0000)
This patch restores the ability to lookup RIBSupportContext
through NodeIdentifierWithPredicates.

Change-Id: I2b9399620f4935a50e8458042a767bc3e1aa5b59
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/RIBSupportContextRegistryImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/spi/RIBSupportContextRegistry.java

index 7afd00475d9ae267ebadad496a8f33c9455c6cb7..3a7c53846dcc3e65dc5ba12452a585cc46ae0d46 100644 (file)
@@ -26,6 +26,7 @@ import org.opendaylight.yangtools.yang.binding.ChoiceIn;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.Identifiable;
 import org.opendaylight.yangtools.yang.binding.Identifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 
 final class RIBSupportContextRegistryImpl implements RIBSupportContextRegistry {
 
@@ -66,4 +67,10 @@ final class RIBSupportContextRegistryImpl implements RIBSupportContextRegistry {
         final RIBSupport<?, ?, ?, ?> ribSupport = this.extensionContext.getRIBSupport(key);
         return ribSupport == null ? null : this.contexts.getUnchecked(ribSupport);
     }
+
+    @Override
+    public RIBSupportContext getRIBSupportContext(final NodeIdentifierWithPredicates key) {
+        final RIBSupport<?, ?, ?, ?> ribSupport = this.extensionContext.getRIBSupport(key);
+        return ribSupport == null ? null : this.contexts.getUnchecked(ribSupport);
+    }
 }
index f3825bcc6ea0ffa9d104c965403f307c3e58372e..4c8f34b0a3622e7ca03850203666432e20f72d5f 100644 (file)
@@ -18,9 +18,9 @@ import org.opendaylight.yangtools.yang.binding.ChoiceIn;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.Identifiable;
 import org.opendaylight.yangtools.yang.binding.Identifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 
 public interface RIBSupportContextRegistry {
-
     /**
      * Acquire a RIB Support for a AFI/SAFI combination.
      *
@@ -42,4 +42,14 @@ public interface RIBSupportContextRegistry {
      */
     @Nullable
     RIBSupportContext getRIBSupportContext(TablesKey key);
+
+    /**
+     * Acquire a RIB Support Context for a AFI/SAFI combination.
+     *
+     * @param key Tables key with AFI/SAFI key
+     * @return RIBSupport instance, or null if the AFI/SAFI is
+     * not implemented.
+     */
+    @Nullable
+    RIBSupportContext getRIBSupportContext(NodeIdentifierWithPredicates key);
 }