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 javax.annotation.Nonnull;
12 import org.opendaylight.controller.md.sal.binding.api.BindingTransactionChain;
13 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
14 import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
15 import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeService;
16 import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
17 import org.opendaylight.protocol.bgp.rib.RibReference;
18 import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
19 import org.opendaylight.protocol.bgp.rib.spi.ExportPolicyPeerTracker;
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.rev171207.BgpTableType;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.TablesKey;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpId;
26 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
29 * Internal reference to a RIB instance.
31 public interface RIB extends RibReference {
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.
48 Set<? extends BgpTableType> getLocalTables();
50 BGPDispatcher getDispatcher();
53 * Allocate a new transaction chain for use with a peer.
55 * @param listener {@link TransactionChainListener} handling recovery
56 * @return A new transaction chain.
58 DOMTransactionChain createPeerDOMChain(TransactionChainListener listener);
61 * Allocate a new transaction chain for use with a peer.
63 * @param listener {@link TransactionChainListener} handling recovery
64 * @return A new transaction chain.
66 BindingTransactionChain createPeerChain(TransactionChainListener listener);
69 * Return the RIB extensions available to the RIB instance.
71 * @return RIB extensions handle.
73 RIBExtensionConsumerContext getRibExtensions();
76 * Return the RIB extensions available to the RIB instance
77 * with additional RIB specific context such as
78 * translation between DOM and Binding.
80 * @return RIB extensions handle.
82 RIBSupportContextRegistry getRibSupportContext();
85 * Return YangInstanceIdentifier of BGP Rib with its RibId.
87 * @return YangInstanceIdentifier
89 YangInstanceIdentifier getYangRibId();
91 CodecsRegistry getCodecsRegistry();
94 * Return instance of DOMDataTreeChangeService, where consumer can register to
95 * listen on DOM data changes.
97 * @return DOMDataTreeChangeService
99 DOMDataTreeChangeService getService();
102 * Returns ExportPolicyPeerTracker for specific tableKey, where peer can register himself
103 * as supporting the table. Same export policy can be used to check which peers support respective
104 * table and announce then routes if required.
106 * @param tablesKey supported table
107 * @return ExportPolicyPeerTracker
109 ExportPolicyPeerTracker getExportPolicyPeerTracker(TablesKey tablesKey);
114 * @return DataTreeChangeService
116 DataBroker getDataBroker();
119 * Returns true if RIB supports table.
121 * @param tableKey table
122 * @return true if supported
124 boolean supportsTable(TablesKey tableKey);
126 Set<TablesKey> getLocalTablesKeys();
129 * Return Policies Container.
133 BGPRibRoutingPolicy getRibPolicies();
136 * Returns peer tracker for the rib.
138 * @return peer tracker
140 BGPPeerTracker getPeerTracker();