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