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.api.BestPath;
13 import org.opendaylight.protocol.bgp.mode.impl.add.RouteKey;
14 import org.opendaylight.protocol.bgp.mode.spi.RouteEntryUtil;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
17 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
18 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
20 final class SimpleRouteEntry extends AbstractAllPathsRouteEntry {
22 public boolean removeRoute(final UnsignedInteger routerId, final Long remotePathId) {
23 final RouteKey key = new RouteKey(routerId, remotePathId);
24 return removeRoute(key, getOffsets().offsetOf(key));
28 public MapEntryNode createValue(final YangInstanceIdentifier.PathArgument routeId, final BestPath path) {
29 return RouteEntryUtil.createSimpleRouteValue(routeId, path);
33 public int addRoute(final UnsignedInteger routerId, final Long remotePathId, final NodeIdentifier attII,
34 final NormalizedNode<?, ?> data) {
35 return addRoute(new RouteKey(routerId, remotePathId), attII, data);