2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.protocol.bgp.rib.impl.spi;
10 import javax.annotation.Nullable;
11 import org.opendaylight.protocol.bgp.rib.spi.RIBSupport;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.Tables;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes;
16 import org.opendaylight.yangtools.yang.binding.ChildOf;
17 import org.opendaylight.yangtools.yang.binding.ChoiceIn;
18 import org.opendaylight.yangtools.yang.binding.DataObject;
19 import org.opendaylight.yangtools.yang.binding.Identifiable;
20 import org.opendaylight.yangtools.yang.binding.Identifier;
21 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
23 public interface RIBSupportContextRegistry {
25 * Acquire a RIB Support for a AFI/SAFI combination.
27 * @param key AFI/SAFI key
28 * @return RIBSupport instance, or null if the AFI/SAFI is not implemented.
31 <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<? super C>,
32 R extends Route & ChildOf<? super S> & Identifiable<I>,
33 I extends Identifier<R>> RIBSupport<C, S, R, I> getRIBSupport(TablesKey key);
36 * Acquire a RIB Support Context for a AFI/SAFI combination.
38 * @param key AFI/SAFI key
39 * @return RIBSupport instance, or null if the AFI/SAFI is not implemented.
42 RIBSupportContext getRIBSupportContext(TablesKey key);
45 * Acquire a RIB Support Context for a AFI/SAFI combination.
47 * @param key Tables key with AFI/SAFI key
48 * @return RIBSupport instance, or null if the AFI/SAFI is not implemented.
51 RIBSupportContext getRIBSupportContext(NodeIdentifierWithPredicates key);
54 * Acquire a RIB Support Context for a AFI/SAFI combination.
56 * @param key Tables key with AFI/SAFI key
57 * @return RIBSupport instance, or null if the AFI/SAFI is not implemented.
60 default <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<? super C>,
61 R extends Route & ChildOf<? super S> & Identifiable<I>,
62 I extends Identifier<R>> RIBSupport<C, S, R, I> getRIBSupport(NodeIdentifierWithPredicates key) {
63 final RIBSupportContext support = getRIBSupportContext(key);
64 return support == null ? null : support.getRibSupport();