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.rev200120.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.rib.Tables;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes;
18 import org.opendaylight.yangtools.yang.binding.ChildOf;
19 import org.opendaylight.yangtools.yang.binding.ChoiceIn;
20 import org.opendaylight.yangtools.yang.binding.DataObject;
21 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
22 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
25 * {@link RIBSupport} wrapper which provides additional functionality
26 * such as logic to update / remove routes using Binding DTOs
29 public abstract class RIBSupportContext {
31 * Create specified Rib table structure using supplied transaction.
33 * @param tx Transaction to to be used
34 * @param tableId Instance Identifier of table to be cleared.
36 public abstract void createEmptyTableStructure(DOMDataTreeWriteTransaction tx, YangInstanceIdentifier tableId);
39 * Removes supplied routes from RIB table using supplied transaction.
41 * @param tx Transaction to be used
42 * @param tableId Instance Identifier of table to be updated
43 * @param nlri UnreachNlri which contains routes to be removed.
45 public abstract void deleteRoutes(DOMDataTreeWriteTransaction tx, YangInstanceIdentifier tableId,
49 * Writes supplied routes and attributes to RIB table using supplied transaction.
51 * @param tx Transaction to be used
52 * @param tableId Instance Identifier of table to be updated
53 * @param nlri ReachNlri which contains routes to be written.
54 * @param attributes Attributes which should be written.
55 * @return Set of processed route key identifiers
57 public abstract Collection<NodeIdentifierWithPredicates> writeRoutes(DOMDataTreeWriteTransaction tx,
58 YangInstanceIdentifier tableId,
60 Attributes attributes);
63 * Returns backing RIB support.
67 public abstract <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<? super C>>
68 RIBSupport<C, S> getRibSupport();