dc4cc019511bc68327575c0630b563a2f213416b
[bgpcep.git] / bgp / rib-spi / src / main / java / org / opendaylight / protocol / bgp / rib / spi / ExportPolicyPeerTracker.java
1 /*
2  * Copyright (c) 2016 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
9 package org.opendaylight.protocol.bgp.rib.spi;
10
11 import javax.annotation.Nonnull;
12 import javax.annotation.Nullable;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.PeerId;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.PeerRole;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
16 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
17
18 /**
19  * Tracks peers for adj-rib-out writeout.
20  */
21 public interface ExportPolicyPeerTracker {
22     /**
23      * Update set with supported tables per peer
24      * @param peerId which receveid the change
25      * @param node data change
26      */
27     void onTablesChanged(PeerId peerId, DataTreeCandidateNode node);
28
29     /**
30      * returns PeerExportGroup per role
31      * @param role of desired PeerExportGroup
32      * @return PeerExportGroup
33      */
34     PeerExportGroup getPeerGroup(PeerRole role);
35
36     /**
37      * check whether the peer supports the table
38      * @param peerId of peer
39      * @return true if peer supports table
40      */
41     boolean isTableSupported(PeerId peerId);
42
43     /**
44      * @param peerId of peer
45      * @return Role of peer
46      */
47     PeerRole getRole(YangInstanceIdentifier peerId);
48
49     /**
50      * Check whether Peer supports Add Path
51      * @param peerId
52      * @return true if add-path is supported
53      */
54     boolean isAddPathSupportedByPeer(PeerId peerId);
55
56     /**
57      * Invoked whenever a peer role changes.
58      *
59      * @param peerPath Peer's path
60      * @param role Peer's new role, null indicates the peer has disappeared.
61      */
62     void peerRoleChanged(@Nonnull YangInstanceIdentifier peerPath,  @Nullable PeerRole role);
63 }