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.rib.impl.spi;
10 import java.util.Collection;
11 import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
12 import org.opendaylight.protocol.bgp.rib.spi.RIBSupport;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.MpReachNlri;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.MpUnreachNlri;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.Tables;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes;
19 import org.opendaylight.yangtools.yang.binding.ChildOf;
20 import org.opendaylight.yangtools.yang.binding.ChoiceIn;
21 import org.opendaylight.yangtools.yang.binding.DataObject;
22 import org.opendaylight.yangtools.yang.binding.Identifiable;
23 import org.opendaylight.yangtools.yang.binding.Identifier;
24 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
25 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
28 * {@link RIBSupport} wrapper which provides additional functionality
29 * such as logic to update / remove routes using Binding DTOs
32 public abstract class RIBSupportContext {
34 * Create specified Rib table structure using supplied transaction.
36 * @param tx Transaction to to be used
37 * @param tableId Instance Identifier of table to be cleared.
39 public abstract void createEmptyTableStructure(DOMDataTreeWriteTransaction tx, YangInstanceIdentifier tableId);
42 * Removes supplied routes from RIB table using supplied transaction.
44 * @param tx Transaction to be used
45 * @param tableId Instance Identifier of table to be updated
46 * @param nlri UnreachNlri which contains routes to be removed.
48 public abstract void deleteRoutes(DOMDataTreeWriteTransaction tx, YangInstanceIdentifier tableId,
52 * Writes supplied routes and attributes to RIB table using supplied transaction.
54 * @param tx Transaction to be used
55 * @param tableId Instance Identifier of table to be updated
56 * @param nlri ReachNlri which contains routes to be written.
57 * @param attributes Attributes which should be written.
58 * @return Set of processed route key identifiers
60 public abstract Collection<NodeIdentifierWithPredicates> writeRoutes(DOMDataTreeWriteTransaction tx,
61 YangInstanceIdentifier tableId,
63 Attributes attributes);
66 * Returns backing RIB support.
70 public abstract <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<? super C>,
71 R extends Route & ChildOf<? super S> & Identifiable<I>, I extends Identifier<R>>
72 RIBSupport<C, S, R, I> getRibSupport();