Bump upstreams
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / spi / RIB.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.impl.spi;
9
10 import java.util.Set;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.mdsal.dom.api.DOMDataBroker.DataTreeChangeExtension;
13 import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
14 import org.opendaylight.protocol.bgp.rib.RibReference;
15 import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
16 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionConsumerContext;
17 import org.opendaylight.protocol.bgp.rib.spi.policy.BGPRibRoutingPolicy;
18 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.BgpTableType;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.BgpId;
22 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
23
24 /**
25  * Internal reference to a RIB instance.
26  */
27 public interface RIB extends RibReference, RibOutRefresh {
28     /**
29      * RIB AS.
30      *
31      * @return AS
32      */
33     AsNumber getLocalAs();
34
35     BgpId getBgpIdentifier();
36
37     /**
38      * Return the set of table identifiers which are accepted and advertised
39      * by this RIB instance.
40      *
41      * @return A set of identifiers.
42      */
43     @NonNull Set<? extends BgpTableType> getLocalTables();
44
45     BGPDispatcher getDispatcher();
46
47     /**
48      * Allocate a new transaction chain for use with a peer.
49      *
50      * @return A new transaction chain.
51      */
52     DOMTransactionChain createPeerDOMChain();
53
54     /**
55      * Return the RIB extensions available to the RIB instance.
56      *
57      * @return RIB extensions handle.
58      */
59     RIBExtensionConsumerContext getRibExtensions();
60
61     /**
62      * Return the RIB extensions available to the RIB instance
63      * with additional RIB specific context such as
64      * translation between DOM and Binding.
65      *
66      * @return RIB extensions handle.
67      */
68     RIBSupportContextRegistry getRibSupportContext();
69
70     /**
71      * Return YangInstanceIdentifier of BGP Rib with its RibId.
72      *
73      * @return YangInstanceIdentifier
74      */
75     YangInstanceIdentifier getYangRibId();
76
77     CodecsRegistry getCodecsRegistry();
78
79     /**
80      * Return instance of DOMDataTreeChangeService, where consumer can register to
81      * listen on DOM data changes.
82      *
83      * @return DOMDataTreeChangeService
84      */
85     DataTreeChangeExtension getService();
86
87     /**
88      * Returns true if RIB supports table.
89      *
90      * @param tableKey table
91      * @return true if supported
92      */
93     boolean supportsTable(TablesKey tableKey);
94
95     Set<TablesKey> getLocalTablesKeys();
96
97     /**
98      * Return Policies Container.
99      *
100      * @return policies
101      */
102     BGPRibRoutingPolicy getRibPolicies();
103
104     /**
105      * Returns peer tracker for the rib.
106      *
107      * @return peer tracker
108      */
109     BGPPeerTracker getPeerTracker();
110 }