Route Constrain policies
[bgpcep.git] / bgp / path-selection-mode / src / main / java / org / opendaylight / protocol / bgp / mode / impl / BGPRouteEntryExportParametersImpl.java
index 34b0c0d57abc1272980f13e0ef0b9d2918b4465d..21ee2cd790fc3ed82706a7655c1f6575f4b941f0 100644 (file)
@@ -10,19 +10,26 @@ package org.opendaylight.protocol.bgp.mode.impl;
 import java.util.List;
 import org.opendaylight.protocol.bgp.rib.spi.Peer;
 import org.opendaylight.protocol.bgp.rib.spi.policy.BGPRouteEntryExportParameters;
+import org.opendaylight.protocol.bgp.rib.spi.policy.RTCCache;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.PeerId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.PeerRole;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.ClusterIdentifier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteTarget;
 
 public final class BGPRouteEntryExportParametersImpl implements BGPRouteEntryExportParameters {
     private final Peer fromPeer;
     private final Peer toPeer;
+    private final String routeKey;
+    private final RTCCache rtCache;
 
-    public BGPRouteEntryExportParametersImpl(final Peer fromPeer, final Peer toPeer) {
+    public BGPRouteEntryExportParametersImpl(final Peer fromPeer, final Peer toPeer,
+            final String routeKey, final RTCCache rtCache) {
         this.fromPeer = fromPeer;
         this.toPeer = toPeer;
+        this.routeKey = routeKey;
+        this.rtCache = rtCache;
     }
 
     @Override
@@ -55,6 +62,11 @@ public final class BGPRouteEntryExportParametersImpl implements BGPRouteEntryExp
         return this.toPeer.getLocalAs();
     }
 
+    @Override
+    public String getRouteKey() {
+        return this.routeKey;
+    }
+
     @Override
     public PeerId getToPeerId() {
         return this.toPeer.getPeerId();
@@ -64,4 +76,9 @@ public final class BGPRouteEntryExportParametersImpl implements BGPRouteEntryExp
     public List<RouteTarget> getMemberships() {
         return this.toPeer.getMemberships();
     }
+
+    @Override
+    public List<Route> getClientRouteTargetContrainCache() {
+        return this.rtCache.getClientRouteTargetContrainCache();
+    }
 }