@Beta public abstract class AbstractRIBSupport extends Object implements RIBSupport
RIBSupport.ApplyRoute
Modifier | Constructor and Description |
---|---|
protected |
AbstractRIBSupport(Class<? extends Routes> cazeClass,
Class<? extends org.opendaylight.yangtools.yang.binding.DataObject> containerClass,
Class<? extends Route> listClass,
Class<? extends AddressFamily> afiClass,
Class<? extends SubsequentAddressFamily> safiClass,
org.opendaylight.yangtools.yang.common.QName destinationQname)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
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.api.schema.tree.DataTreeCandidateNode> |
changedRoutes(org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode routes)
Returns routes that were modified within this RIB support instance.
|
default org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument |
createRouteKeyPathArgument(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument routeKeyPathArgument)
Create a new Path Argument for route Key removing remove Path Id from key
For non extension which doesnt support Multiple Path this step is not required
|
void |
deleteRoutes(org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction 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.controller.md.sal.dom.api.DOMDataWriteTransaction 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.ChoiceNode |
emptyRoutes()
Return the table-type-specific empty routes container, as augmented into the
bgp-rib model under /rib/tables/routes choice node.
|
default Long |
extractPathId(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode)
Extract PathId from route change received
|
Class<? extends AddressFamily> |
getAfi() |
default org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument |
getRouteIdAddPath(long pathId,
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument routeId)
Construct a PathArgument to an AddPathRoute
|
Class<? extends SubsequentAddressFamily> |
getSafi() |
protected abstract void |
processDestination(org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction 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) |
void |
putRoutes(org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction 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.
|
void |
putRoutes(org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction 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.
|
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.yang.data.api.YangInstanceIdentifier.NodeIdentifier |
routeNid() |
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier |
routePath(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesPath,
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument routeId)
Constructs an instance identifier path to routeId.
|
org.opendaylight.yangtools.yang.common.QName |
routeQName() |
Class<? extends Routes> |
routesCaseClass()
Return class object of the Routes Case statement.
|
Class<? extends org.opendaylight.yangtools.yang.binding.DataObject> |
routesContainerClass()
Return class object of the Routes Container statement.
|
protected org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier |
routesContainerIdentifier()
Return the
YangInstanceIdentifier.NodeIdentifier of the AFI/SAFI-specific container under
the RIB routes. |
Class<? extends Route> |
routesListClass()
Return class object of the Routes List statement.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cacheableAttributeObjects, cacheableNlriObjects, isComplexRoute
protected AbstractRIBSupport(Class<? extends Routes> cazeClass, Class<? extends org.opendaylight.yangtools.yang.binding.DataObject> containerClass, Class<? extends Route> listClass, Class<? extends AddressFamily> afiClass, Class<? extends SubsequentAddressFamily> safiClass, org.opendaylight.yangtools.yang.common.QName destinationQname)
cazeClass
- 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
- SubsequentAddressFamilydestinationQname
- destination Qname@Nonnull public final Class<? extends Routes> routesCaseClass()
RIBSupport
routesCaseClass
in interface RIBSupport
@Nonnull public final Class<? extends org.opendaylight.yangtools.yang.binding.DataObject> routesContainerClass()
RIBSupport
routesContainerClass
in interface RIBSupport
@Nonnull public final Class<? extends Route> routesListClass()
RIBSupport
routesListClass
in interface RIBSupport
@Nonnull public final org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode emptyRoutes()
RIBSupport
emptyRoutes
in interface RIBSupport
public final org.opendaylight.yangtools.yang.common.QName routeQName()
protected final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routeNid()
@Nonnull public final Class<? extends AddressFamily> getAfi()
getAfi
in interface RIBSupport
@Nonnull public final Class<? extends SubsequentAddressFamily> getSafi()
getSafi
in interface RIBSupport
@Nonnull protected abstract DestinationType buildDestination(@Nonnull Collection<org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode> routes)
@Nonnull protected abstract DestinationType buildWithdrawnDestination(@Nonnull Collection<org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode> routes)
protected final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routesContainerIdentifier()
YangInstanceIdentifier.NodeIdentifier
of the AFI/SAFI-specific container under
the RIB routes.protected abstract void processDestination(org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction 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)
public final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier routeAttributesIdentifier()
RIBSupport
routeAttributesIdentifier
in interface RIBSupport
public final Collection<org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode> changedRoutes(org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode routes)
RIBSupport
changedRoutes
in interface RIBSupport
routes
- DataTreeCandidateNodepublic final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routePath(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier routesPath, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument routeId)
RIBSupport
routePath
in interface RIBSupport
routesPath
- YangInstanceIdentifier base pathrouteId
- PathArgument leaf pathpublic final void deleteRoutes(org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction tx, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier tablePath, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode nlri)
RIBSupport
deleteRoutes
in interface RIBSupport
tx
- DOMDataWriteTransactiontablePath
- YangInstanceIdentifiernlri
- ContainerNode DOM representation of NLRI in Update messagepublic final void putRoutes(org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction 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)
RIBSupport
putRoutes
in interface RIBSupport
tx
- DOMDataWriteTransactiontablePath
- YangInstanceIdentifiernlri
- ContainerNode DOM representation of NLRI in Update messageattributes
- ContainerNode@Nonnull 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)
RIBSupport
buildUpdate
in interface RIBSupport
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 MpReachpublic final void deleteRoutes(org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction 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)
RIBSupport
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.controller.md.sal.dom.api.DOMDataWriteTransaction, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)
deleteRoutes
in interface RIBSupport
tx
- DOMDataWriteTransactiontablePath
- YangInstanceIdentifiernlri
- ContainerNode DOM representation of NLRI in Update messageroutesNodeId
- NodeIdentifier of "routes" data nodepublic final void putRoutes(org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction 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)
RIBSupport
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.controller.md.sal.dom.api.DOMDataWriteTransaction, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode, org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)
putRoutes
in interface RIBSupport
tx
- DOMDataWriteTransactiontablePath
- YangInstanceIdentifiernlri
- ContainerNode DOM representation of NLRI in Update messageattributes
- ContainerNoderoutesNodeId
- NodeIdentifier of "routes" data nodepublic Long extractPathId(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode)
normalizedNode
- Path Id Container@Nullable public org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument getRouteIdAddPath(long pathId, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument routeId)
pathId
- The path identifierrouteId
- PathArgument leaf pathpublic org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument createRouteKeyPathArgument(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument routeKeyPathArgument)
routeKeyPathArgument
- routeKey Path ArgumentCopyright © 2018 OpenDaylight. All rights reserved.