2 * Copyright (c) 2016 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
9 package org.opendaylight.protocol.bgp.rib.spi;
11 import java.util.Optional;
12 import javax.annotation.Nonnull;
13 import javax.annotation.Nullable;
14 import org.opendaylight.protocol.concepts.AbstractRegistration;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.SendReceive;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.PeerId;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.PeerRole;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.SimpleRoutingPolicy;
19 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
20 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
23 * Tracks peers for adj-rib-out writeout.
25 public interface ExportPolicyPeerTracker {
27 * Update set with supported tables per peer
28 * @param peerId which receveid the change
29 * @param node data change
32 default void onTablesChanged(PeerId peerId, DataTreeCandidateNode node) {}
36 * @param peerId Peer Id
37 * @param sendReceive send receive add ath configuration of the peer
38 * @param peerPath Yii of the peer
39 * @param peerRole Role of the peer
40 * @param simpleRoutingPolicy
42 AbstractRegistration registerPeer(@Nonnull PeerId peerId, @Nullable SendReceive sendReceive, @Nonnull YangInstanceIdentifier peerPath, @Nonnull PeerRole peerRole,
43 @Nonnull Optional<SimpleRoutingPolicy> simpleRoutingPolicy);
46 * returns PeerExportGroup per role
47 * @param role of desired PeerExportGroup
48 * @return PeerExportGroup
50 PeerExportGroup getPeerGroup(@Nonnull PeerRole role);
53 * check whether the peer supports the table
54 * @param peerId of peer
55 * @return true if peer supports table
57 boolean isTableSupported(@Nonnull PeerId peerId);
60 * @param peerId of peer
61 * @return Role of peer
63 PeerRole getRole(@Nonnull YangInstanceIdentifier peerId);
66 * Check whether Peer supports Add Path
68 * @return true if add-path is supported
70 boolean isAddPathSupportedByPeer(@Nonnull PeerId peerId);
73 * Invoked whenever a peer role changes.
75 * @param peerPath Peer's path
76 * @param role Peer's new role, null indicates the peer has disappeared.
79 default void peerRoleChanged(@Nonnull YangInstanceIdentifier peerPath, @Nullable PeerRole role) {