Provide Add Path support for all AFI/SAFI
[bgpcep.git] / bgp / path-selection-mode / src / main / java / org / opendaylight / protocol / bgp / mode / impl / base / SimpleRouteEntry.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  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.base;
9
10 import com.google.common.primitives.UnsignedInteger;
11 import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
12 import org.opendaylight.protocol.bgp.rib.spi.RIBSupport;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.Route;
14 import org.opendaylight.yangtools.yang.binding.Identifier;
15
16 final class SimpleRouteEntry extends BaseAbstractRouteEntry {
17     SimpleRouteEntry(final BGPPeerTracker peerTracker) {
18         super(peerTracker);
19     }
20
21     @Override
22     public Route createRoute(final RIBSupport ribSup, final Identifier routeKey, final long pathId,
23             final BaseBestPath path) {
24         return ribSup.createRoute(null, routeKey, pathId, path.getAttributes());
25     }
26
27     @Override
28     public boolean removeRoute(UnsignedInteger routerId, final long remotePathId) {
29         return removeRoute(routerId, getOffsets().offsetOf(routerId));
30     }
31 }