Merge "BUG-2383: implement EffectiveRibInWriter"
[bgpcep.git] / bgp / rib-spi / src / main / java / org / opendaylight / protocol / bgp / rib / spi / RIBSupport.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.spi;
9
10 import java.util.Collection;
11 import javax.annotation.Nonnull;
12 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
13 import org.opendaylight.yangtools.yang.binding.DataObject;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
17 import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode;
18 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
19 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
20
21 /**
22  * Interface implemented for AFI/SAFI-specific RIB extensions. The extensions need
23  * to register an implementation of this class and the RIB core then calls into it
24  * to inquire about details specific to that particular model.
25  */
26 public interface RIBSupport {
27     /**
28      * Return the table-type-specific empty routes container, as augmented into the
29      * bgp-rib model under /rib/tables/routes choice node. This needs to include all
30      * the skeleton nodes under which the individual routes will be stored.
31      *
32      * @return Protocol-specific case in the routes choice, may not be null.
33      */
34     @Nonnull ChoiceNode emptyRoutes();
35
36     /**
37      * Return the localized identifier of the attributes route member, as expanded
38      * from the route grouping in the specific augmentation of the base routes choice.
39      *
40      * @return The attributes identifier, may not be null.
41      */
42     @Nonnull NodeIdentifier routeAttributesIdentifier();
43
44     @Nonnull Collection<Class<? extends DataObject>> cacheableAttributeObjects();
45     @Nonnull Collection<Class<? extends DataObject>> cacheableNlriObjects();
46     void deleteRoutes(@Nonnull DOMDataWriteTransaction tx, @Nonnull YangInstanceIdentifier tablePath, @Nonnull ContainerNode nlri);
47     void putRoutes(@Nonnull DOMDataWriteTransaction tx, @Nonnull YangInstanceIdentifier tablePath, @Nonnull ContainerNode nlri, @Nonnull ContainerNode attributes);
48
49     @Nonnull Collection<DataTreeCandidateNode> changedRoutes(@Nonnull DataTreeCandidateNode routes);
50     @Nonnull YangInstanceIdentifier routePath(@Nonnull YangInstanceIdentifier routesPath, @Nonnull PathArgument routeId);
51 }