2 * Copyright (c) 2018 AT&T Intellectual Property. 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
8 package org.opendaylight.protocol.bgp.mode.impl;
10 import java.util.List;
11 import org.opendaylight.protocol.bgp.rib.spi.Peer;
12 import org.opendaylight.protocol.bgp.rib.spi.policy.BGPRouteEntryExportParameters;
13 import org.opendaylight.protocol.bgp.rib.spi.policy.RTCCache;
14 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.PeerId;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.PeerRole;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.ClusterIdentifier;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.RouteTarget;
21 public final class BGPRouteEntryExportParametersImpl implements BGPRouteEntryExportParameters {
22 private final Peer fromPeer;
23 private final Peer toPeer;
24 private final String routeKey;
25 private final RTCCache rtCache;
27 public BGPRouteEntryExportParametersImpl(final Peer fromPeer, final Peer toPeer,
28 final String routeKey, final RTCCache rtCache) {
29 this.fromPeer = fromPeer;
31 this.routeKey = routeKey;
32 this.rtCache = rtCache;
36 public PeerRole getFromPeerRole() {
37 return this.fromPeer.getRole();
41 public PeerId getFromPeerId() {
42 return this.fromPeer.getPeerId();
46 public ClusterIdentifier getFromClusterId() {
47 return this.fromPeer.getClusterId();
51 public AsNumber getFromPeerLocalAs() {
52 return this.fromPeer.getLocalAs();
56 public PeerRole getToPeerRole() {
57 return this.toPeer.getRole();
61 public AsNumber getToPeerLocalAs() {
62 return this.toPeer.getLocalAs();
66 public String getRouteKey() {
71 public PeerId getToPeerId() {
72 return this.toPeer.getPeerId();
76 public List<RouteTarget> getMemberships() {
77 return this.toPeer.getMemberships();
81 public List<Route> getClientRouteTargetContrainCache() {
82 return this.rtCache.getClientRouteTargetContrainCache();