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;
10 import com.google.common.base.Optional;
12 import javax.annotation.Nonnull;
13 import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
14 import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
15 import org.opendaylight.protocol.bgp.openconfig.spi.BGPOpenConfigProvider;
16 import org.opendaylight.protocol.bgp.rib.RibReference;
17 import org.opendaylight.protocol.bgp.rib.spi.CacheDisconnectedPeers;
18 import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionConsumerContext;
19 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
20 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.TablesKey;
23 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
26 * Internal reference to a RIB instance.
28 public interface RIB extends RibReference {
29 AsNumber getLocalAs();
31 Ipv4Address getBgpIdentifier();
34 * Return the set of table identifiers which are accepted and advertised
35 * by this RIB instance.
37 * @return A set of identifiers.
39 @Nonnull Set<? extends BgpTableType> getLocalTables();
41 BGPDispatcher getDispatcher();
43 long getRoutesCount(TablesKey key);
46 * Allocate a new transaction chain for use with a peer.
48 * @param listener {@link TransactionChainListener} handling recovery
49 * @return A new transaction chain.
51 DOMTransactionChain createPeerChain(TransactionChainListener listener);
54 * Return the RIB extensions available to the RIB instance.
56 * @return RIB extensions handle.
58 RIBExtensionConsumerContext getRibExtensions();
61 * Return the RIB extensions available to the RIB instance
62 * with additional RIB specific context such as
63 * translation between DOM and Binding.
65 * @return RIB extensions handle.
67 RIBSupportContextRegistry getRibSupportContext();
70 * Return YangInstanceIdentifier of BGP Rib with its RibId.
72 * @return YangInstanceIdentifier
74 YangInstanceIdentifier getYangRibId();
76 CodecsRegistry getCodecsRegistry();
79 * Optionally returns OpenConfigProvider, which brings an access to
80 * BGP OpenConfig mappers.
81 * @return An Optional of BGPOpenConfigProvider or Absent if provider is
84 Optional<BGPOpenConfigProvider> getOpenConfigProvider();
87 * Return cache disconnected peers which allows us to avoid update
88 * DS from a peer already disconnected, when multiple peers are disconnected
89 * at the same time and their own exportPolicy has not been updated yet.
92 CacheDisconnectedPeers getCacheDisconnectedPeers();