import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.PathId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.Update;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.Route;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.Tables;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.TablesKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev171207.rib.tables.Routes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.Tables;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.AddressFamily;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.SubsequentAddressFamily;
import org.opendaylight.yangtools.yang.binding.DataObject;
* @return collection of modified nodes or empty collection if no node was modified
*/
@Nonnull
- Collection<DataTreeCandidateNode> changedDOMRoutes(@Nonnull DataTreeCandidateNode routes);
+ Collection<DataTreeCandidateNode> changedRoutes(@Nonnull DataTreeCandidateNode routes);
/**
* Constructs an instance identifier path to routeId.
* only have their key and attributes, complex routes are those which include more structured data.
*
* @return True if this is a complex route, false otherwise.
+ * @deprecated All routes are complex.
*/
+ @Deprecated
boolean isComplexRoute();
/**
* @return Update message ready to be sent out
*/
@Nonnull
- Update buildUpdate(@Nonnull Collection<MapEntryNode> advertised,
- @Nonnull Collection<MapEntryNode> withdrawn, @Nonnull Attributes attr);
+ Update buildUpdate(
+ @Nonnull Collection<MapEntryNode> advertised,
+ @Nonnull Collection<MapEntryNode> withdrawn,
+ @Nonnull Attributes attr);
@Nonnull
Class<? extends AddressFamily> getAfi();
Class<? extends SubsequentAddressFamily> getSafi();
/**
- * Creates Route Rib out Peer InstanceIdentifier.
+ * Creates Route table Peer InstanceIdentifier.
*
- * @param ribOutIId table InstanceIdentifier
+ * @param tableKey table InstanceIdentifier
* @param newRouteKey route key
* @return InstanceIdentifier
*/
@Nonnull
- InstanceIdentifier<R> createRouteIId(
- @Nonnull KeyedInstanceIdentifier<Tables, TablesKey> ribOutIId,
+ InstanceIdentifier<R> createRouteIdentifier(
+ @Nonnull KeyedInstanceIdentifier<Tables, TablesKey> tableKey,
@Nonnull N newRouteKey);
- @Nonnull
- R createRoute(@Nullable R route, N routeKey, @Nullable PathId pathId, @Nonnull Attributes attributes);
-
/**
- * Construct a PathArgument to an AddPathRoute.
+ * Creates a route with new path Id and attributes.
*
- * @param pathId The path identifier
- * @param routeKey RouteKey
- * @return routeId PathArgument + pathId or Null in case Add-path is not supported
+ * @param route route
+ * @param routeKey route key
+ * @param pathId new path Id
+ * @param attributes route attributes
+ * @return Route List key
*/
- @Nullable
- default Identifier createNewRouteKey(@Nonnull PathId pathId, @Nonnull N routeKey) {
- return null;
- }
+ @Nonnull
+ R createRoute(@Nullable R route, String routeKey, @Nullable long pathId, @Nonnull Attributes attributes);
interface ApplyRoute {
void apply(@Nonnull DOMDataWriteTransaction tx, @Nonnull YangInstanceIdentifier base,
@Nonnull NodeIdentifierWithPredicates routeKey,
@Nonnull DataContainerNode<?> route, ContainerNode attributes);
}
+
+ /**
+ * Return the table-type-specific empty routes container, as augmented into the
+ * bgp-peer model under /peer/effect-rib-in/tables/routes choice node. This needs to include all
+ * the skeleton nodes under which the individual routes will be stored.
+ *
+ * @return Protocol-specific case in the routes choice, may not be null.
+ */
+ @Nonnull
+ Routes emptyRoutesContainer();
+
+
+ /**
+ * Construct a Route List Key using new path Id for Families.
+ *
+ * @param pathId The path identifier
+ * @param routeKey RouteKey
+ * @return route list Key (RouteKey + pathId)
+ */
+ @Nonnull
+ N createRouteListKey(@Nonnull long pathId, @Nonnull String routeKey);
}