2 * Copyright (c) 2015 Cisco Systems, Inc. and others. 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.add.n.paths;
10 import com.google.common.primitives.UnsignedInteger;
11 import org.opendaylight.protocol.bgp.mode.impl.add.AddPathBestPath;
12 import org.opendaylight.protocol.bgp.mode.impl.add.RouteKey;
13 import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
14 import org.opendaylight.protocol.bgp.rib.spi.RIBSupport;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.Route;
16 import org.opendaylight.yangtools.yang.binding.Identifier;
18 final class SimpleRouteEntry extends AbstractNPathsRouteEntry {
19 SimpleRouteEntry(final Long npaths, final BGPPeerTracker peerTracker) {
20 super(npaths, peerTracker);
24 public boolean removeRoute(final UnsignedInteger routerId, final long remotePathId) {
25 final RouteKey key = new RouteKey(routerId, remotePathId);
26 return removeRoute(key, getOffsets().offsetOf(key));
30 public Route createRoute(final RIBSupport ribSup, final Identifier routeKey, final long pathId,
31 final AddPathBestPath path) {
32 return ribSup.createRoute(null, routeKey, pathId, path.getAttributes());
36 public int addRoute(final UnsignedInteger routerId, final long remotePathId, final Route route) {
37 return addRoute(new RouteKey(routerId, remotePathId), route.getAttributes());