2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.protocol.bgp.rib.impl.spi;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.mdsal.binding.api.DataBroker;
13 import org.opendaylight.mdsal.binding.api.TransactionChain;
14 import org.opendaylight.mdsal.binding.api.TransactionChainListener;
15 import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeService;
16 import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
17 import org.opendaylight.mdsal.dom.api.DOMTransactionChainListener;
18 import org.opendaylight.protocol.bgp.rib.RibReference;
19 import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
20 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionConsumerContext;
21 import org.opendaylight.protocol.bgp.rib.spi.policy.BGPRibRoutingPolicy;
22 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.BgpTableType;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.BgpId;
26 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
29 * Internal reference to a RIB instance.
31 public interface RIB extends RibReference, RibOutRefresh {
37 AsNumber getLocalAs();
39 BgpId getBgpIdentifier();
42 * Return the set of table identifiers which are accepted and advertised
43 * by this RIB instance.
45 * @return A set of identifiers.
47 @NonNull Set<? extends BgpTableType> getLocalTables();
49 BGPDispatcher getDispatcher();
52 * Allocate a new transaction chain for use with a peer.
54 * @param listener {@link TransactionChainListener} handling recovery
55 * @return A new transaction chain.
57 DOMTransactionChain createPeerDOMChain(DOMTransactionChainListener listener);
60 * Allocate a new transaction chain for use with a peer.
62 * @param listener {@link TransactionChainListener} handling recovery
63 * @return A new transaction chain.
65 TransactionChain createPeerChain(TransactionChainListener listener);
68 * Return the RIB extensions available to the RIB instance.
70 * @return RIB extensions handle.
72 RIBExtensionConsumerContext getRibExtensions();
75 * Return the RIB extensions available to the RIB instance
76 * with additional RIB specific context such as
77 * translation between DOM and Binding.
79 * @return RIB extensions handle.
81 RIBSupportContextRegistry getRibSupportContext();
84 * Return YangInstanceIdentifier of BGP Rib with its RibId.
86 * @return YangInstanceIdentifier
88 YangInstanceIdentifier getYangRibId();
90 CodecsRegistry getCodecsRegistry();
93 * Return instance of DOMDataTreeChangeService, where consumer can register to
94 * listen on DOM data changes.
96 * @return DOMDataTreeChangeService
98 DOMDataTreeChangeService getService();
105 DataBroker getDataBroker();
108 * Returns true if RIB supports table.
110 * @param tableKey table
111 * @return true if supported
113 boolean supportsTable(TablesKey tableKey);
115 Set<TablesKey> getLocalTablesKeys();
118 * Return Policies Container.
122 BGPRibRoutingPolicy getRibPolicies();
125 * Returns peer tracker for the rib.
127 * @return peer tracker
129 BGPPeerTracker getPeerTracker();