Class AddPathAbstractRouteEntry<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>>
- java.lang.Object
-
- org.opendaylight.protocol.bgp.mode.impl.add.AddPathAbstractRouteEntry<C,S,R,I>
-
- All Implemented Interfaces:
RouteEntry<C,S,R,I>
public abstract class AddPathAbstractRouteEntry<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>> extends Object implements RouteEntry<C,S,R,I>
A single route entry inside a route table. Maintains the attributes from all contributing peers. The information is stored in arrays with a shared map of offsets for peers to allow lookups. This is needed to maintain low memory overhead in face of large number of routes and peers, where individual object overhead becomes the dominating factor.This class is NOT thread-safe.
-
-
Constructor Summary
Constructors Constructor Description AddPathAbstractRouteEntry()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description List<ActualBestPathRoutes<C,S,R,I>>
actualBestPaths(RIBSupport<C,S,R,I> ribSupport, RouteEntryInfo entryInfo)
Returns collections of present selected best path.int
addRoute(RouterId routerId, org.opendaylight.yangtools.yang.common.Uint32 remotePathId, R route)
Add Route.protected AddPathBestPath
bestPathAt(int offset)
List<AdvertizedRoute<C,S,R,I>>
newBestPaths(RIBSupport<C,S,R,I> ribSupport, String routeKey)
Returns collection of best path routes after processing update of stale and new advertisement of routes.protected void
processOffset(AddPathSelector selector, int offset)
Process a specific route offset into specified selector.boolean
removeRoute(RouterId routerId, org.opendaylight.yangtools.yang.common.Uint32 remotePathId)
Remove route.Optional<StaleBestPathRoute<C,S,R,I>>
removeStalePaths(RIBSupport<C,S,R,I> ribSupport, String routeKey)
Returns list of stale best path.boolean
selectBest(long localAs)
Indicates whether best has changed.protected abstract com.google.common.collect.ImmutableList<AddPathBestPath>
selectBest(long localAs, int size)
-
-
-
Method Detail
-
addRoute
public final int addRoute(RouterId routerId, org.opendaylight.yangtools.yang.common.Uint32 remotePathId, R route)
Description copied from interface:RouteEntry
Add Route.- Specified by:
addRoute
in interfaceRouteEntry<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>>
- Parameters:
routerId
- router ID in unsigned integer format from an Ipv4AddressremotePathId
- remote path Id receivedroute
- route Data change- Returns:
- returns the offset
-
removeRoute
public final boolean removeRoute(RouterId routerId, org.opendaylight.yangtools.yang.common.Uint32 remotePathId)
Description copied from interface:RouteEntry
Remove route.- Specified by:
removeRoute
in interfaceRouteEntry<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>>
- Parameters:
routerId
- router ID in unsigned integer format from an Ipv4AddressremotePathId
- remote path Id received- Returns:
- return true if it was the last route on entry
-
removeStalePaths
public final Optional<StaleBestPathRoute<C,S,R,I>> removeStalePaths(RIBSupport<C,S,R,I> ribSupport, String routeKey)
Description copied from interface:RouteEntry
Returns list of stale best path.- Specified by:
removeStalePaths
in interfaceRouteEntry<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>>
- Parameters:
ribSupport
- RIB SupportrouteKey
- of stale route- Returns:
- list containing list of stale best path
-
newBestPaths
public final List<AdvertizedRoute<C,S,R,I>> newBestPaths(RIBSupport<C,S,R,I> ribSupport, String routeKey)
Description copied from interface:RouteEntry
Returns collection of best path routes after processing update of stale and new advertisement of routes.- Specified by:
newBestPaths
in interfaceRouteEntry<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>>
- Parameters:
ribSupport
- RIB SupportrouteKey
- route key
-
actualBestPaths
public final List<ActualBestPathRoutes<C,S,R,I>> actualBestPaths(RIBSupport<C,S,R,I> ribSupport, RouteEntryInfo entryInfo)
Description copied from interface:RouteEntry
Returns collections of present selected best path.- Specified by:
actualBestPaths
in interfaceRouteEntry<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>>
- Parameters:
ribSupport
- RIB SupportentryInfo
- Route Entry Info wrapper
-
selectBest
public final boolean selectBest(long localAs)
Description copied from interface:RouteEntry
Indicates whether best has changed.- Specified by:
selectBest
in interfaceRouteEntry<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>>
- Parameters:
localAs
- The local autonomous system number- Returns:
- return true if it has changed
-
selectBest
protected abstract com.google.common.collect.ImmutableList<AddPathBestPath> selectBest(long localAs, int size)
-
processOffset
protected final void processOffset(AddPathSelector selector, int offset)
Process a specific route offset into specified selector.- Parameters:
selector
- selector to updateoffset
- offset to process
-
bestPathAt
protected final AddPathBestPath bestPathAt(int offset)
-
-