Class AbstractRIBSupport<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<?>>
- All Implemented Interfaces:
RIBSupport<C,
S>
- Direct Known Subclasses:
AbstractFlowspecRIBSupport
,AbstractVpnRIBSupport
,L3VpnMcastIpv4RIBSupport
,L3VpnMcastIpv6RIBSupport
,LabeledUnicastIpv4RIBSupport
,LinkstateRIBSupport
,RouteTargetConstrainRIBSupport
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opendaylight.protocol.bgp.rib.spi.RIBSupport
RIBSupport.ApplyRoute
-
Field Summary
Modifier and TypeFieldDescriptionprotected final org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer
static final String
protected final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractRIBSupport
(org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer mappingService, Class<C> cazeClass, Class<S> containerClass, Class<R> listClass, AddressFamily afiClass, SubsequentAddressFamily safiClass, org.opendaylight.yangtools.yang.common.QName destContainerQname) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionattributeFromContainerNode
(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 attPath, Attributes attributes) Translates supplied Binding Instance Identifier and data into NormalizedNode representation.protected abstract DestinationType
buildDestination
(Collection<org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode> routes) final Update
buildUpdate
(Collection<org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode> advertised, Collection<org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode> withdrawn, Attributes attr) To send routes out, we'd need to transform the DOM representation of route to binding-aware format.protected abstract DestinationType
buildWithdrawnDestination
(Collection<org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode> routes) final Collection<org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateNode>
changedRoutes
(org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateNode routes) Returns routes that were modified within this RIB support instance.final org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode
createRoute
(org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode route, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates key, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode attributes) Creates a route with new path Id and attributes.final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier
createRouteIdentifier
(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates newRouteKey) Creates Route table Peer InstanceIdentifier.final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates
createRouteListArgument
(org.opendaylight.yangtools.yang.common.Uint32 pathId, String routeKey) Construct a Route List Key using new path Id for Families.final void
deleteRoutes
(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, 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.final void
deleteRoutes
(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri, 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.final org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode
Return the table-type-specific empty table with routes empty container, as augmented into the bgp-rib model under /rib/tables/routes choice node.final org.opendaylight.yangtools.yang.data.api.schema.ContainerNode
extractAttributes
(org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode value) Extract attributes from an route entry.final org.opendaylight.yangtools.yang.common.Uint32
extractPathId
(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates routeListKey) Given a route list key, return the associated path ID.protected final String
extractPrefix
(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode route) protected final RouteDistinguisher
extractRouteDistinguisher
(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode route) final String
extractRouteKey
(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates routeListKey) Given a route list key, return the associated path ID.fromNormalizedNode
(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routePath, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode normalizedNode) Translates supplied YANG Instance Identifier and NormalizedNode into Binding Route.final AddressFamily
getAfi()
final SubsequentAddressFamily
getSafi()
final TablesKey
Returns TablesKey which we are providing support.protected final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier
protected abstract Collection<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates>
processDestination
(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesPath, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode destination, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode attributes, RIBSupport.ApplyRoute applyFunction) final Collection<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates>
putRoutes
(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri, 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.final Collection<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates>
putRoutes
(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode attributes, 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.final List<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument>
Return the relative path from the generic routes container to the AFI/SAFI specific route list.final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier
Return the localized identifier of the attributes route member, as expanded from the route grouping in the specific augmentation of the base routes choice.protected final org.opendaylight.yangtools.util.ImmutableOffsetMapTemplate<org.opendaylight.yangtools.yang.common.QName>
protected final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier
routeNid()
protected final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier
final org.opendaylight.yangtools.yang.common.QName
Return class object of the Routes Case statement.Return class object of the Routes Container statement.final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier
Return theYangInstanceIdentifier.NodeIdentifier
of the AFI/SAFI-specific container under the RIB routes.Return class object of the Routes List statement.final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier
routesPath
(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesTablePaths) Constructs an instance identifier path to routes list.protected final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier
routesYangInstanceIdentifier
(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesTablePaths) final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opendaylight.protocol.bgp.rib.spi.RIBSupport
cacheableAttributeObjects, cacheableNlriObjects, createRouteListArgument, routePath, toAddPathListArgument, toNonPathListArgument
-
Field Details
-
ROUTE_KEY
- See Also:
-
mappingService
protected final org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer mappingService -
routeDefaultYii
protected final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routeDefaultYii
-
-
Constructor Details
-
AbstractRIBSupport
protected AbstractRIBSupport(org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer mappingService, Class<C> cazeClass, Class<S> containerClass, Class<R> listClass, AddressFamily afiClass, SubsequentAddressFamily safiClass, org.opendaylight.yangtools.yang.common.QName destContainerQname) Default constructor. Requires the QName of the container augmented under the routes choice node in instantiations of the rib grouping. It is assumed that this container is defined by the same model which populates it with route grouping instantiation, and by extension with the route attributes container.- Parameters:
mappingService
- Serialization servicecazeClass
- Binding class of the AFI/SAFI-specific case statement, must not be nullcontainerClass
- Binding class of the container in routes choice, must not be null.listClass
- Binding class of the route list, nust not be null;afiClass
- address Family ClasssafiClass
- SubsequentAddressFamilydestContainerQname
- destination Container Qname
-
-
Method Details
-
getTablesKey
Description copied from interface:RIBSupport
Returns TablesKey which we are providing support.- Specified by:
getTablesKey
in interfaceRIBSupport<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>> - Returns:
- TablesKey
-
tablesKey
public final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates tablesKey() -
routesCaseClass
Description copied from interface:RIBSupport
Return class object of the Routes Case statement.- Specified by:
routesCaseClass
in interfaceRIBSupport<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>> - Returns:
- Class
-
routesContainerClass
Description copied from interface:RIBSupport
Return class object of the Routes Container statement.- Specified by:
routesContainerClass
in interfaceRIBSupport<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>> - Returns:
- Class
-
routesListClass
Description copied from interface:RIBSupport
Return class object of the Routes List statement.- Specified by:
routesListClass
in interfaceRIBSupport<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>> - Returns:
- Class
-
emptyTable
public final org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode emptyTable()Description copied from interface:RIBSupport
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.- Specified by:
emptyTable
in interfaceRIBSupport<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>> - Returns:
- Protocol-specific case in the routes choice, may not be null.
-
routeQName
public final org.opendaylight.yangtools.yang.common.QName routeQName() -
prefixNid
protected final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier prefixNid() -
routeNid
protected final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routeNid() -
getAfi
-
getSafi
-
buildDestination
protected abstract DestinationType buildDestination(Collection<org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode> routes) -
buildWithdrawnDestination
protected abstract DestinationType buildWithdrawnDestination(Collection<org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode> routes) -
routesContainerIdentifier
public final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routesContainerIdentifier()Return theYangInstanceIdentifier.NodeIdentifier
of the AFI/SAFI-specific container under the RIB routes.- Returns:
- Container identifier, may not be null.
-
processDestination
protected abstract Collection<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates> processDestination(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesPath, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode destination, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode attributes, RIBSupport.ApplyRoute applyFunction) -
routeAttributesIdentifier
public final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routeAttributesIdentifier()Description copied from interface:RIBSupport
Return the localized identifier of the attributes route member, as expanded from the route grouping in the specific augmentation of the base routes choice.- Specified by:
routeAttributesIdentifier
in interfaceRIBSupport<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>> - Returns:
- The attributes identifier, may not be null.
-
changedRoutes
public final Collection<org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateNode> changedRoutes(org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateNode routes) Description copied from interface:RIBSupport
Returns routes that were modified within this RIB support instance.- Specified by:
changedRoutes
in interfaceRIBSupport<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>> - Parameters:
routes
- DataTreeCandidateNode- Returns:
- collection of modified nodes or empty collection if no node was modified
-
routesPath
public final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesPath(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesTablePaths) Description copied from interface:RIBSupport
Constructs an instance identifier path to routes list.- Specified by:
routesPath
in interfaceRIBSupport<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>> - Parameters:
routesTablePaths
- YangInstanceIdentifier base path- Returns:
- YangInstanceIdentifier with routesPath + specific RIB support routes path
-
relativeRoutesPath
public final List<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument> relativeRoutesPath()Description copied from interface:RIBSupport
Return the relative path from the generic routes container to the AFI/SAFI specific route list.- Specified by:
relativeRoutesPath
in interfaceRIBSupport<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>> - Returns:
- Relative path.
-
createRouteIdentifier
public final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier createRouteIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates newRouteKey) Description copied from interface:RIBSupport
Creates Route table Peer InstanceIdentifier.- Specified by:
createRouteIdentifier
in interfaceRIBSupport<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>> - Parameters:
tablePath
- table InstanceIdentifiernewRouteKey
- route key- Returns:
- InstanceIdentifier
-
createRoute
public final org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode createRoute(org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode route, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates key, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode attributes) Description copied from interface:RIBSupport
Creates a route with new path Id and attributes.- Specified by:
createRoute
in interfaceRIBSupport<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>> - Parameters:
route
- routekey
- route keyattributes
- route attributes- Returns:
- Route List key
-
createRouteListArgument
public final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates createRouteListArgument(org.opendaylight.yangtools.yang.common.Uint32 pathId, String routeKey) Description copied from interface:RIBSupport
Construct a Route List Key using new path Id for Families.- Specified by:
createRouteListArgument
in interfaceRIBSupport<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>> - Parameters:
pathId
- The path identifierrouteKey
- RouteKey- Returns:
- route list Key (RouteKey + pathId)
-
deleteRoutes
public final void deleteRoutes(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri) Description copied from interface:RIBSupport
Given the NLRI as ContainerNode, this method should extract withdrawn routes from the DOM model and delete them from RIBs.- Specified by:
deleteRoutes
in interfaceRIBSupport<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>> - Parameters:
tx
- DOMDataWriteTransactiontablePath
- YangInstanceIdentifiernlri
- ContainerNode DOM representation of NLRI in Update message
-
deleteRoutes
public final void deleteRoutes(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routesNodeId) Description copied from interface:RIBSupport
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 useRIBSupport.deleteRoutes(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)
- Specified by:
deleteRoutes
in interfaceRIBSupport<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>> - Parameters:
tx
- DOMDataWriteTransactiontablePath
- YangInstanceIdentifiernlri
- ContainerNode DOM representation of NLRI in Update messageroutesNodeId
- NodeIdentifier of "routes" data node
-
putRoutes
public final Collection<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates> putRoutes(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode attributes) Description copied from interface:RIBSupport
Given the NLRI as ContainerNode, this method should extract advertised routes from the DOM model and put them into RIBs.- Specified by:
putRoutes
in interfaceRIBSupport<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>> - Parameters:
tx
- DOMDataWriteTransactiontablePath
- YangInstanceIdentifiernlri
- ContainerNode DOM representation of NLRI in Update messageattributes
- ContainerNode- Returns:
- List of processed route Identifiers
-
putRoutes
public final Collection<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates> putRoutes(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction tx, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode attributes, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routesNodeId) Description copied from interface:RIBSupport
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 useRIBSupport.putRoutes(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)
- Specified by:
putRoutes
in interfaceRIBSupport<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>> - Parameters:
tx
- DOMDataWriteTransactiontablePath
- YangInstanceIdentifiernlri
- ContainerNode DOM representation of NLRI in Update messageattributes
- ContainerNoderoutesNodeId
- NodeIdentifier of "routes" data node- Returns:
- List of processed routes identifiers
-
buildUpdate
public final Update buildUpdate(Collection<org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode> advertised, Collection<org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode> withdrawn, Attributes attr) Description copied from interface:RIBSupport
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.- Specified by:
buildUpdate
in interfaceRIBSupport<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>> - 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
-
routePathIdNid
protected final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routePathIdNid() -
routeKeyTemplate
protected final org.opendaylight.yangtools.util.ImmutableOffsetMapTemplate<org.opendaylight.yangtools.yang.common.QName> routeKeyTemplate() -
extractPrefix
protected final String extractPrefix(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode route) -
extractRouteDistinguisher
protected final RouteDistinguisher extractRouteDistinguisher(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode route) -
routesYangInstanceIdentifier
protected final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesYangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesTablePaths) -
fromNormalizedNode
public R fromNormalizedNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routePath, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode normalizedNode) Description copied from interface:RIBSupport
Translates supplied YANG Instance Identifier and NormalizedNode into Binding Route.- Specified by:
fromNormalizedNode
in interfaceRIBSupport<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>> - Parameters:
routePath
- Binding Instance IdentifiernormalizedNode
- NormalizedNode representing Route- Returns:
- Route
-
attributeFromContainerNode
public Attributes attributeFromContainerNode(org.opendaylight.yangtools.yang.data.api.schema.ContainerNode advertisedAttrs) Description copied from interface:RIBSupport
Translates supplied YANG Instance Identifier and NormalizedNode into Binding data Attribute.- Specified by:
attributeFromContainerNode
in interfaceRIBSupport<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>> - Parameters:
advertisedAttrs
- NormalizedNode representing attributes- Returns:
- Attribute
-
attributeToContainerNode
public org.opendaylight.yangtools.yang.data.api.schema.ContainerNode attributeToContainerNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier attPath, Attributes attributes) Description copied from interface:RIBSupport
Translates supplied Binding Instance Identifier and data into NormalizedNode representation.- Specified by:
attributeToContainerNode
in interfaceRIBSupport<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>> - Parameters:
attPath
- Binding Instance Identifier pointing to dataattributes
- Data object representing Attributes- Returns:
- NormalizedNode representation
-
extractRouteKey
public final String extractRouteKey(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates routeListKey) Description copied from interface:RIBSupport
Given a route list key, return the associated path ID.- Specified by:
extractRouteKey
in interfaceRIBSupport<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>> - Parameters:
routeListKey
- Route list key- Returns:
- RouteKey
-
extractPathId
public final org.opendaylight.yangtools.yang.common.Uint32 extractPathId(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates routeListKey) Description copied from interface:RIBSupport
Given a route list key, return the associated path ID.- Specified by:
extractPathId
in interfaceRIBSupport<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>> - Parameters:
routeListKey
- Route list key- Returns:
- Path ID
-
extractAttributes
public final org.opendaylight.yangtools.yang.data.api.schema.ContainerNode extractAttributes(org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode value) Description copied from interface:RIBSupport
Extract attributes from an route entry.- Specified by:
extractAttributes
in interfaceRIBSupport<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>> - Parameters:
value
- Route entry- Returns:
- Associated attributes, potentially null
-