Merge "Revert "Add odlparent relativepath relative to autorelease""
[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.Peer;
15 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionConsumerContext;
16 import org.opendaylight.protocol.framework.ReconnectStrategyFactory;
17 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
18 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.Update;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.TablesKey;
22 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
23
24 /**
25  * Internal reference to a RIB instance.
26  */
27 public interface RIB {
28     AsNumber getLocalAs();
29
30     Ipv4Address getBgpIdentifier();
31
32     /**
33      * Return the set of table identifiers which are accepted and advertised
34      * by this RIB instance.
35      *
36      * @return A set of identifiers.
37      */
38     @Nonnull Set<? extends BgpTableType> getLocalTables();
39
40     void initTable(Peer bgpPeer, TablesKey key);
41
42     void clearTable(Peer bgpPeer, TablesKey key);
43
44     void updateTables(Peer bgpPeer, Update message);
45
46     BGPDispatcher getDispatcher();
47
48     ReconnectStrategyFactory getTcpStrategyFactory();
49
50     ReconnectStrategyFactory getSessionStrategyFactory();
51
52     AdjRIBsOutRegistration registerRIBsOut(Peer bgpPeer, AdjRIBsOut aro);
53
54     long getRoutesCount(TablesKey key);
55
56     /**
57      * Allocate a new transaction chain for use with a peer.
58      *
59      * @param listener {@link TransactionChainListener} handling recovery
60      * @return A new transaction chain.
61      */
62     DOMTransactionChain createPeerChain(TransactionChainListener listener);
63
64     /**
65      * Return the RIB extensions available to the RIB instance.
66      *
67      * @return RIB extensions handle.
68      */
69     RIBExtensionConsumerContext getRibExtensions();
70
71     /**
72      * Return the RIB extensions available to the RIB instance
73      * with additional RIB specific context such as
74      * translation between DOM and Binding.
75      *
76      * @return RIB extensions handle.
77      */
78     RIBSupportContextRegistry getRibSupportContext();
79
80     /**
81      * Return YangInstanceIdentifier of BGP Rib with its RibId.
82      *
83      * @return YangInstanceIdentifier
84      */
85     YangInstanceIdentifier getYangRibId();
86 }