b78af61d4d7483a822f7a98e0a72ddf5487bab8c
[bgpcep.git] / bgp / rib-spi / src / main / java / org / opendaylight / protocol / bgp / rib / spi / entry / AdvertizedRoute.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.rib.spi.entry;
9
10 import org.opendaylight.protocol.bgp.rib.spi.RIBSupport;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.PeerId;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.Tables;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes;
16 import org.opendaylight.yangtools.yang.binding.ChildOf;
17 import org.opendaylight.yangtools.yang.binding.ChoiceIn;
18 import org.opendaylight.yangtools.yang.binding.DataObject;
19 import org.opendaylight.yangtools.yang.binding.Identifiable;
20 import org.opendaylight.yangtools.yang.binding.Identifier;
21
22 /**
23  * new Routes to be advertized.
24  *
25  * @author Claudio D. Gasparini
26  */
27 public final class AdvertizedRoute<C extends Routes & DataObject & ChoiceIn<Tables>,
28         S extends ChildOf<? super C>, R extends Route & ChildOf<? super S> & Identifiable<I>,
29         I extends Identifier<R>> extends AbstractAdvertizedRoute<C, S, R, I> {
30     private final boolean isFirstBestPath;
31
32     public AdvertizedRoute(final RIBSupport<C, S, R, I> ribSupport, final R route, final Attributes attributes,
33             final PeerId fromPeerId, final boolean depreferenced) {
34         this(ribSupport, true, route, attributes, fromPeerId, depreferenced);
35     }
36
37     public AdvertizedRoute(final RIBSupport<C, S, R, I> ribSupport, final boolean isFirstBestPath,
38             final R route, final Attributes attributes, final PeerId fromPeerId, final boolean depreferenced) {
39         super(ribSupport, route, fromPeerId, attributes, depreferenced);
40         this.isFirstBestPath = isFirstBestPath;
41     }
42
43     public boolean isFirstBestPath() {
44         return this.isFirstBestPath;
45     }
46 }