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.rib.spi;
11 import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
13 import javax.annotation.Nullable;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
15 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
18 * Interface implemented to be extended by RibSupport.
19 * This interface exposes methods to access to Add Path information
20 * By default we implement non supported Multiple Path therefore
21 * 0 Path Id is returned and null PathArgument
23 interface AddPathRibSupport {
25 * Extract PathId from route change received
27 * @param normalizedNode Path Id Container
28 * @return pathId The path identifier value
30 default Long extractPathId(NormalizedNode<?, ?> normalizedNode) {
35 * Construct a PathArgument to an AddPathRoute
37 * @param pathId The path identifier
38 * @param routeId PathArgument leaf path
39 * @return routeId PathArgument + pathId or Null in case Add-path is not supported
41 @Nullable default PathArgument getRouteIdAddPath(long pathId, PathArgument routeId) {