2 * Copyright (c) 2016 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
9 package org.opendaylight.protocol.bgp.mode.impl.add.all.paths;
11 import com.google.common.primitives.UnsignedInteger;
12 import org.opendaylight.protocol.bgp.mode.impl.add.AddPathBestPath;
13 import org.opendaylight.protocol.bgp.mode.impl.add.RouteKey;
14 import org.opendaylight.protocol.bgp.rib.spi.BGPPeerTracker;
15 import org.opendaylight.protocol.bgp.rib.spi.RIBSupport;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.Route;
17 import org.opendaylight.yangtools.yang.binding.Identifier;
19 final class SimpleRouteEntry extends AbstractAllPathsRouteEntry {
20 SimpleRouteEntry(final BGPPeerTracker peerTracker) {
25 public boolean removeRoute(final UnsignedInteger routerId, final long remotePathId) {
26 final RouteKey key = new RouteKey(routerId, remotePathId);
27 return removeRoute(key, getOffsets().offsetOf(key));
31 public Route createRoute(final RIBSupport ribSup, final Identifier routeKey, final long pathId,
32 final AddPathBestPath path) {
33 return ribSup.createRoute(null, routeKey, pathId, path.getAttributes());
37 public int addRoute(final UnsignedInteger routerId, final long remotePathId, final Route route) {
38 return addRoute(new RouteKey(routerId, remotePathId), route.getAttributes());