Provide Add Path support for all AFI/SAFI
[bgpcep.git] / bgp / rib-spi / src / main / java / org / opendaylight / protocol / bgp / rib / spi / RIBExtensionConsumerContext.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.protocol.bgp.rib.spi;
9
10 import javax.annotation.Nonnull;
11 import javax.annotation.Nullable;
12 import org.opendaylight.mdsal.binding.generator.impl.GeneratedClassLoadingStrategy;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.AddressFamily;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.SubsequentAddressFamily;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
17
18 /**
19  * Interface for acquiring AdjRIBsIn factories. In order for a model-driven RIB implementation to work correctly, it
20  * has to know how to handle individual NLRI fields, whose encoding is specific to a AFI/SAFI pair. This interface
21  * exposes an entry point for locating the AFI/SAFI-specific implementation handler.
22  */
23 public interface RIBExtensionConsumerContext {
24
25     /**
26      * Acquire a RIB implementation factory for a AFI/SAFI combination.
27      *
28      * @param key AFI/SAFI key
29      * @return RIBSupport instance, or null if the AFI/SAFI is not implemented.
30      */
31     @Nullable
32     RIBSupport getRIBSupport(@Nonnull TablesKey key);
33
34     /**
35      * Acquire a RIB implementation factory for a AFI/SAFI combination.
36      *
37      * @param afi  Address Family Identifier
38      * @param safi Subsequent Address Family identifier
39      * @return RIBSupport instance, or null if the AFI/SAFI is not implemented.
40      */
41     @Nullable
42     RIBSupport getRIBSupport(@Nonnull Class<? extends AddressFamily> afi,
43         @Nonnull Class<? extends SubsequentAddressFamily> safi);
44
45     /**
46      * Acquire a RIB implementation factory for a AFI/SAFI combination.
47      *
48      * @param key Tables key with AFI/SAFI
49      * @return RIBSupport instance, or null if the AFI/SAFI is
50      *     not implemented.
51      */
52     @Nullable
53     RIBSupport getRIBSupport(@Nonnull NodeIdentifierWithPredicates key);
54
55
56     /**
57      * Returns class loading strategy for loading YANG modeled classes
58      * associated with registered RIB supports.
59      *
60      * @return Class loading strategy for loading YANG modeled classes.
61      */
62     @Nonnull
63     GeneratedClassLoadingStrategy getClassLoadingStrategy();
64 }