5e3e0b74ccfe0b33596b1b1ddf73d71b8b704e3c
[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 org.eclipse.jdt.annotation.NonNull;
11 import org.eclipse.jdt.annotation.Nullable;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.Tables;
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.rib.rev180329.rib.tables.Routes;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.AddressFamily;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.SubsequentAddressFamily;
17 import org.opendaylight.yangtools.yang.binding.ChildOf;
18 import org.opendaylight.yangtools.yang.binding.ChoiceIn;
19 import org.opendaylight.yangtools.yang.binding.DataObject;
20 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
21
22 /**
23  * Interface for acquiring AdjRIBsIn factories. In order for a model-driven RIB implementation to work correctly, it
24  * has to know how to handle individual NLRI fields, whose encoding is specific to a AFI/SAFI pair. This interface
25  * exposes an entry point for locating the AFI/SAFI-specific implementation handler.
26  */
27 public interface RIBExtensionConsumerContext {
28
29     /**
30      * Acquire a RIB implementation factory for a AFI/SAFI combination.
31      *
32      * @param key AFI/SAFI key
33      * @return RIBSupport instance, or null if the AFI/SAFI is not implemented.
34      */
35     <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<C>> @Nullable RIBSupport<C, S> getRIBSupport(
36         @NonNull TablesKey key);
37
38     /**
39      * Acquire a RIB implementation factory for a AFI/SAFI combination.
40      *
41      * @param afi  Address Family Identifier
42      * @param safi Subsequent Address Family identifier
43      * @return RIBSupport instance, or null if the AFI/SAFI is not implemented.
44      */
45     <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<C>> @Nullable RIBSupport<C, S> getRIBSupport(
46             @NonNull Class<? extends AddressFamily> afi, @NonNull Class<? extends SubsequentAddressFamily> safi);
47
48     /**
49      * Acquire a RIB implementation factory for a AFI/SAFI combination.
50      *
51      * @param key Tables key with AFI/SAFI
52      * @return RIBSupport instance, or null if the AFI/SAFI is not implemented.
53      */
54
55     <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<C>> @Nullable RIBSupport<C, S> getRIBSupport(
56             @NonNull NodeIdentifierWithPredicates key);
57 }