f2070c64f2e78c748693b64efaba7e0cb79ca5a1
[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 javax.annotation.Nonnull;
12 import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
13 import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeService;
14 import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
15 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
16 import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
17 import org.opendaylight.protocol.bgp.rib.RibReference;
18 import org.opendaylight.protocol.bgp.rib.impl.stats.rib.impl.BGPRenderStats;
19 import org.opendaylight.protocol.bgp.rib.spi.CacheDisconnectedPeers;
20 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionConsumerContext;
21 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.TablesKey;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpId;
25 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
26
27 /**
28  * Internal reference to a RIB instance.
29  */
30 public interface RIB  extends RibReference, ClusterSingletonServiceProvider {
31     AsNumber getLocalAs();
32
33     BgpId getBgpIdentifier();
34
35     /**
36      * Return the set of table identifiers which are accepted and advertised
37      * by this RIB instance.
38      *
39      * @return A set of identifiers.
40      */
41     @Nonnull Set<? extends BgpTableType> getLocalTables();
42
43     BGPDispatcher getDispatcher();
44
45     /**
46      * Allocate a new transaction chain for use with a peer.
47      *
48      * @param listener {@link TransactionChainListener} handling recovery
49      * @return A new transaction chain.
50      */
51     DOMTransactionChain createPeerChain(TransactionChainListener listener);
52
53     /**
54      * Return the RIB extensions available to the RIB instance.
55      *
56      * @return RIB extensions handle.
57      */
58     RIBExtensionConsumerContext getRibExtensions();
59
60     /**
61      * Return the RIB extensions available to the RIB instance
62      * with additional RIB specific context such as
63      * translation between DOM and Binding.
64      *
65      * @return RIB extensions handle.
66      */
67     RIBSupportContextRegistry getRibSupportContext();
68
69     /**
70      * Return YangInstanceIdentifier of BGP Rib with its RibId.
71      *
72      * @return YangInstanceIdentifier
73      */
74     YangInstanceIdentifier getYangRibId();
75
76     CodecsRegistry getCodecsRegistry();
77
78     /**
79      * Return cache disconnected peers which allows us to avoid update
80      * DS from a peer already disconnected, when multiple peers are disconnected
81      * at the same time and their own exportPolicy has not been updated yet.
82      * @return
83      */
84     CacheDisconnectedPeers getCacheDisconnectedPeers();
85
86     /**
87      * Return instance of DOMDataTreeChangeService, where consumer can register to
88      * listen on DOM data changes.
89      * @return DOMDataTreeChangeService
90      */
91     DOMDataTreeChangeService getService();
92
93     BGPRenderStats getRenderStats();
94
95     ImportPolicyPeerTracker getImportPolicyPeerTracker();
96
97     Set<TablesKey> getLocalTablesKeys();
98
99     /**
100      * Return common ServiceGroupIdentifier to be used between same group cluster service
101      * @return ServiceGroupIdentifier
102      */
103     ServiceGroupIdentifier getRibIServiceGroupIdentifier();
104 }