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

    • 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
      @NonNull Attributes attributeFromContainerNode​(org.opendaylight.yangtools.yang.data.api.schema.ContainerNode advertisedAttrs)
      Translates supplied YANG Instance Identifier and NormalizedNode into Binding data Attribute.
      @NonNull 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 org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode createRoute​(@Nullable org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode route, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates key, @NonNull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode attributes)
      Creates a route with new path Id and attributes.
      @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier createRouteIdentifier​(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates newRouteKey)
      Creates Route table Peer InstanceIdentifier.
      default @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates createRouteListArgument​(@NonNull String routeKey)
      Construct a Route List Key.
      @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates createRouteListArgument​(@NonNull org.opendaylight.yangtools.yang.common.Uint32 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 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.
      @Nullable org.opendaylight.yangtools.yang.data.api.schema.ContainerNode extractAttributes​(@NonNull org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode route)
      Extract attributes from an route entry.
      @NonNull org.opendaylight.yangtools.yang.common.Uint32 extractPathId​(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates routeListKey)
      Given a route list key, return the associated path ID.
      @NonNull String extractRouteKey​(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates routeListKey)
      Given a route list key, return the associated path ID.
      Route 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()  
      @NonNull 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<? extends Route> 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.
      @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates tablesKey()  
      default @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates toAddPathListArgument​(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates routeListKey)  
      default @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates toNonPathListArgument​(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates routeListKey)  
    • 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<? extends Route> 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 - DOMDataWriteTransaction
        tablePath - YangInstanceIdentifier
        nlri - 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 use deleteRoutes(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)

        Parameters:
        tx - DOMDataWriteTransaction
        tablePath - YangInstanceIdentifier
        nlri - ContainerNode DOM representation of NLRI in Update message
        routesNodeId - 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 - DOMDataWriteTransaction
        tablePath - YangInstanceIdentifier
        nlri - ContainerNode DOM representation of NLRI in Update message
        attributes - 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 use 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)

        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
      • 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 path
        routeId - 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 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
      • createRouteIdentifier

        @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier createRouteIdentifier​(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath,
                                                                                                       @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates newRouteKey)
        Creates Route table Peer InstanceIdentifier.
        Parameters:
        tablePath - table InstanceIdentifier
        newRouteKey - route key
        Returns:
        InstanceIdentifier
      • createRoute

        @NonNull org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode createRoute​(@Nullable org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode route,
                                                                                          @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates key,
                                                                                          @NonNull org.opendaylight.yangtools.yang.data.api.schema.ContainerNode attributes)
        Creates a route with new path Id and attributes.
        Parameters:
        route - route
        key - route key
        attributes - route attributes
        Returns:
        Route List key
      • getTablesKey

        @NonNull TablesKey getTablesKey()
        Returns TablesKey which we are providing support.
        Returns:
        TablesKey
      • tablesKey

        @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates tablesKey()
      • fromNormalizedNode

        Route 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 Identifier
        normalizedNode - NormalizedNode representing Route
        Returns:
        Route
      • attributeFromContainerNode

        @NonNull 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

        @NonNull 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 data
        attributes - Data object representing Attributes
        Returns:
        NormalizedNode representation
      • createRouteListArgument

        @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates createRouteListArgument​(@NonNull org.opendaylight.yangtools.yang.common.Uint32 pathId,
                                                                                                                                      @NonNull String routeKey)
        Construct a Route List Key using new path Id for Families.
        Parameters:
        pathId - The path identifier
        routeKey - RouteKey
        Returns:
        route list Key (RouteKey + pathId)
      • createRouteListArgument

        default @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates createRouteListArgument​(@NonNull String routeKey)
        Construct a Route List Key.
        Parameters:
        routeKey - RouteKey
        Returns:
        route list Key (RouteKey + empty pathId)
      • toAddPathListArgument

        default @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates toAddPathListArgument​(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates routeListKey)
      • toNonPathListArgument

        default @NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates toNonPathListArgument​(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates routeListKey)
      • extractPathId

        @NonNull org.opendaylight.yangtools.yang.common.Uint32 extractPathId​(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates routeListKey)
        Given a route list key, return the associated path ID.
        Parameters:
        routeListKey - Route list key
        Returns:
        Path ID
      • extractRouteKey

        @NonNull String extractRouteKey​(@NonNull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates routeListKey)
        Given a route list key, return the associated path ID.
        Parameters:
        routeListKey - Route list key
        Returns:
        RouteKey
      • extractAttributes

        @Nullable org.opendaylight.yangtools.yang.data.api.schema.ContainerNode extractAttributes​(@NonNull org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode route)
        Extract attributes from an route entry.
        Parameters:
        route - Route entry
        Returns:
        Associated attributes, potentially null
        Throws:
        NullPointerException - if route is null