Route Constrain policies
[bgpcep.git] / bgp / path-selection-mode / src / main / java / org / opendaylight / protocol / bgp / mode / impl / BGPRouteEntryExportParametersImpl.java
1 /*
2  * Copyright (c) 2018 AT&T Intellectual Property. 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 package org.opendaylight.protocol.bgp.mode.impl;
9
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;
20
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;
26
27     public BGPRouteEntryExportParametersImpl(final Peer fromPeer, final Peer toPeer,
28             final String routeKey, final RTCCache rtCache) {
29         this.fromPeer = fromPeer;
30         this.toPeer = toPeer;
31         this.routeKey = routeKey;
32         this.rtCache = rtCache;
33     }
34
35     @Override
36     public PeerRole getFromPeerRole() {
37         return this.fromPeer.getRole();
38     }
39
40     @Override
41     public PeerId getFromPeerId() {
42         return this.fromPeer.getPeerId();
43     }
44
45     @Override
46     public ClusterIdentifier getFromClusterId() {
47         return this.fromPeer.getClusterId();
48     }
49
50     @Override
51     public AsNumber getFromPeerLocalAs() {
52         return this.fromPeer.getLocalAs();
53     }
54
55     @Override
56     public PeerRole getToPeerRole() {
57         return this.toPeer.getRole();
58     }
59
60     @Override
61     public AsNumber getToPeerLocalAs() {
62         return this.toPeer.getLocalAs();
63     }
64
65     @Override
66     public String getRouteKey() {
67         return this.routeKey;
68     }
69
70     @Override
71     public PeerId getToPeerId() {
72         return this.toPeer.getPeerId();
73     }
74
75     @Override
76     public List<RouteTarget> getMemberships() {
77         return this.toPeer.getMemberships();
78     }
79
80     @Override
81     public List<Route> getClientRouteTargetContrainCache() {
82         return this.rtCache.getClientRouteTargetContrainCache();
83     }
84 }