import com.google.common.annotations.VisibleForTesting;
import com.google.common.primitives.UnsignedInteger;
-import java.util.Optional;
import javax.annotation.concurrent.NotThreadSafe;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
final DOMDataWriteTransaction tx) {
if (this.bestPath != null) {
final BaseBestPath path = this.bestPath;
- if (filterRoutes(path.getPeerId(), destPeer, peerPT, localTK, discPeers)) {
+ final PeerRole destPeerRole = getRoutePeerIdRole(peerPT, destPeer);
+ if (filterRoutes(path.getPeerId(), destPeer, peerPT, localTK, discPeers, destPeerRole)) {
final ContainerNode effAttrib = peerGroup.effectiveAttributes(getRoutePeerIdRole(peerPT,path.getPeerId()), path.getAttributes());
writeRoute(destPeer, getAdjRibOutYII(ribSup, rootPath, routeId, localTK), effAttrib, createValue(routeId, path), ribSup, tx);
}
for (final PeerRole role : PeerRole.values()) {
final PeerExportGroup peerGroup = peerPT.getPeerGroup(role);
if (peerGroup != null) {
- final ContainerNode effAttrib = peerGroup.effectiveAttributes(getRoutePeerIdRole(peerPT,routePeerId), attributes);
+ final PeerRole destPeerRole = getRoutePeerIdRole(peerPT, routePeerId);
+ final ContainerNode effAttrib = peerGroup.effectiveAttributes(destPeerRole, attributes);
peerGroup.getPeers().stream()
- .filter(pid -> filterRoutes(routePeerId, pid.getKey(), peerPT, localTK, discPeers))
+ .filter(pid -> filterRoutes(routePeerId, pid.getKey(), peerPT, localTK, discPeers, destPeerRole))
.forEach(pid -> update(pid.getKey(), getAdjRibOutYII(ribSup, pid.getValue().getYii(), routeId, localTK), effAttrib, value, ribSup, tx));
}
}