Interface RIBSupport<C extends Routes & org.opendaylight.yangtools.yang.binding.DataObject & org.opendaylight.yangtools.yang.binding.ChoiceIn<Tables>,S extends org.opendaylight.yangtools.yang.binding.ChildOf<? super C>,R extends Route & org.opendaylight.yangtools.yang.binding.ChildOf<? super S> & org.opendaylight.yangtools.yang.binding.Identifiable<I>,I extends org.opendaylight.yangtools.yang.binding.Identifier<R>>
-
- All Known Implementing Classes:
AbstractFlowspecL3vpnRIBSupport
,AbstractFlowspecRIBSupport
,AbstractRIBSupport
,AbstractVpnRIBSupport
,FlowspecIpv4RIBSupport
,FlowspecIpv6RIBSupport
,FlowspecL3vpnIpv4RIBSupport
,FlowspecL3vpnIpv6RIBSupport
,L3VpnMcastIpv4RIBSupport
,L3VpnMcastIpv6RIBSupport
,LabeledUnicastIpv4RIBSupport
,LinkstateRIBSupport
,RouteTargetConstrainRIBSupport
,VpnIpv4RIBSupport
,VpnIpv6RIBSupport
public interface RIBSupport<C extends Routes & org.opendaylight.yangtools.yang.binding.DataObject & org.opendaylight.yangtools.yang.binding.ChoiceIn<Tables>,S extends org.opendaylight.yangtools.yang.binding.ChildOf<? super C>,R extends Route & org.opendaylight.yangtools.yang.binding.ChildOf<? super S> & org.opendaylight.yangtools.yang.binding.Identifiable<I>,I extends org.opendaylight.yangtools.yang.binding.Identifier<R>>
Interface implemented for AFI/SAFI-specific RIB extensions. The extensions need to register an implementation of this class and the RIB core then calls into it to inquire about details specific to that particular model.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
RIBSupport.ApplyRoute
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Attributes
attributeFromContainerNode(org.opendaylight.yangtools.yang.data.api.schema.ContainerNode advertisedAttrs)
Translates supplied YANG Instance Identifier and NormalizedNode into Binding data Attribute.org.opendaylight.yangtools.yang.data.api.schema.ContainerNode
attributeToContainerNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routePath, Attributes attributes)
Translates supplied Binding Instance Identifier and data into NormalizedNode representation.@NonNull Update
buildUpdate(@NonNull Collection<org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode> advertised, @NonNull Collection<org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode> withdrawn, @NonNull Attributes attr)
To send routes out, we'd need to transform the DOM representation of route to binding-aware format.default @NonNull com.google.common.collect.ImmutableCollection<Class<? extends org.opendaylight.yangtools.yang.binding.BindingObject>>
cacheableAttributeObjects()
default @NonNull com.google.common.collect.ImmutableCollection<Class<? extends org.opendaylight.yangtools.yang.binding.BindingObject>>
cacheableNlriObjects()
@NonNull Collection<org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode>
changedRoutes(@NonNull org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode routes)
Returns routes that were modified within this RIB support instance.@NonNull R
createRoute(@Nullable R route, @NonNull I key, @NonNull Attributes attributes)
Creates a route with new path Id and attributes.@NonNull org.opendaylight.yangtools.yang.binding.InstanceIdentifier<R>
createRouteIdentifier(@NonNull org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier<Tables,TablesKey> tableKey, @NonNull I newRouteKey)
Creates Route table Peer InstanceIdentifier.default @NonNull I
createRouteListKey(@NonNull String routeKey)
Construct a Route List Key.@NonNull I
createRouteListKey(@NonNull PathId pathId, @NonNull String routeKey)
Construct a Route List Key using new path Id for Families.void
deleteRoutes(@NonNull org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, @NonNull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri)
Given the NLRI as ContainerNode, this method should extract withdrawn routes from the DOM model and delete them from RIBs.void
deleteRoutes(@NonNull org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, @NonNull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routesNodeId)
Given the NLRI as ContainerNode, this method should extract withdrawn routes from the DOM model and delete them from RIBs.@NonNull S
emptyRoutesContainer()
Return the table-type-specific empty routes container, as augmented into the bgp-peer model under /peer/effect-rib-in/tables/routes choice node/routes container.@NonNull org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode
emptyTable()
Return the table-type-specific empty table with routes empty container, as augmented into the bgp-rib model under /rib/tables/routes choice node.@NonNull List<R>
extractAdjRibInRoutes(Routes routes)
Extract a route list from the adj-rib-in instantiation of table routes.@NonNull PathId
extractPathId(@NonNull I routeListKey)
Given a route list key, return the associated path ID.@NonNull String
extractRouteKey(@NonNull I routeListKey)
Given a route list key, return the associated path ID.R
fromNormalizedNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routerId, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode)
Translates supplied YANG Instance Identifier and NormalizedNode into Binding Route.@NonNull Class<? extends AddressFamily>
getAfi()
@NonNull Class<? extends SubsequentAddressFamily>
getSafi()
TablesKey
getTablesKey()
Returns TablesKey which we are providing support.Collection<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates>
putRoutes(@NonNull org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, @NonNull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri, @NonNull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode attributes)
Given the NLRI as ContainerNode, this method should extract advertised routes from the DOM model and put them into RIBs.Collection<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates>
putRoutes(@NonNull org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, @NonNull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri, @NonNull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode attributes, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routesNodeId)
Given the NLRI as ContainerNode, this method should extract advertised routes from the DOM model and put them into RIBs.@NonNull List<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument>
relativeRoutesPath()
Return the relative path from the generic routes container to the AFI/SAFI specific route list.@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier
routeAttributesIdentifier()
Return the localized identifier of the attributes route member, as expanded from the route grouping in the specific augmentation of the base routes choice.default @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier
routePath(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesPath, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument routeId)
Constructs an instance identifier path to routeId.@NonNull Class<C>
routesCaseClass()
Return class object of the Routes Case statement.@NonNull Class<S>
routesContainerClass()
Return class object of the Routes Container statement.@NonNull Class<R>
routesListClass()
Return class object of the Routes List statement.@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier
routesPath(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesPath)
Constructs an instance identifier path to routes list.
-
-
-
Method Detail
-
emptyTable
@NonNull org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode emptyTable()
Return the table-type-specific empty table with routes empty container, as augmented into the bgp-rib model under /rib/tables/routes choice node. This needs to include all the skeleton nodes under which the individual routes will be stored.- Returns:
- Protocol-specific case in the routes choice, may not be null.
-
routeAttributesIdentifier
@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routeAttributesIdentifier()
Return the localized identifier of the attributes route member, as expanded from the route grouping in the specific augmentation of the base routes choice.- Returns:
- The attributes identifier, may not be null.
-
routesCaseClass
@NonNull Class<C> routesCaseClass()
Return class object of the Routes Case statement.- Returns:
- Class
-
routesContainerClass
@NonNull Class<S> routesContainerClass()
Return class object of the Routes Container statement.- Returns:
- Class
-
routesListClass
@NonNull Class<R> routesListClass()
Return class object of the Routes List statement.- Returns:
- Class
-
cacheableAttributeObjects
default @NonNull com.google.common.collect.ImmutableCollection<Class<? extends org.opendaylight.yangtools.yang.binding.BindingObject>> cacheableAttributeObjects()
-
cacheableNlriObjects
default @NonNull com.google.common.collect.ImmutableCollection<Class<? extends org.opendaylight.yangtools.yang.binding.BindingObject>> cacheableNlriObjects()
-
deleteRoutes
void deleteRoutes(@NonNull org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, @NonNull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri)
Given the NLRI as ContainerNode, this method should extract withdrawn routes from the DOM model and delete them from RIBs.- Parameters:
tx
- DOMDataWriteTransactiontablePath
- YangInstanceIdentifiernlri
- ContainerNode DOM representation of NLRI in Update message
-
deleteRoutes
void deleteRoutes(@NonNull org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, @NonNull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routesNodeId)
Given the NLRI as ContainerNode, this method should extract withdrawn routes from the DOM model and delete them from RIBs.Use this method when removing routes stored in RIBs out of the "bgp-rib" module. Provide
YangInstanceIdentifier.NodeIdentifier
with customized "routes" QName. For default "bgp-rib" RIBs usedeleteRoutes(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)
- Parameters:
tx
- DOMDataWriteTransactiontablePath
- YangInstanceIdentifiernlri
- ContainerNode DOM representation of NLRI in Update messageroutesNodeId
- NodeIdentifier of "routes" data node
-
putRoutes
Collection<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates> putRoutes(@NonNull org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, @NonNull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri, @NonNull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode attributes)
Given the NLRI as ContainerNode, this method should extract advertised routes from the DOM model and put them into RIBs.- Parameters:
tx
- DOMDataWriteTransactiontablePath
- YangInstanceIdentifiernlri
- ContainerNode DOM representation of NLRI in Update messageattributes
- ContainerNode- Returns:
- List of processed route Identifiers
-
putRoutes
Collection<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates> putRoutes(@NonNull org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, @NonNull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri, @NonNull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode attributes, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routesNodeId)
Given the NLRI as ContainerNode, this method should extract advertised routes from the DOM model and put them into RIBs.Use this method when putting routes stored in RIBs out of the "bgp-rib" module. Provide
YangInstanceIdentifier.NodeIdentifier
with customized "routes" QName. For default "bgp-rib" RIBs useputRoutes(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)
- Parameters:
tx
- DOMDataWriteTransactiontablePath
- YangInstanceIdentifiernlri
- ContainerNode DOM representation of NLRI in Update messageattributes
- ContainerNoderoutesNodeId
- NodeIdentifier of "routes" data node- Returns:
- List of processed routes identifiers
-
changedRoutes
@NonNull Collection<org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode> changedRoutes(@NonNull org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode routes)
Returns routes that were modified within this RIB support instance.- Parameters:
routes
- DataTreeCandidateNode- Returns:
- collection of modified nodes or empty collection if no node was modified
-
routePath
default @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routePath(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesPath, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument routeId)
Constructs an instance identifier path to routeId.- Parameters:
routesPath
- YangInstanceIdentifier base pathrouteId
- PathArgument leaf path- Returns:
- YangInstanceIdentifier with routesPath + specific RIB support routes path + routeId
-
routesPath
@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesPath(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesPath)
Constructs an instance identifier path to routes list.- Parameters:
routesPath
- YangInstanceIdentifier base path- Returns:
- YangInstanceIdentifier with routesPath + specific RIB support routes path
-
relativeRoutesPath
@NonNull List<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument> relativeRoutesPath()
Return the relative path from the generic routes container to the AFI/SAFI specific route list.- Returns:
- Relative path.
-
buildUpdate
@NonNull Update buildUpdate(@NonNull Collection<org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode> advertised, @NonNull Collection<org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode> withdrawn, @NonNull Attributes attr)
To send routes out, we'd need to transform the DOM representation of route to binding-aware format. This needs to be done per each AFI/SAFI.- Parameters:
advertised
- Collection of advertised routes in DOM formatwithdrawn
- Collection of withdrawn routes in DOM formatattr
- Attributes MpReach is part of Attributes so we need to pass it as argument, create new AttributesBuilder with existing attributes and add MpReach- Returns:
- Update message ready to be sent out
-
getAfi
@NonNull Class<? extends AddressFamily> getAfi()
-
getSafi
@NonNull Class<? extends SubsequentAddressFamily> getSafi()
-
createRouteIdentifier
@NonNull org.opendaylight.yangtools.yang.binding.InstanceIdentifier<R> createRouteIdentifier(@NonNull org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier<Tables,TablesKey> tableKey, @NonNull I newRouteKey)
Creates Route table Peer InstanceIdentifier.- Parameters:
tableKey
- table InstanceIdentifiernewRouteKey
- route key- Returns:
- InstanceIdentifier
-
createRoute
@NonNull R createRoute(@Nullable R route, @NonNull I key, @NonNull Attributes attributes)
Creates a route with new path Id and attributes.- Parameters:
route
- routekey
- route keyattributes
- route attributes- Returns:
- Route List key
-
getTablesKey
TablesKey getTablesKey()
Returns TablesKey which we are providing support.- Returns:
- TablesKey
-
fromNormalizedNode
R fromNormalizedNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routerId, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode)
Translates supplied YANG Instance Identifier and NormalizedNode into Binding Route.- Parameters:
routerId
- Binding Instance IdentifiernormalizedNode
- NormalizedNode representing Route- Returns:
- Route
-
attributeFromContainerNode
Attributes attributeFromContainerNode(org.opendaylight.yangtools.yang.data.api.schema.ContainerNode advertisedAttrs)
Translates supplied YANG Instance Identifier and NormalizedNode into Binding data Attribute.- Parameters:
advertisedAttrs
- NormalizedNode representing attributes- Returns:
- Attribute
-
attributeToContainerNode
org.opendaylight.yangtools.yang.data.api.schema.ContainerNode attributeToContainerNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routePath, Attributes attributes)
Translates supplied Binding Instance Identifier and data into NormalizedNode representation.- Parameters:
routePath
- Binding Instance Identifier pointing to dataattributes
- Data object representing Attributes- Returns:
- NormalizedNode representation
-
emptyRoutesContainer
@NonNull S emptyRoutesContainer()
Return the table-type-specific empty routes container, as augmented into the bgp-peer model under /peer/effect-rib-in/tables/routes choice node/routes container. This needs to include all the skeleton nodes under which the individual routes will be stored.- Returns:
- Protocol-specific container in the routes, may not be null.
-
createRouteListKey
@NonNull I createRouteListKey(@NonNull PathId pathId, @NonNull String routeKey)
Construct a Route List Key using new path Id for Families.- Parameters:
pathId
- The path identifierrouteKey
- RouteKey- Returns:
- route list Key (RouteKey + pathId)
-
createRouteListKey
default @NonNull I createRouteListKey(@NonNull String routeKey)
Construct a Route List Key.- Parameters:
routeKey
- RouteKey- Returns:
- route list Key (RouteKey + empty pathId)
-
extractPathId
@NonNull PathId extractPathId(@NonNull I routeListKey)
Given a route list key, return the associated path ID.- Parameters:
routeListKey
- Route list key- Returns:
- Path ID
-
extractRouteKey
@NonNull String extractRouteKey(@NonNull I routeListKey)
Given a route list key, return the associated path ID.- Parameters:
routeListKey
- Route list key- Returns:
- RouteKey
-
-