41ff5fac740d1b3da49ebb7f0f9dd1d3ac97dfc3
[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.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.TablesKey;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.AddressFamily;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.SubsequentAddressFamily;
15 import org.opendaylight.yangtools.sal.binding.generator.impl.GeneratedClassLoadingStrategy;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
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      * Acquire a RIB implementation factory for a AFI/SAFI combination.
26      * @param afi Address Family Identifier
27      * @param safi Subsequent Address Family identifier
28      * @return RIB implementation factory, or null if the AFI/SAFI is
29      *         not implemented.
30      */
31     @Nullable AdjRIBsFactory getAdjRIBsInFactory(@Nonnull Class<? extends AddressFamily> afi, @Nonnull Class<? extends SubsequentAddressFamily> safi);
32
33     /**
34      * Acquire a RIB implementation factory for a AFI/SAFI combination.
35      * @param key AFI/SAFI key
36      * @return RIBSupport instance, or null if the AFI/SAFI is
37      *         not implemented.
38      */
39     @Nullable RIBSupport getRIBSupport(@Nonnull TablesKey key);
40
41     /**
42      * Acquire a RIB implementation factory for a AFI/SAFI combination.
43      * @param afi Address Family Identifier
44      * @param safi Subsequent Address Family identifier
45      * @return RIBSupport instance, or null if the AFI/SAFI is
46      *         not implemented.
47      */
48     @Nullable RIBSupport getRIBSupport(@Nonnull Class<? extends AddressFamily> afi, @Nonnull Class<? extends SubsequentAddressFamily> safi);
49
50     /**
51      * Acquire a RIB implementation factory for a AFI/SAFI combination.
52      * @param key Tables key with AFI/SAFI
53      * @return RIBSupport instance, or null if the AFI/SAFI is
54      *         not implemented.
55      */
56     @Nullable RIBSupport getRIBSupport(YangInstanceIdentifier.NodeIdentifierWithPredicates key);
57
58
59     /**
60      * Returns class loading strategy for loading YANG modeled classes
61      * associated with registered RIB supports.
62      *
63      * @return Class loading strategy for loading YANG modeled classes.
64      */
65     @Nonnull GeneratedClassLoadingStrategy getClassLoadingStrategy();
66 }