Drop <R, I> generic from RIBSupport
[bgpcep.git] / bgp / rib-spi / src / main / java / org / opendaylight / protocol / bgp / rib / spi / RIBExtensionConsumerContext.java
index bed316df481042f1c798740aa7a32d7d18773e32..5e3e0b74ccfe0b33596b1b1ddf73d71b8b704e3c 100644 (file)
@@ -7,12 +7,16 @@
  */
 package org.opendaylight.protocol.bgp.rib.spi;
 
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import org.opendaylight.mdsal.binding.generator.impl.GeneratedClassLoadingStrategy;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.TablesKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.AddressFamily;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.SubsequentAddressFamily;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.Tables;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.AddressFamily;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.SubsequentAddressFamily;
+import org.opendaylight.yangtools.yang.binding.ChildOf;
+import org.opendaylight.yangtools.yang.binding.ChoiceIn;
+import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 
 /**
@@ -28,8 +32,8 @@ public interface RIBExtensionConsumerContext {
      * @param key AFI/SAFI key
      * @return RIBSupport instance, or null if the AFI/SAFI is not implemented.
      */
-    @Nullable
-    RIBSupport getRIBSupport(@Nonnull TablesKey key);
+    <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<C>> @Nullable RIBSupport<C, S> getRIBSupport(
+        @NonNull TablesKey key);
 
     /**
      * Acquire a RIB implementation factory for a AFI/SAFI combination.
@@ -38,27 +42,16 @@ public interface RIBExtensionConsumerContext {
      * @param safi Subsequent Address Family identifier
      * @return RIBSupport instance, or null if the AFI/SAFI is not implemented.
      */
-    @Nullable
-    RIBSupport getRIBSupport(@Nonnull Class<? extends AddressFamily> afi,
-        @Nonnull Class<? extends SubsequentAddressFamily> safi);
+    <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<C>> @Nullable RIBSupport<C, S> getRIBSupport(
+            @NonNull Class<? extends AddressFamily> afi, @NonNull Class<? extends SubsequentAddressFamily> safi);
 
     /**
      * Acquire a RIB implementation factory for a AFI/SAFI combination.
      *
      * @param key Tables key with AFI/SAFI
-     * @return RIBSupport instance, or null if the AFI/SAFI is
-     *     not implemented.
+     * @return RIBSupport instance, or null if the AFI/SAFI is not implemented.
      */
-    @Nullable
-    RIBSupport getRIBSupport(@Nonnull NodeIdentifierWithPredicates key);
-
 
-    /**
-     * Returns class loading strategy for loading YANG modeled classes
-     * associated with registered RIB supports.
-     *
-     * @return Class loading strategy for loading YANG modeled classes.
-     */
-    @Nonnull
-    GeneratedClassLoadingStrategy getClassLoadingStrategy();
-}
\ No newline at end of file
+    <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<C>> @Nullable RIBSupport<C, S> getRIBSupport(
+            @NonNull NodeIdentifierWithPredicates key);
+}