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<?>>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer mappingService  
      static String ROUTE_KEY  
      protected org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routeDefaultYii  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractRIBSupport​(org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer mappingService, Class<C> cazeClass, Class<S> containerClass, Class<R> listClass, Class<? extends AddressFamily> afiClass, Class<? extends SubsequentAddressFamily> safiClass, org.opendaylight.yangtools.yang.common.QName destContainerQname)
      Default constructor.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete 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 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)  
      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)  
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      org.opendaylight.yangtools.yang.data.api.schema.ContainerNode extractAttributes​(org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode value)
      Extract attributes from an route entry.
      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 String extractPrefix​(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode route)  
      protected RouteDistinguisher extractRouteDistinguisher​(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode route)  
      String extractRouteKey​(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates routeListKey)
      Given a route list key, return the associated path ID.
      R 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.
      Class<? extends AddressFamily> getAfi()  
      Class<? extends SubsequentAddressFamily> getSafi()  
      TablesKey getTablesKey()
      Returns TablesKey which we are providing support.
      protected org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier prefixNid()  
      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)  
      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.
      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.
      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.
      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.
      protected org.opendaylight.yangtools.util.ImmutableOffsetMapTemplate<org.opendaylight.yangtools.yang.common.QName> routeKeyTemplate()  
      protected org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routeNid()  
      protected org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routePathIdNid()  
      org.opendaylight.yangtools.yang.common.QName routeQName()  
      Class<C> routesCaseClass()
      Return class object of the Routes Case statement.
      Class<S> routesContainerClass()
      Return class object of the Routes Container statement.
      org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routesContainerIdentifier()
      Return the YangInstanceIdentifier.NodeIdentifier of the AFI/SAFI-specific container under the RIB routes.
      Class<R> routesListClass()
      Return class object of the Routes List statement.
      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 org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesYangInstanceIdentifier​(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesTablePaths)  
      org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates tablesKey()  
    • Field Detail

      • mappingService

        protected final org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer mappingService
      • routeDefaultYii

        protected final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routeDefaultYii
    • Constructor Detail

      • AbstractRIBSupport

        protected AbstractRIBSupport​(org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer mappingService,
                                     Class<C> cazeClass,
                                     Class<S> containerClass,
                                     Class<R> listClass,
                                     Class<? extends AddressFamily> afiClass,
                                     Class<? extends 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 service
        cazeClass - Binding class of the AFI/SAFI-specific case statement, must not be null
        containerClass - 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 Class
        safiClass - SubsequentAddressFamily
        destContainerQname - destination Container Qname
    • Method Detail

      • getTablesKey

        public final TablesKey getTablesKey()
        Description copied from interface: RIBSupport
        Returns TablesKey which we are providing support.
        Specified by:
        getTablesKey in 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>>
        Returns:
        TablesKey
      • tablesKey

        public final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates tablesKey()
        Specified by:
        tablesKey in 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>>
      • routesCaseClass

        public final Class<C> routesCaseClass()
        Description copied from interface: RIBSupport
        Return class object of the Routes Case statement.
        Specified by:
        routesCaseClass in 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>>
        Returns:
        Class
      • routesContainerClass

        public final Class<S> routesContainerClass()
        Description copied from interface: RIBSupport
        Return class object of the Routes Container statement.
        Specified by:
        routesContainerClass in 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>>
        Returns:
        Class
      • routesListClass

        public final Class<R> routesListClass()
        Description copied from interface: RIBSupport
        Return class object of the Routes List statement.
        Specified by:
        routesListClass in 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>>
        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 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>>
        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

        public final Class<? extends AddressFamily> getAfi()
        Specified by:
        getAfi in 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>>
      • getSafi

        public final Class<? extends SubsequentAddressFamily> getSafi()
        Specified by:
        getSafi in 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>>
      • 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 the YangInstanceIdentifier.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 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>>
        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 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>>
        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 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>>
        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 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>>
        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 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>>
        Parameters:
        tablePath - table InstanceIdentifier
        newRouteKey - 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 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>>
        Parameters:
        route - route
        key - route key
        attributes - 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 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>>
        Parameters:
        pathId - The path identifier
        routeKey - 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 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>>
        Parameters:
        tx - DOMDataWriteTransaction
        tablePath - YangInstanceIdentifier
        nlri - 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 use RIBSupport.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 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>>
        Parameters:
        tx - DOMDataWriteTransaction
        tablePath - YangInstanceIdentifier
        nlri - ContainerNode DOM representation of NLRI in Update message
        routesNodeId - 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 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>>
        Parameters:
        tx - DOMDataWriteTransaction
        tablePath - YangInstanceIdentifier
        nlri - ContainerNode DOM representation of NLRI in Update message
        attributes - 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 use RIBSupport.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 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>>
        Parameters:
        tx - DOMDataWriteTransaction
        tablePath - YangInstanceIdentifier
        nlri - ContainerNode DOM representation of NLRI in Update message
        attributes - ContainerNode
        routesNodeId - 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 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>>
        Parameters:
        advertised - Collection of advertised routes in DOM format
        withdrawn - Collection of withdrawn routes in DOM format
        attr - 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 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>>
        Parameters:
        routePath - Binding Instance Identifier
        normalizedNode - 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 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>>
        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 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>>
        Parameters:
        attPath - Binding Instance Identifier pointing to data
        attributes - 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 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>>
        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 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>>
        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 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>>
        Parameters:
        value - Route entry
        Returns:
        Associated attributes, potentially null