MVPN RFC6514 Extendend communities
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / spi / RIBSupportContext.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.protocol.bgp.rib.impl.spi;
9
10 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
11 import org.opendaylight.protocol.bgp.rib.spi.RIBSupport;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.MpReachNlri;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.MpUnreachNlri;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
16
17 /**
18  *
19  * {@link RIBSupport} wrapper which provides additional functionality
20  * such as logic to update / remove routes using Binding DTOs
21  * for BGP messages.
22  *
23  */
24 public abstract class RIBSupportContext {
25
26     /**
27      *
28      * Create specified Rib table structure using supplied transaction.
29      *
30      * @param tx Transaction to to be used
31      * @param tableId Instance Identifier of table to be cleared.
32      */
33     public abstract void createEmptyTableStructure(DOMDataWriteTransaction tx, YangInstanceIdentifier tableId);
34
35     /**
36      * Removes supplied routes from RIB table using supplied transaction.
37      *
38      * @param tx Transaction to be used
39      * @param tableId Instance Identifier of table to be updated
40      * @param nlri UnreachNlri which contains routes to be removed.
41      */
42     public abstract void deleteRoutes(DOMDataWriteTransaction tx, YangInstanceIdentifier tableId, MpUnreachNlri nlri);
43
44     /**
45      *
46      * Writes supplied routes and attributes to RIB table using supplied transaction.
47      *
48      *
49      * @param tx Transaction to be used
50      * @param tableId Instance Identifier of table to be updated
51      * @param nlri ReachNlri which contains routes to be written.
52      * @param attributes Attributes which should be written.
53      */
54     public abstract void writeRoutes(DOMDataWriteTransaction tx, YangInstanceIdentifier tableId, MpReachNlri nlri,
55             Attributes attributes);
56
57     /**
58      * Returns backing RIB support.
59      *
60      * @return RIBSupport
61      */
62     public abstract RIBSupport getRibSupport();
63 }