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.Collection;
13 import java.util.function.BiConsumer;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.PeerId;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.PeerRole;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
17 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
20 * A collection of peers sharing the same export policy.
22 public interface PeerExportGroup {
23 final class PeerExporTuple {
24 private final YangInstanceIdentifier yii;
25 private final PeerRole role;
27 public PeerExporTuple(final YangInstanceIdentifier yii, final PeerRole role) {
32 public YangInstanceIdentifier getYii() {
36 public PeerRole getRole() {
42 * Transform outgoing attributes according to policy per Peer
44 * @param role root Peer role
45 * @param attributes attributes container
46 * @return return attributes container after apply policy
48 ContainerNode effectiveAttributes(PeerRole role, ContainerNode attributes);
52 * @deprecated Use {@link #forEach}
55 Collection<Map.Entry<PeerId, PeerExporTuple>> getPeers();
59 * @param routePeerId PeerId
60 * @return true if peer is present on this export group
62 boolean containsPeer(PeerId routePeerId);
65 * Applies the given action for each entry in this PeerExportGroup on synchronized mode
67 * @param action action to be applied
69 void forEach(BiConsumer<PeerId, YangInstanceIdentifier> action);