af80d6ae45a42f8ab4e44b8cde2fab5e89f3fe36
[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.DOMTransactionChain;
14 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionConsumerContext;
15 import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
16 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
17 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.TablesKey;
20 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
21
22 /**
23  * Internal reference to a RIB instance.
24  */
25 public interface RIB {
26     AsNumber getLocalAs();
27
28     Ipv4Address getBgpIdentifier();
29
30     /**
31      * Return the set of table identifiers which are accepted and advertised
32      * by this RIB instance.
33      *
34      * @return A set of identifiers.
35      */
36     @Nonnull Set<? extends BgpTableType> getLocalTables();
37
38     BGPDispatcher getDispatcher();
39
40     ReconnectStrategyFactory getTcpStrategyFactory();
41
42     ReconnectStrategyFactory getSessionStrategyFactory();
43
44     long getRoutesCount(TablesKey key);
45
46     /**
47      * Allocate a new transaction chain for use with a peer.
48      *
49      * @param listener {@link TransactionChainListener} handling recovery
50      * @return A new transaction chain.
51      */
52     DOMTransactionChain createPeerChain(TransactionChainListener listener);
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 }