Drop <R, I> generic from RIBSupport
[bgpcep.git] / bgp / rib-spi / src / main / java / org / opendaylight / protocol / bgp / rib / spi / RIBExtensionConsumerContext.java
index a1baf4f6392af0be43204ae4ab3da1bfb53d61f0..5e3e0b74ccfe0b33596b1b1ddf73d71b8b704e3c 100644 (file)
@@ -7,13 +7,17 @@
  */
 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.rev130925.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.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+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;
 
 /**
  * Interface for acquiring AdjRIBsIn factories. In order for a model-driven RIB implementation to work correctly, it
@@ -24,35 +28,30 @@ public interface RIBExtensionConsumerContext {
 
     /**
      * Acquire a RIB implementation factory for a AFI/SAFI combination.
+     *
      * @param key AFI/SAFI key
-     * @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 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.
-     * @param afi Address Family Identifier
+     *
+     * @param afi  Address Family Identifier
      * @param safi Subsequent Address Family identifier
-     * @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 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(YangInstanceIdentifier.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);
+}